View Single Post
  #22987    
Old October 18th, 2012 (01:31 PM).
borisjo's Avatar
borisjo borisjo is offline
Scripter (XSE, pokescript)
 
Join Date: Mar 2011
Gender: Male
Posts: 9
Quote originally posted by Jambo51:
You can't execute scripts like that using type 5 level scripts. It explicity requires type 2, which in turn, is variable reliant.

Try setting a variable you haven't used inside the type 5 script:
Spoiler:
#dynamic 0x800000

#org @main
[Checks for caught Pokémon]
[If not caught, branch to @alt]
setvar 0x40F0 0x1
end

#org @alt
end


And then putting the "exit" script in the type 2 level script slot, using (in my example) var 0x40F0 as the control value, and set the "value" to 1.

Your script requires some modification, because you can't warp and then continue execution of the script, so it needs split up into 2 parts.

Type 2 level script (Map 1, same map as type 5 script from above):
Spoiler:
lock
msgbox @1 0x2
warp 0x0 0x05 0xFF 0x1A 0x0E
waitstate
setvar 0x40F0 0x2
release
end

#org @1
= Attention! We have our\nlast member: \vh01!


Finally, you need to (in the map you warp back to) add yet another type 2 level script which contains the remaining movement part. The var is still 0x40F0, but the value is now 2:
Spoiler:
lock
applymovement 0xFF @move
waitmovement 0x0
setvar 0x40F0 0x3
release
end

#org @move
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0xFE


I know for a fact that the last 2 parts will work, but I'm not sure about the type 5 level script part. It's worth a try. If it doesn't work, you're looking at ASM hacking to get your desired result, and that's not fun.
It's been a while since I scripted XSE so I need to get back into it also I'm dutch and learning a scripting language in English is not the easiest for me so I hope you can explain some more about this.

I understand I need to make 3 scripts, 1 type 5 levelscript that detects that I caught(or that I didn't caught) a specific pokemon.
1 type 2 levelscript that warps me to a certain point and 1 typ2 levelscript that makes me move.
But I don't quite understand how these scripts follow up to each other.
I can't follow the 0x40F0 part, when it's set to 1 does the next script sees it because it is going to set the variable to value 2? Sorry if my grammar isn't good, I'm trying my best!

I hope you will take time to explain this to me, again thanks in advance!