Ok guys, thanks for posting your scripts here, but just in case you don't get an answer here remember about the script help thread ;)
Chapter 4, Flags
Finally the flags tut is here.
Ok lets start off, flags are based off into 3 basics groups
Code:
setflag
checkflag
clearflag
Most of the time you don't see clearflag come up... it is needed sometimes though. You will understand how to use the flags after this!
Lets start with something way simple. Code the normal base to your script from the other parts of the tut.
Code:
#dynamic 0xOFFSET HERE
#org @start
lock
faceplayer
Now for the flags. add these lines of code
Code:
checkflag 0x200
if b_true goto @flag
This is to check if the flag 0x200 is set and if so going to @flag
Now enter a simple message line in.. whatever the message may be just add it after this. After that we will add our setflag, before that here is how far we should be in the script...
Code:
#dynamic 0xOFFSET HERE
#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6
Now for the setflag... for flags do not use any number but the flags 200 and up and 900 and up.
Add this line of code now!
now we should have
Code:
#dynamic 0xOFFSET HERE
#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6
setflag 0x200
Now end this part of the scrip and now add your message for hi.
Time for the @flag part. before this here is what you should have...
Code:
#dynamic 0xOFFSET HERE
#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6
setflag 0x200
release
end
#org @hi
= Hello there.
Now after that add the #org @flag part of this part of the script.
Time for what we want the flag to go to.
Lets make it a message
Code:
#org @flag
message @woot
boxset 6
release
end
#org @woot
= What you want????
Now for the finished product!
Code:
#dynamic 0xOFFSET HERE
#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6
setflag 0x200
release
end
#org @hi
= Hello there.
#org @flag
message @woot
boxset 6
release
end
#org @woot
= What you want????