Aller au contenu

Photo

SOLVED:General scripting question - 'script' behaviour


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

#1
RecklezzRogue

RecklezzRogue
  • Members
  • 193 messages
When an area script is sent events, does everything execute as if it were the first time the script was run, or do just the switches/cases execute? (I know - I am not a programmer....)...I think I know the answer at this point - but some confirmation would be great...thanks...

For example - does the following execute each time the area script is referenced during gamelplay:

void main()
{
        //
        // Setup  patrol control plot flags
        WR_SetPlotFlag (PLT_DMO001_DAFL001D_PLOT,17, FALSE);
        WR_SetPlotFlag (PLT_DMO001_DAFL001D_PLOT,18, FALSE);
        WR_SetPlotFlag (PLT_DMO001_DAFL001D_PLOT,19, FALSE);
        WR_SetPlotFlag (PLT_DMO001_DAFL001D_PLOT,20, FALSE);
        WR_SetPlotFlag (PLT_DMO001_DAFL001D_PLOT,21, FALSE);
        WR_SetPlotFlag (PLT_DMO001_DAFL001D_PLOT,22, FALSE);
        WR_SetPlotFlag (PLT_DMO001_DAFL001D_PLOT,23, FALSE);
        WR_SetPlotFlag (PLT_DMO001_DAFL001D_PLOT,24, FALSE);
        WR_SetPlotFlag (PLT_DMO001_DAFL001D_PLOT,25, FALSE);
        WR_SetPlotFlag (PLT_DMO001_DAFL001D_PLOT,26, TRUE);

note - the problem I am trying to diagnose is the mysterious 'unsetting' of plot flags

Modifié par RecklezzRogue, 19 avril 2010 - 09:42 .


#2
RecklezzRogue

RecklezzRogue
  • Members
  • 193 messages
yep - i think I pretty much answered my own question - the script does execute from top to bottom each time it is called - so - I moved the setting of plot flags to case EVENT_TYPE_AREALOAD_PRELOADEXIT: and things are behaving.


#3
Proleric

Proleric
  • Members
  • 2 357 messages
Yes, as a broad rule-of-thumb, stuff in an event script ought to be in a case for a specific event - otherwise, it's unclear when or why the script might run.

#4
RecklezzRogue

RecklezzRogue
  • Members
  • 193 messages
thanks