Aller au contenu

Photo

What's difference between Plot Main Flag and Defined Flag?


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
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.

#2
Sunjammer

Sunjammer
  • Members
  • 925 messages
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:
  • 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
Conversely:
  • 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
The way defined flags are implemented are as a set of switch/case statements within a plot script.  The plot script is a StartingConditional script so you can think of defined flags as lots of little StartingConditional scripts (which just happen to have been rolled up into a single script for ease of reference).

Modifié par Sunjammer, 23 janvier 2010 - 05:20 .


#3
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
(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;
}

Modifié par FollowTheGourd, 23 janvier 2010 - 05:26 .


#4
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
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.

#5
RecklezzRogue

RecklezzRogue
  • Members
  • 193 messages
great thread...

#6
QuickQuipt

QuickQuipt
  • Members
  • 7 messages
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
Obadiah

Obadiah
  • Members
  • 5 718 messages
Useful to know.