Community

SCI Programming => SCI Syntax Help => Topic started by: gumby on November 24, 2010, 07:54:12 PM

Title: Giving command to animate
Post by: gumby on November 24, 2010, 07:54:12 PM
Does the SCI0 parser support this?  Example:  troll, put the axe on the ground

I don't ever remember doing anything this complex in SCI.  Basically the parser would have to parse the 'intended animate object' first, then apply the rest of the command to the intended (rather than the 'default', which is first person, the ego/player - right?).

If it doesn't, I can probably hack something together to give us that functionality...
Title: Re: Giving command to animate
Post by: gumby on November 26, 2010, 05:30:10 PM
I've got this implemented.  Will write it up soon in the how-to section. 
Title: Re: Giving command to animate
Post by: MusicallyInspired on November 26, 2010, 05:43:51 PM
You mean, the parser interpreting something and cuing a procedure without actually coding it in?
Title: Re: Giving command to animate
Post by: gumby on November 26, 2010, 06:35:59 PM
You mean, the parser interpreting something and cuing a procedure without actually coding it in?
I'm using the same technique as with the 'basket of goodies' trick.  I check to see if there is an 'animate' being referenced at the very beginning of the input string, set a global 'gActor' variable, strip it off & re-parse the string.  You can then use the global variable for additional logic, like this:

Code: [Select]
(if (== gActor PLAYER)  // player is the 'default'
    (if(Said('jump'))
       Print("You jump up-and-down like an idiot")
    )
)

(if (== gActor TROLL) // another animate in the game
    (if(Said('jump'))
       Print("The troll is much too dignified for such an action and politely refuses your offer")
    )
)

So the first statement would apply to an input string of 'jump'.  The 2nd would apply to an input string of 'troll, jump'.