Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: MCF on Fri 19/12/2003 16:28:58

Title: Checking to see if character has completed action.
Post by: MCF on Fri 19/12/2003 16:28:58
I see from the help files that there is a 'isobjectmoving' command.  Is there any equivalent for characters.

I have a room in which the playable character rings a bell.  A second character enters.  I want that second character to say something when he reaches his destination.  How do I time this?  
Title: Re:Checking to see if character has completed action.
Post by: Proskrito on Fri 19/12/2003 16:33:56
if (character[CHARID].walking!=1){ //if charid is not walking
do something;
}
EDIT:
oh, i didnt read your post properly. You could also check in the rep. execute if the character's coords are the same as the ones you told him to go , and then run the action

Hope it helps! : )
Title: Re:Checking to see if character has completed action.
Post by: MCF on Fri 19/12/2003 17:38:42
What would be the necessary line to check for x,y coordinates?

If (character[CHARID] ****=1 {
    Display ("BLAH");
}
Title: Re:Checking to see if character has completed action.
Post by: Scorpiorus on Fri 19/12/2003 18:24:30
If (character[CHARID].x == ... &&  character[CHARID].y == ...) {
Display ("BLAH");
}
Title: Re:Checking to see if character has completed action.
Post by: Scummbuddy on Sat 20/12/2003 17:37:59
Or you could see if they have arrived on a hotspot, or a region.
Title: Re:Checking to see if character has completed action.
Post by: BerserkerTails on Sun 21/12/2003 18:28:26
I don't know if I'm understanding the situation correctly, but here's how I'd do it...

Once the character rings the bell I'd add the code to put the second character into the room, then.

MoveCharacterBlocking (2ndchara, 152, 142, 0);
DisplaySpeech (2ndchara, "Blah blah blah");

I don't know if you want to have control while the 2nd character moves to his destination, in which case, listen to these people, use hotspots or regions.