Simple question from a simple person (moving characters)

Started by vpresrufus, Fri 08/04/2005 15:25:32

Previous topic - Next topic

vpresrufus

Basically, i want to move a character from point a to point b, however, there is no walkable path he could take, and i want him to kinda teleport there if you get what i mean. basically i want a man standing at poin A to disappear, and reappear at point B. any ideas?

FrogMarch

You could move your character from the current room to room -1, and then move him back to the current room at dfferent co-ordinates. However, if it is your main character, you'll have to make someone else the playable character while this is happening, to ensure that the player doeesn't get taken to room -1 as well. To do this, just create a character using an 'invisible' sprite (which uses a slot with no visible image), and temporarily make this character the playable one. That should do the trick.

vpresrufus


Ashen

Actually, you don't need to move them to another room then back, just use NewRoomEx (room, x, y) to move the player character (change the transition type if you don't want it to fade in/out), or NewRoomNPC (charid, room, x, y) to move an NPC around with in the room.

You could also change the character's co-ordinates directly:
Code: ags

StopMoving (EGO);
character[EGO].x = 50;
character[EGO].y = 50;
I know what you're thinking ... Don't think that.

TerranRich

Yeah, but to vanish and then re-appear some time later, you'd most likely go with either:

(1) FrogMarch's great Room -1 idea, or:

(2) Make the character fully transparent by using SetCharacterTransparency(CHARNAME, PERCENTAGE); I believe. :)

Should I add this to the BFAQ?
Status: Trying to come up with some ideas...

SMF spam blocked by CleanTalk