Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: AndersM on Tue 15/07/2003 12:25:58

Title: Moving Non-player-character
Post by: AndersM on Tue 15/07/2003 12:25:58
A non playing character is supposed to walk by the scene from left just after fadein, and then disapere when she walks over the edge to the right, but I cant find out how to make a non-player-character interact whit the edges.

I want the Hero to be able to move while she walks, so I had to put a FASLE in the 'wait for move to finish' for the non-player-character. Due to this i can't ad a 'move npc to other room-action' after the movement, cos it wil be execcuted directly...

Help?

Tip for uppcomming versions of AGS: Please make all Player-character options enabled for the non-player-characters too....
Title: Re:Moving Non-player-character
Post by: AJA on Tue 15/07/2003 15:16:57
I hope this'll work (to the repeatedly_execute function of the room):

if (character[CHARID].x > 320) then character[CHARID].room = 2;
Title: Re:Moving Non-player-character
Post by: AndersM on Tue 15/07/2003 15:40:06
Sorry, but she stays in the room, and it does not work with 'Wait for move to finish:false'  Can't I use a hotspot and some kind of 'If character(sharid) on hotspot' stuff?
Title: Re:Moving Non-player-character
Post by: Scorpiorus on Tue 15/07/2003 18:33:10
I believe the interaction editor's move action uses MoveCharacter() command. You need MoveCharacterDirect() here:

on interaction player enters room (after fadein)

Run script:

MoveCharacterDirect(CHARID, 321, <some y>);

then in repeatedly what AJA said. ;)

cheers
Title: Re:Moving Non-player-character
Post by: AndersM on Tue 15/07/2003 23:54:56
Ok, i did like this:

In 'Character enters sceen (before fadein)' I put a 'run script'
that read 'MoveCharacter(GIRL, 1,121);'

And then in 'Repeatedly execute' I put a 'run script'
that read 'if (character[GIRL].x > 320) character[GIRL].room = 2;'

But the damn girl still stops at the edge of the screen and just stands there, looking stupid...
Title: Re:Moving Non-player-character
Post by: Scorpiorus on Wed 16/07/2003 01:01:15
So do you want her to go from the left to right or...?

Also as I said above you have to use MoveCharacterDirect() function ;)

after fadein:
MoveCharacterDirect(GIRL, 321, 121);

repeatedly:
if (character[GIRL].x > 320) character[GIRL].room = 2;



but looking at your last post I guess she should move another direction (shouldn't she?).

then use the next script instead:

after fadein:
MoveCharacterDirect(GIRL, -1, 121);

repeatedly:
if (character[GIRL].x < 0) character[GIRL].room = 2;


how does it turn?

-cheers
Title: Re:Moving Non-player-character
Post by: AndersM on Wed 16/07/2003 10:13:22
If ya guys where girls i'd give ya all a big kiss, but now i draw the line... It worked, thanx to ya all.