Quote:
Originally Posted by GreenToxic
Thanks for the fast reply, for the giveitem I know, it say I need to add a #define before it, so I removed it, because I have never seen another script that use #define giveitem ...
|
Hmm, that's odd. What version of XSE are you using? The last edition was 1.1.1 I think?
Quote:
Originally Posted by GreenToxic
I write the script with XSE and then compiled it, that is the code compiled, my offset I've found them using the tool "Free Space Finder" inside "Advance Map"
|
Ah right. Well that's another thing! You can use
#dynamic 0x740000 to automatically find offsets for your script, and XSE makes sure they are clear to use. That way you don't have to use FSF.
Quote:
What I want is, check if the person has at least one pokemon, if yes and if the flag is not set, then give a potion, else dont do anything.
Thank you.
|
Code:
#dynamic 0x740000
#org @start
lock
countpokemon
compare LASTRESULT 0x0
if 0x1 goto @STOP
checkflag 0x200
if 0x0 goto @GETPOTION // if flag is not set, go to next
release
end
'-----------------------
#org @STOP
applymovement 0x1 @Move1
waitmovement 0x0 // waits for movement to finish
msgbox @Talk1 0x6
release
end
'-----------------------
#org @GETPOTION
applymovement 0x1 @Move1 // ??? Do you want a movement here as well? Not sure.
waitmovement 0x0 // waits for movement to finish
msgbox @Talk2 '"Hello there!\nTake this potion."
giveitem 0xD 0x1 MSG_OBTAIN
setflag 0x200
release
end
'-----------
' Movements
'-----------
#org @Move1
#raw 0x12 0x11 0x1 0xFE
'---------
' Strings
'---------
#org @Talk1
= You can't go out without a pokemon,\nit's dangerous out there!
#org @Talk2
= Hello there!\nTake this potion.
#org @Talk3
= I GAVE YOU A POTION // whatever you want.
If this is a green floor-script tile, you'll need to include a 'setvar' command. Have a look in diego's tutorial, or in the one I linked above.
If this is a person-script, you'll probably want to add in another 'msgbox' in the first section, before the 'release/end'.