Other Scripting - Flags Help

crstal

Dedicated Member
Dedicated Member
Sep 4, 2011
19
0
27
hey people, i have been learning to script for a while now and understand the basics and all, but i feel the next thing that i need to know is how to do flags, is there any chance someone could post up or find me a detailed tutorial on how to do flags, what theyre for, what they will do etc..? im planning on scripting for someone in the future maybe
thanks for the help, appreciated
:)
Edit: could you also perhaps post a existing script aswell so i can have a look at that? thanks :D
 
Last edited:

Gezza

Golden Oldie
Golden Oldie
Sep 23, 2008
2,202
65
135
uk
Just look in older scripts it's fairly easy.

[@main]
#if
check [001]
#say
flag 001 is on.
#elsesay
flag 001 is off.
=======================
[@main]
<turn on flag 001/@qq>\ \
<turn off flag 001/@qqw>

[@qq]
#act
set [001] 1
close

[@qqw]
#act
set [001] 0
close
 
Upvote 0

crstal

Dedicated Member
Dedicated Member
Sep 4, 2011
19
0
27
when you say set [001] 1 firstly what does the 001 mean, is there a specific reason for it, second what does the 1 mean? and thirdly how does the script know what you want to do, say you could only proceed if you had spoken to another npc how would that be done?
thanks
 
Upvote 0

Gezza

Golden Oldie
Golden Oldie
Sep 23, 2008
2,202
65
135
uk
[001] represents the flag number, that was just an example you can use anything up to 999. The 1 after it means the flag is turned on and a 0 after would turn the flag off.

Heres an example of what your looking for...

npc 1:
[@main]
Please talk to npc2 in mudwall but accept the quest first.\
<accept quest/@quest>

[@quest]
#act
set [100] 1 <---- turns flag 100 on
sendmsg 6 " please visit npc2 in mudwall"
close

==========================
npc2...
[@main]
#if
check [100] 1 <---- checks flag 100 is on
#act
sendmsg 6 "you have completed this quest..."
set [100] 0 <---- turns flag 100 off
#elsesay
You need to begin this quest from npc1

Im sure an advisor will help you if you need any further assistance.
 
Upvote 0

crstal

Dedicated Member
Dedicated Member
Sep 4, 2011
19
0
27
Thanks very much for the explanation :D i understand it more now :) thank you
 
Upvote 0