Home   Help Search Login Register  

Author Topic: X, Y, Z coordinates  (Read 1178 times)

0 Members and 1 Guest are viewing this topic.

Javito

  • Guest
X, Y, Z coordinates
« on: 17 Aug 2006, 08:14:18 »
How exactly are you supposed to know where on the map pertains to what coordinate? I'm trying to understand this aspect of the game so I can use commands like setpos, getpos, or target things with Lib '41 artillery (-especially- so I can target things with artillery actually). Z coordinates I assume are straight up and down? Correct me if I'm wrong. But how are you supposed to find out what the X and Y coord is for the section of the map you want to interact with?

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: X, Y, Z coordinates
« Reply #1 on: 17 Aug 2006, 08:55:50 »
There are many possible ways.  One is not to bother with coordiantes but use the locations of objects already on the map.  Turn Object Ids on in the mission editor, find the ID number of  bush or something and then do a
getPos (object XXXX)
where XXXX is the ID number.

One method I use a lot is to find actual coordinates is to create a repeating radio trigger that has the following On Activationion code:
hint format ["%1",getPos player]

Then I go into the mission, move to the location I need the coordinates for and activate the radio trigger.

If you want coordinates that are in the sea then just put a boat or a game logic there, give it a name and replace player in the hint above with the object's name.

This will give you the x,y,z coordinates in that order.  X is measured west to east (so x=0 is the western edge of the map). Y is measured south to north and z is measured vertically from ground level.  For future reference angles are measured clockwise starting with North as zero.
« Last Edit: 17 Aug 2006, 09:01:17 by THobson »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: X, Y, Z coordinates
« Reply #2 on: 17 Aug 2006, 09:01:34 »
in terms of the actual values, x is from west to east (left to right) so x=0 is the left side of the map. y is south to north (bottom to top) so y=0 is the bottom of the map.

and you're correct, the z value represents height above the ground.

i suggest you play with the onmapsingleclick command. this will allow you to run the mission, click on the map, and return the x and y coordinates of where you clicked - you'll need to do a tiny bit of scripting though ;)

Javito

  • Guest
Re: X, Y, Z coordinates
« Reply #3 on: 17 Aug 2006, 20:29:32 »
Thanks for the help as always. I now have the coordinate system working.