• ✨ ARCHIVE MODE ✨
    The forum has now been set to read-only mode, no new posts, resources, replies etc will not be possible.
    We recommend you join our Discord server to get real-time response: Discord Invite Link

Ilex Forest

Status
Not open for further replies.

BakaOnibi

Trainer
Donator
I've attached the files to this post.

Ok, here's what I've done:
I restructured the code so that it only uses one Farfetch'd. When you talk to the Farfetch'd it checks the NPC's position and then starts another script for which will check the player's position and make the correct action.

The game doesn't seem to like putting one if inside of another, it kept messing up the code somehow and doing the completely wrong thing, sometimes putting me into an infinite loop.

I made it so you have to talk to the person for the "quest" to start (since I notice in your code saying, "I have no idea~How to script~this Event"), this makes the farfetch'd appear and does the appropriate registry entry.
The last movement for farfetch'd (Ilex\farfetch'd4.dat) will do the finishing register and npc changes. But a problem with it I couldn't figure out how to fix was that it comes up with a blank text box at the end of this movement.

I haven't done every possible movement for farfetch'd, only the minimal required to finish the event. And I haven't done proper speech for the worker, or his boss (,it just does basic messages); but I'm sure you can fill those in.
 

Attachments

JojoP

Pokémon Ranger
I have implemented most movement. The problem is, that after some actions the code messes up... Instead of checking for the code it needs it just says it's message. There are also empty text boxes before the real one.
Code:
:if:position(100,21,0,15)
:then
@Script:Ilex\farfetch'd1
:end
:endif
 
:if:position(100,20,0,21)
:then
@Script:Ilex\farfetch'd2
:end
:endif
 
:if:position(100,20,0,17)
:then
@Script:Ilex\farfetch'd3
:end
:endif
 
:if:position(100,25,0,11)
:then
@Script:Ilex\farfetch'd4
:end
:endif
 
if:position(100,15,0,22)
:then
@Script:Ilex\farfetch'd5
:end
:endif
 
if:position(100,6,0,24)
:then
@Script:Ilex\farfetch'd6
:end
:endif
 
if:position(100,7,0,15)
:then
@Script:Ilex\farfetch'd7
:end
:endif
 
if:position(100,11,0,9)
:then
@Script:Ilex\farfetch'd8
:end
:endif
 
if:position(100,13,0,15)
:then
@Script:Ilex\farfetch'd9
:end
:endif
Code:
@Text:FARFETCH'D: Kwaa!
:if:position(Player,6,0,23)
:then
@Turn:100,3
@Move:100,9
@Turn:100,0
@Move:100,2
:end
:endif
 
:if:position(Player,7,0,24)
:then
@Turn:100,0
@Move:100,9
@Turn:100,3
@Move:100,1
:end
:endif
Code:
@Text:FARFETCH'D: Kwaa!
:if:position(Player,6,0,15)
:then
@Turn:100,3
@Move:100,6
:end
:endif
 
:if:position(Player,8,0,15)
:then
@Turn:100,1
@Move:100,1
@Turn:100,0
@Move:100,2
@Turn:100,1
@Turn:100,3
@Turn:100,1
@Turn:100,3
@Turn:100,2
@Move:100,11
:end
:endif
 
:if:position(Player,7,0,14)
:then
@Turn:100,2
@Move:100,3
@Turn:100,1
@Move:100,1
@Turn:100,2
@Move:100,6
:end
:endif
 
:if:position(Player,7,0,16)
:then
@Turn:100,0
@Move:100,4
@Turn:100,3
@Move:100,4
:end
:endif
:end
 

BakaOnibi

Trainer
Donator
With the empty text boxes I can't help you, I couldn't figure out what was causing them to appear.

As for it ignoring the conditions, from the code you posted, it looks like there shouldn't be a problem, I really don't know what to say.
 

JojoP

Pokémon Ranger
I suppose the game tries to avoid "loading" times so it takes something else that is reachable... but I'm not sure about that.
 

JojoP

Pokémon Ranger
It ignores the whole script at some point... I tried it with text only (a different text obviously) and it seemed that it didn't even try to get the script from farfetch'd6
 

BakaOnibi

Trainer
Donator
Just staring at the code, feeling frazzled.

So it ignores everything from the 6th if statement down?
Have you tried reordering the code to check this? Just put farfetch'd4 down to the bottom for a bit, to see if 6 will work then.
 

JojoP

Pokémon Ranger
The code seems to take the :if: statements as a list ... if I put farfetch'd6 to the top it creates an infinite loop (because it searches for an action going through the script always executing @Text)
The way this is set up can't work because it only works if you do it in the right order. It seems to mark an :if: statement as used and applies the next upon further encounters...
 

BakaOnibi

Trainer
Donator
Huh? You've confused me.

When a script is started, it should begin from the top of the script and work it's way down. So it should check every :if statement, and perform them if the conditions are met. If an @Text is inside of an :if and the conditions are not met then it should not write out the text. Although I put :end in each if statement to stop the script when it has done the :if statement.

From what you're saying it seems like it remembers it's place in a script and continues reading from where it finished. So if you last did 5, the next time you try to use the script it will start searching at 6
I hope I've interpreted what you said correctly.

A possible fix, if I am correct would be to remove the :end within the :if statements. This would make it so it does not prematurely end the script and continues through all of the :if statements so that it reaches the end of the script.
Code:
:if:position(100,25,0,11)
:then
@Script:Ilex\farfetch'd4
:endif
Although, this is unlikely to work, if something moves it into a position that appears later in the script, then it would do that action also.
 

JojoP

Pokémon Ranger
It makes no difference if you remove :end from the script...
The problem is the way the game checks the script, it somehow avoids already used :if: statements
 

BakaOnibi

Trainer
Donator
The problem is the way the game checks the script, it somehow avoids already used :if: statements
But I don't know of anywhere else in the game that this happens. Just try starting a new game and trying to get out New Bark Town before you get a pokemon, she stops you every time with the code:
Code:
:if:nopokemon(0)
Unless it's a problem specifically with a script called from another script. If so you could try putting every :if statement for the positions in a single script, ignoring the check for the farfetch'd's position. This would work as long as there are no two positions for farfetch'd that where the player could speak to it from the same position.

Otherwise, you will have to ask nilllzz about it.
 

JojoP

Pokémon Ranger
The problem seems to be that when activating the walking scripts the initial script is on hold. Now the movement is made and the script stopped. But the script checking for the position is still on hold until you reopen it by clicking the farfetch'd again. Can't I tell the movement script to go back to the initial script?
 

BakaOnibi

Trainer
Donator
You might be able to but I don't know how.
The :end stops a script, so presumably removing it, once at the end it would go back to the original script. You posted 2 movement scripts, one of them has an :end (at the end of the script) and the other doesn't. I believe the one without is the script for farfetch'd6, so I think my presumption is wrong. Looking at the positions, it looks like the one with it is farfetch'd7. Does 7 work? If so, try adding an :end to the end of 6. Otherwise I'm going to go read every script to see if such a command has already been used.
 

JojoP

Pokémon Ranger
if there is no :end in the script the script repeats, that creates the infinite loop. That's also why removing the :end from the first script does "work" - it never comes to the end of the script ...
 
Status
Not open for further replies.
Top