Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: ASH DBZKING on Wed 27/09/2006 06:48:25

Title: How do you make 2 characters walk at the same time?
Post by: ASH DBZKING on Wed 27/09/2006 06:48:25
I'm Making a 2-player fighting game and am having trouble making 2 players walk at the same time.
Yahtzee did it at the end of 7 Days.
Help PLZ
Title: Re: How do you make 2 characters walk at the same time?
Post by: SilverWizard_OTF on Wed 27/09/2006 10:17:57
Well, you should be more specific. Do you want e.g. player to walk and having a character NPC to follow him, or to move two characters at the same time in a combat scene (opponent and player)? Please be more specific ;)

1. With script command character[NPC].follow(...........);

2. character[1].walk(....NO BLOCK.....);
    character[2].walk(....NO BLOCK....);
    wait(120); <--- it depends how long the characters will do to go to the destination you want them to go.

Did i help you?  ;)
Title: Re: How do you make 2 characters walk at the same time?
Post by: DoorKnobHandle on Wed 27/09/2006 11:58:04
Actually, you should rather use:


// let both characters walk non-blocking
cChar1.Walk ( ... );
cChar2.Walk ( ... );

while ( cChar1.Moving && cChar2.Moving )
// while both characters are still moving
   // wait
   Wait ( 1 );
Title: Re: How do you make 2 characters walk at the same time?
Post by: ASH DBZKING on Thu 28/09/2006 09:39:58
Quote from: SilverWizard_OTF on Wed 27/09/2006 10:17:57
to move two characters at the same time in a combat scene (opponent and player)?

This is the one I wanted, and can u give me the code to have the player (script-o-name [EGO]) and the opponant (script-o-name [DEMO]) to move at the same time?
Title: Re: How do you make 2 characters walk at the same time?
Post by: Khris on Thu 28/09/2006 09:56:10
Player: player or cEgo
Opponent: cDemo

So use player.Walk(...) and cDemo.Walk(...)

For the parameters of the Walk function, why don't you look them up in the manual? Just make sure you use eNoBlock as the blocking param.