Home   Help Search Login Register  

Author Topic: Finding the x,y,z coordinates  (Read 1440 times)

0 Members and 1 Guest are viewing this topic.

jemungo

  • Guest
Finding the x,y,z coordinates
« on: 16 Sep 2002, 20:23:26 »
Sorry if this has been posted before (I counldn't find it using the search), but I have no idea how to find the x,y,z coordinate of a unit. I need it so I can 'camcreate' shells above a unit within the editor and not by script.

Thank you!

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Finding the x,y,z coordinates
« Reply #1 on: 16 Sep 2002, 20:36:03 »
IF you want to camcreate them at a particular unit then you dont need to worry about the actual co-ords, and just use;

Getpos UnitName

If you want them to be created above the unit then you have to make it a little longer;

bomb = "shell120" camcreate [Getpos UnitName Select 0, Getpos UnitName Select 1, HeightInMetres ]

Where the last HeightInMetres is a number of metres above the ground.
« Last Edit: 16 Sep 2002, 20:36:38 by [icarus_uk] »

jemungo

  • Guest
Re:Finding the x,y,z coordinates
« Reply #2 on: 16 Sep 2002, 20:53:27 »
Excellent! Thanks!

Well I may aswell ask this aswell...If I create this...

bomb = "shell125" camcreate [getpos unit select o, getpos unit select 1, 100]; bomb = "shell125" camcreate [getpos unit select o, getpos unit select 1, 100]

...is there a way to create a gap (timewise) between the two events, or will I have to resort to a script or two triggers?

Once again thanks...
« Last Edit: 16 Sep 2002, 21:00:27 by jemungo »

Gameer_77

  • Guest
Re:Finding the x,y,z coordinates
« Reply #3 on: 16 Sep 2002, 21:01:41 »
You could just put the second one 100 feet higher.  :)

 8)PEACE
« Last Edit: 16 Sep 2002, 21:02:51 by Gameer_77 »

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Finding the x,y,z coordinates
« Reply #4 on: 16 Sep 2002, 21:33:40 »
If you camcreate them in the same place then they will explode mid air (goof for flak effects).

It really depends on what effect you want.  If the unit is moving then creating them both at the same time with one higher, will make the higher bomb miss (depending on units' horizontal speed).

You cant delay between commands in the trigger.  The only ways are using two triggers, using a script, or using a gamelogicn and having one bomb being created in seperate WPs.  

The easiest way will certainly be two triggers, having the same condition and putting a time delay in one of them.

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:Finding the x,y,z coordinates
« Reply #5 on: 16 Sep 2002, 22:56:23 »
For giggles:

in the init field of some unit (like the player), put:
bomb = "Logic" camcreate [0,0,0]

Set up a trigger for the conditions you want (e.g., "West, present, repeatedly, 500m radius")
in the condition field put:
this && getpos bomb select 0 == 0

in the activation field, put in this guy:
metainstruction = "bomb = ""Heat120"" camcreate [(getpos target select 0) + ((_x * (speed target/3.6)) * sin (getdir target)) + (random 20) - 10, (getpos target select 1) + ((_x * (speed target/3.6)) * cos (getdir target)) + (random 20) - 10, (4.9 * (_x^2))]"; "target = _x; metainstruction ForEach [2,4,6,8,10]" Foreach thislist

Drive an abrams platoon through that. :)
Dinger/Cfit

jemungo

  • Guest
Re:Finding the x,y,z coordinates
« Reply #6 on: 16 Sep 2002, 23:29:46 »
Ok, I suppose using waypoints/triggers would be the best for control, as I have a lot of trouble understanding the scripts.

Is there soemthign I can put in the condition field of a trigger to check if there's a pacific player present...I can't find one on the command list.

Kaliyuga

  • Guest
Re:Finding the x,y,z coordinates
« Reply #7 on: 16 Sep 2002, 23:49:20 »
You can group the unit to the trigger, giving you a few more options for conditions...

vehicle/group leader/any group memeber

:toocool:

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Finding the x,y,z coordinates
« Reply #8 on: 17 Sep 2002, 00:21:01 »
 ;D ;D ;D ;D ;D Dinger

The best bit was when the crews started to bail out .....

Make sure this ends up in script snippets or something, its a little gem.   Moving fast the explosions get left behind a little, but when the tanks stop ....
Plenty of reviewed ArmA missions for you to play

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:Finding the x,y,z coordinates
« Reply #9 on: 17 Sep 2002, 00:58:09 »
How the trigger works:
When the trigger is activated (and yeah, you can use the group function to link a trigger to a specific group, then select "vehicle" "leader" "any" or "all"), it looks at each unit capable of activating the trigger.  For that unit, it gets its direction and speed, and camcreates shells. The [2,4,6,8,10] is the number of seconds before impact for each shell.  So the first shell is dropped from a height it will cover in two seconds, and above the spot where, two seconds later, the unit will be if it maintains its heading and speed (+ a cheap amount of randomness -- I can improve that too).
The getpos bomb select 0 in the activation field is a trick: when a shell explodes, its location goes to [0,0,0], so the variable assigned to it (in this case bomb) will also go to [0,0,0].  When the trigger activates, the variable bomb is assigned to a bunch of different objects in sequence, but the last one is (unless you change the order of the numbers [2,4,6,8,10]) the last shell in the salvo to explode.  When it explodes, the position of bomb goes back to [0,0,0] and the trigger resets, allowing yet another barrage.
You can do variations on this to create flak, or do any number of simple ofp effects.
Dinger/Cfit