> However! The problem here is that n isn't the exact number as seen by the
> script, like 1,2,3 ... 16.  N is just an index of the object. The script
> sees the "script numbers", which are the ones shown in the GUI, and are set
> and retrieved by
>
>     void setScriptNumber(int n, int scriptNumber);
>     int getScriptNumber(int n);
>
> This is why in SGSL, the setObjectiveComplete functions and such look
> through all of the objectives to find one with a matching 'script number'
>
> void Story::objectiveFailed(GameGUI* gui)
> {
>     int n = line[++lineSelector].value;
>     for(int i=0; i<gui->game.objectives.getNumberOfObjectives(); ++i)
>     {
>         if(gui->game.objectives.getScriptNumber(i) == n)
>         {
>             gui->game.objectives.setObjectiveFailed(i);
>             break;
>         }
>     }
> }

Why do we need the script number? Why cannot USL use the normal indexes? This 
difference makes things cumbersome, I would like to understand why it exists 
and weather we can get rid of it. Otherwise, your explanation is good and I'll 
do as you suggest.

Have a nice day,

Steph

-- 
http://stephane.magnenat.net


_______________________________________________
glob2-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/glob2-devel

Reply via email to