Non-player movement

Started by mattman26041, Mon 11/04/2005 19:38:48

Previous topic - Next topic

mattman26041

Ok, so this game will be where you must start in a room, go past guards, and escape.
I got all it figured out EXCEPT the guard part. I want them to go on a distinct course and if they TOUCH/HIt the player it goes to roomx (roomx is where the game over screen will appear)

Thanx for reading
"the sniper project" coming soon

Ashen

#1
As a general tip:
, and the BFAQ, and the forums, and the tutorial in the manual, and the tutorials in the forums. Almost every question you've asked so far is answered in one of those places.

For example, searching the manual turns up these functions:
Quote from: The Manual
MoveCharacter
MoveCharacter (CHARID, int x, int y)

Starts the character CHARID moving from its current location to X,Y. CHARID can be either the character's number (as GetPlayerCharacter returns) or its ID set in the Room Editor. If the character cannot get to X,Y it will be moved as close as possible.
Control returns to the script immediately. The character will move in the background.

NOTE: this function only works with characters which are on the current screen.

NOTE: if you need to find out when the character has reached its destination, use the character[charid].walking variable. See the variables section for more information.
Quote from: The Manual
MoveCharacterPath
MoveCharacterPath (CHARID, int x, int y)

Tells the character CHARID to move to (X,Y) directly, after it has finished its current move. This function allows you to queue up a series of moves for the character to make, if you want them to take a preset path around the screen. Note that this works equivalently to MoveCharacterDirect, ignoring walkable areas.
This is useful for situations when you might want a townsperson to wander onto the screen from one side, take a preset route around it and leave again.

Example:

MoveCharacter (SOMEGUY, 160, 100);
MoveCharacterPath (SOMEGUY, 50, 150);
MoveCharacterPath (SOMEGUY, 50, 50);

tells character SOMEGUY to first of all walk to the centre of the screen normally (obeying walkable areas), then move to the bottom left corner and then top left corner afterwards.



And, searching the forums for 'NPC movement' turns up a number of possibilities, including this:
How can I make a NPC move across the screen?

As for triggering something when the guard collides with your character - someone else asked the same question just a few days ago, try searching the forums for it.
I know what you're thinking ... Don't think that.

TerranRich

Status: Trying to come up with some ideas...

SMF spam blocked by CleanTalk