Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Femme Stab Mode >:D on Tue 07/10/2003 06:15:50

Title: adding a new function to gui?
Post by: Femme Stab Mode >:D on Tue 07/10/2003 06:15:50
So I'm finaly taking interest in scripting. What I want to do is add a "poke" function to the gui, making it similar to walk and look, etc. Like if the main character pokes a person his view will change, and the character poked  will react differently from when the main character interacts with him/her. So, can someone give me the basic idea of how I would script this? It doesn't seem too hard.
Title: Re:adding a new function to gui?
Post by: Ishmael on Tue 07/10/2003 13:29:41
Probably the best way (as I see it) is to make a whole new function for the pokeing, then run it from a GUI buttonpress. In the GUI, set the "Poke" button to run script, the in the GUI script set the if's so thet the pokeing function is run when it shoud. ;)

function PokeCharacter(int CharID) {

SetCharacterView(EGO,pokeingview);
AnimateCharacter(EGO,0,0,0);
while (character[EGO].animateing == 1) Wait(1);
ReleaseCharacterView(EGO);
SetCharacterView(CHAR,pokedview);
AnimateCharacter(CHAR,0,0,0);
while (character[EGO].animateing == 1) Wait(1);

}

or something... Needs refining! ;D