Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Mr.Trant on Sat 14/06/2003 20:40:08

Title: Help with scripting a hotspot!!
Post by: Mr.Trant on Sat 14/06/2003 20:40:08
i am trying to make a hotspot that if u hit a key or run an animation when u stand on it makes the game run an animation!! heres wut i have tried buti cant get it!!

if(character[THEONE].animating (THEONE,5,5,0);

*(THEONE,5,5,0); = the loop number and speed and stuff*

wut can i do!!!??? ??? (the key would be the letter "a")

Please help!!! thanx
                                                      MR.T
Title: Re:Help with scripting a hotspot!!
Post by: TheMagician on Sat 14/06/2003 21:31:03
Hi there,

for pressing a key while standing on a hotspot you should rather use a "Region" instead of a "Hotspot".

So: create a new region in the room editor (create it in the same place as the hotspot). Then click on "Interaction..." for this region and choose "While Player stands on region".  Now you choose "Run Script" and type in the following:

if (IsKeyPressed(65)==1) {  // 65 is the ASCII code for the letter A
AnimateCharacter(THEONE,5,5,0);
}  

Now the animation should play if the player stands on the region and presses the "A-key".


Did this help you?

The Magician
Title: Re:Help with scripting a hotspot!!
Post by: Mr.Trant on Wed 18/06/2003 01:12:13
ya thanx a lot, i just d/l'ed the new version