Results 1 to 10 of 10

Thread: Find out position

Hybrid View

  1. #1
    First Lieutenant Manzilla's Avatar
    Join Date
    May 30 2007
    Location
    In the lab cooking up some serious s#%t!
    Posts
    5,118

    Find out position

    Sorry for this post but for the life of me I can't find this example mission that was posted here. It had a script or something that told you your exact position in game so you can easily place objects. I used it in A1 and saw it the other day for A2 but I can't find it any more.

    Can anyone help? I've tried different searches but it eludes me still. Thanks in advance.
    (God damn bananas..... again)

    Join the most rootin', tootin'est crew on these here forums! That's right folks we're darn tootin'.

    Mike Tyson's ode to Manzilla's SP playing style:
    My style is impetuous. My defense is impregnable and I'm just ferocious.... I want your heart, I want to eat his children! Praise be to Allah!

  2. #2
    Well to hint a unit's exact position you would use something like:
    Code:
    hint format ["X: %1, Y: %2, Z: %3",(getPos UNIT) select 0, (getPos UNIT) select 1, (getPos UNIT) select 2,];
    If that is what you mean?

  3. #3
    First Lieutenant Manzilla's Avatar
    Join Date
    May 30 2007
    Location
    In the lab cooking up some serious s#%t!
    Posts
    5,118
    Author of the Thread
    I'm pretty sure that's it. I appreciate the help.

    Just to be clear:

    Basically I'm looking for something that I can go in game, go to a room on the 2nd floor of a building and somehow get a hint that tells me exactly where I am so I can go back to the Editor and add an object to that exact spot.

    Trial and error is killing me today

    Thanks again.

    EDIT:

    Hmmm. I added this to the player's init and it said an error "missing [". Isn't that where this goes?

  4. #4
    Hi there,

    You could call Andy's code with a radio!

    That way wherever you are you could call channel Alpha and get on screen the info/coordinates of exactly where you are.

    Just a thought.

    Best, Splicer.
    "We must either find a way or make one."
    - Hannibal

  5. #5
    Well that should work in a units Init field, I tested this code in a radio trigger:
    Code:
    hint format ["X: %1,  Y: %2,  Z: %3",(getPos player) select 0, (getPos player) select 1, (getPos player) select 2];
    EDIT: just saw there was an extra ',' in the code I first typed, the above works fine.

  6. #6
    First Lieutenant Manzilla's Avatar
    Join Date
    May 30 2007
    Location
    In the lab cooking up some serious s#%t!
    Posts
    5,118
    Author of the Thread
    You guys are the best. It works great, thank you!

    What the exact way I use this info in an objects init line. The way I'm accustom to isn't working. God it's just not my day for using the Editor.

    It should be like this, right?
    Code:
    this setPos [x, y, z]; this setDir n(Whatever desired direction);

    EDIT:


    Alright I got that to work as well but I noticed the hint command I'm using doesn't take into account height it seems. I was on top of a building but it was giving me the z coordinate as 0.00143433 but I was clearly higher. Is there one that gives the height relative to the actual ground and not the floor you are standing on. I think somehow it's getting fooled into giving me the height relative to the floor I'm on and not the actual height. I honestly have no clue as to what's going on though.
    Last edited by Manzilla; Jan 18 2010 at 21:08.

  7. #7
    Code:
    hint format ["X: %1,  Y: %2,  Z: %3",(getPos player) select 0, (getPos player) select 1, (getPosATL player) select 2];
    All I changed was the last part which controls the Z to getPosATL which means it gets the position of the unit relative to the terrain.

  8. #8
    Andy's last code should work. I've used the hint command and did get altitude coordinates.

    Let us know how it goes.

    Best, Splicer.

  9. #9
    First Lieutenant Manzilla's Avatar
    Join Date
    May 30 2007
    Location
    In the lab cooking up some serious s#%t!
    Posts
    5,118
    Author of the Thread
    Thanks guys! Yes, I forgot about that one. I'll give it a try.

  10. #10
    funny how we all ask the same questions yet come up with different ways to solve it eh?
    http://forums.bistudio.com/showthread.php?t=93833

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •