Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: on Thu 22/01/2004 07:07:31

Title: About dialog and animations?
Post by: on Thu 22/01/2004 07:07:31
Hello!

I have two questions:

How could I make the game run an animation loop after I have chosen a certain alternative from the dialog?

And it would be nice if the animation wouldn't start if the character wouldn't have a certain inventory item with him/her/it.

Title: Re:About dialog and animations?
Post by: Reno Caspain on Thu 22/01/2004 10:47:49
You could put the run-script command in the dialog script, for example:

(in dialog you want to run the animation in)

run-script 1 //This runs the script 1 from dialog_request function in main script


(in main script)

function dialog_request (int xvalue)
{
if (xvalue==1)
  {
  if (character[character number here].inv[inventory item number]==1) //checks whether the character has the item
     {
      AnimateCharacter(parameters here); //runs the animation
     }
  }
}

In case you need the game to wait until the animation ends, you could use the AnimateCharacterEx function instead of AnimateCharacter.

Title: Re:About dialog and animations?
Post by: on Thu 22/01/2004 13:44:32
Thank you for your quick response!

I'll go and try this.