Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: kaaZ on Mon 29/09/2003 16:41:24

Title: Replacing Character
Post by: kaaZ on Mon 29/09/2003 16:41:24
Hey guys...
Does anyone know which function allows me to replace a character
from one position to another in an instant, so without actualy going through the walk cycle or seeing the character move. Couldn't find it in the AGS help nor on the forum.

Cheers!

kaaZ
Title: Re:Replacing Character
Post by: taryuu on Mon 29/09/2003 20:16:46
you can move the player character with
Player go to different room at specific co-ordinates.  
i don't know if that it'll work in your case.

can you amplify what you need to do?

Title: Re:Replacing Character
Post by: kaaZ on Mon 29/09/2003 20:41:02
I was thinking about that as well...but I was pretty sure there has to be a function which actualy does replace a character within a room. So before thinking of any other solution I wanted to find out what function enables me to do so.
Anyways...here's the situation:

The character is standing in front of a house. A stairs is partly hidden behind the house which leads up to a balcony. As soon as the character climbs the stairs he disapears behind the house walkbehind area. At that point he's has to reach the balcony (on the second floor) and still stand behind the walkbehind area of the house, but since he's on a different floor the baseline doesn't match anymore so he is standing in front of the house.....

Hope that makes sense....if not I'll include a screenshot of the situation...

Cheers!

kaaZ
Title: Re:Replacing Character
Post by: Darth Mandarb on Mon 29/09/2003 20:43:39
I was looking for this function as well!  I could move the character (or object) around the room but you could see it go from one spot to the next.  I want it to be like a transport where when you step on the platform you instantly move to another location (same screen!)

Is this what you're talking about too Kaaz?

~ darthMANDARB
Title: Re:Replacing Character
Post by: kaaZ on Mon 29/09/2003 20:52:13
That's exactly what I mean ;)

Any solution ?
Title: Re:Replacing Character
Post by: Scummbuddy on Mon 29/09/2003 21:32:40
Go ahead and try the NewRoomEx function and tell us what happens.  make sure you have your walkable areas set up.
-----------------------------------
NewRoomEx
NewRoomEx (int room_number, int x, int y);

Identical to NewRoom, except that the player character is placed at co-ordinates (X,Y) in the new room.
Example:

NewRoomEx(4,100,50);

will move the player character to room 4 and also place him at coordinates 100,50.
Title: Re:Replacing Character
Post by: Timosity on Tue 30/09/2003 06:06:03
if you just want to place a character at another location in the same room without walking just do this.

character[EGO].x=100;  //whatever x coordinate you like
character[EGO].y=200; //whatever y coordinate you like

This just puts the character at the coordinates you specify

I think that's the easiest solution.

For an object, use this

SetObjectPosition(1,155,120); // position object 1

~Tim
Title: Re:Replacing Character
Post by: Ishmael on Tue 30/09/2003 11:37:54
Let's take it to the extreme... ;D

function PlaceCharacter(int CharID, int x, int y) {
character[CharID].x = x;
character[CharID].y = y;
}
Title: Re:Replacing Character
Post by: kaaZ on Tue 30/09/2003 13:04:59
Cheers guys...
Thanx alot !