Thread: [Tutorial] Basics of Scripting
View Single Post
  #30    
Old February 10th, 2013, 11:54 AM
.parado✗'s Avatar
.parado✗
paranormal user
 
Join Date: Sep 2012
Location: Ha✗land
Age: 18
Gender: Male
Nature: Gentle
Send a message via Skype™ to .parado✗
Flags are nothing else than "checkers" in a Pokémon Game.
If someone gives you an item, you set a flag, that he can't give it to you twice, three times, endless.

It works this way..

#dynamic 0xXXXXX
#org @start
checkflag 0xyour_flag
if 0x1 call @got_it <---- this checks if the flag 0xyour_flag is set. If 0x1 (yes), call a pointer.
giveitem 0xItem 0xAmount 0x0 0x0 0x0
waitfanfare
closeonkeypress
setflag 0xyour_flag <---- Sets a flag. I prefer starting at 0x450 up to 0x7FF and 0x900-0xFFF
end

#org @got_it
end

Well, if you click the person again, it will automatically jump to @got_it and the script ends.
Attention! You can set every flag only once!
If you set for example setflag 0x500, you can check this flag everytime, to remove it, type

clearflag 0xyour_flag

Hope I helped
__________________
If you are interested in a german romhacker forum, go to

www.board.romresources.net

I'm registered under the name: "Laz0r" there.
Reply With Quote