getting where character is standing (x and y) into variable

Started by Dan2552, Sat 20/12/2003 23:18:37

Previous topic - Next topic

Dan2552

how can i get the characters location (x and y) into 2 variables?

Ben

The EGO character's coordinates are stored in these two variables:

character[EGO].x
and
character[EGO].y

where EGO is the character's script name..

If you want to do something with the character's CURRENT position, you can use these just like any other variables.

If you want to save the character's position to use the variables later, just do something like this:

xpos = character[EGO].x;
ypos = character[EGO].y;

or this:

SetGlobalInt(1,character[EGO].x);
SetGlobalInt(2,character[EGO].y);

Dan2552

Quote from: Santa Ben on Sat 20/12/2003 23:21:23
The EGO character's coordinates are stored in these two variables:

character[EGO].x
and
character[EGO].y

where EGO is the character's script name.. You use these just like any other variables.

i want to go to another room, and come back to the location before when the stuff in that room is finnished.
The character[EGO].x and character[EGO].y would change when you goto the second room... (it would also help if it stored what room number aswell)

is there any way to transfer the character[EGO].x and character[EGO].y to normal variables?

edit----------------------------------------------
i think this may work:

multix = character[EGO].x;
multiy = character[EGO].y;

another edit---
stop editing to make it look like you did ALL the work!

SMF spam blocked by CleanTalk