Development Forum |
|
Checking for Safe Location? | |
|
the1whoscreams
|
10/3/2017 | |
I'm working on an agent that injects in the form of a tiny seed that fits in the inventory and turns into a giant machine that does not fit in the inventory when clicked. I need it to be able to check to see if it's in a safe location to transform when it's clicked so that it doesn't autokill if the space is too small. Any help? |
Malkin
Manager
|
10/3/2017 | |
TMVT is your friend.
My TCR Norns |
the1whoscreams
|
10/3/2017 | |
That's exactly what I'm looking for! I can't seem to find a way to get the agent to reference its own coordinates, though. I was thinking (current X/Y position) + (how much you're moving), but I don't know how to do that. |
Zzzzoot
|
10/3/2017 | |
I believe POSX and POSY will work for you. They return the X and Y positions of the center of TARG.
So something like:
setv va00 posx
setv va01 posy
should work. (assuming TARG has been set to your agent)
Position (0, 0) is the top left corner of the entire world, so adding to X and Y moves the position right and down. Subtracting moves left and up.
Be careful, MVTO (and I assume TMVT) use the *top left corner* of the agent's sprite, while POSX and POSY use the *center* of the agent's sprite. |