Defined flags seem to allow you to combine conditions like Male and Elf, but how exactly do they work? I looked through the wiki and can't really find anything about defined flags.
What's difference between Plot Main Flag and Defined Flag?
Débuté par
PavelNovotny
, janv. 23 2010 04:33
#1
Posté 23 janvier 2010 - 04:33
#2
Posté 23 janvier 2010 - 05:18
You may find my Plot flags (draft) article helpful.
Defined flag is a bit of a misnomer which personally I found a little confusing. It took me a long conversation with Craig Graff and the realisation that they are neither defined nor a flag before I was comfortable with them.
The key differences are:
Defined flag is a bit of a misnomer which personally I found a little confusing. It took me a long conversation with Craig Graff and the realisation that they are neither defined nor a flag before I was comfortable with them.
The key differences are:
- a main flag's state is persistant (set or unset, TRUE or FALSE, 1 or 0)
- you can get or set the current state of a a main flag
- a main flag can have a journal entry
- a defined flag's state is determined (using scripting) whenever it is checked.
- you can only get the current state of a defined flag
- a defined flag cannot have a journal entry
Modifié par Sunjammer, 23 janvier 2010 - 05:20 .
#3
Posté 23 janvier 2010 - 05:21
(Edit: Sunjammer beat me to it, but my example still stands)
Defined plot flags use the associated plot script and the return value from its StartingConditional() function whenever they're read.
E.g., take the defined plot flag GEN_PC_IN_COMBAT in gen00pt_generic_actions.plo. In its associated plot script, gen00pt_generic_actions.nss, it has this code fragment where the return value, nGetResult, determines at the time of query whether the flag is true or false.
case GEN_PC_IN_COMBAT:
{
if ( GetCombatState(oPC) )
nGetResult = TRUE;
break;
}
Defined plot flags use the associated plot script and the return value from its StartingConditional() function whenever they're read.
E.g., take the defined plot flag GEN_PC_IN_COMBAT in gen00pt_generic_actions.plo. In its associated plot script, gen00pt_generic_actions.nss, it has this code fragment where the return value, nGetResult, determines at the time of query whether the flag is true or false.
case GEN_PC_IN_COMBAT:
{
if ( GetCombatState(oPC) )
nGetResult = TRUE;
break;
}
Modifié par FollowTheGourd, 23 janvier 2010 - 05:26 .
#4
Posté 23 janvier 2010 - 06:18
Thanks guys!
Sunjammer - Plot Assist generates those arrows over objects that show you the next step in the quest. You put in the tag of the object and you can turn the arrow on or off depending on the flag.
Sunjammer - Plot Assist generates those arrows over objects that show you the next step in the quest. You put in the tag of the object and you can turn the arrow on or off depending on the flag.
#5
Posté 19 avril 2010 - 05:45
great thread...
#6
Posté 26 avril 2010 - 08:22
As an aside: The term "Defined Flag" can sometimes be pretty descriptive. I was writing a conversation which needed a conditional test which wasn't available. So I defined one.
#7
Posté 23 avril 2011 - 06:35
Useful to know.





Retour en haut






