glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [glob2-devel] Hints support in USL + questions


From: Stephane Magnenat
Subject: Re: [glob2-devel] Hints support in USL + questions
Date: Thu, 23 Oct 2008 10:13:02 +0200
User-agent: KMail/1.10.1 (Linux/2.6.24-21-generic; KDE/4.1.2; i686; ; )

> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]