raising flags

leftycool
26 Sept 2012, 00:41
Hi, sorry to bother everyone real quick, I was just wondering the what would be the simplest way for a new developer to implement 'raising flags' or behind-the-scene checkpoints. Do i have to insert code or is a feature implemented for this?
thanks in advance.

leftycool
26 Sept 2012, 01:34
To clarify, i understand raising flags for basic on/off checking, but im trying to make a system where the player characters body description changes over the course of the game. would this be an appropriate use of flags?

sgreig
26 Sept 2012, 05:45
Yes. That's exactly how you would do something like that. You'd set various flags as the game progressed, and then use if statements to check if these flags are true or false and modify the player's description based on that.

guzmere
26 Sept 2012, 06:00
Hi leftycool hope you are well, here is a simplified version of how flags can be used. I've placed a drink command in the verbs section of the object potion. When you look at the player type in (look at me) then drink the potion and type in (look at me) again afterwards to see the difference. Have fun Terry :D :D :D :D

Pertex
26 Sept 2012, 11:20
If you want to handle more than two states, it's perhaps better to use a numeric variable for this. Then you could use a string dictionary to save the descriptions something like this:
<state type="stringdictionary">1 =This is the first description ;2 =This is the second description ;3 = This is the third description</state>

So if your variable changes, you can easily call the descriptiontext like this

statusvariable=2
msg(DictionaryItem (state, ToString(statusvariable)) )

leftycool
01 Oct 2012, 13:42
Thanks for all the help you guys, I have a basic system from raising flags in place now, and theyre very useful :)
Real quick, how can I see if an item has flags raised/unraised? Im trying to track a flag in particular to change the players interactions with objects as well as room descriptions, but I forgot what had the flag for the light on/off and had to manually try to dig it up. is there a tab on the item somewhere that lists attached flags?
thanks in advance :)

sgreig
02 Oct 2012, 07:56
Flags are listed under the attributes tab of an object.