Moving Non-player-character

Started by AndersM, Tue 15/07/2003 12:25:58

Previous topic - Next topic

AndersM

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....

AJA

I hope this'll work (to the repeatedly_execute function of the room):

if (character[CHARID].x > 320) then character[CHARID].room = 2;

AndersM

#2
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?

Scorpiorus

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

AndersM

#4
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...

Scorpiorus

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

AndersM

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.

SMF spam blocked by CleanTalk