Home   Help Search Login Register  

Author Topic: Getting close to a pre-placed object  (Read 579 times)

0 Members and 2 Guests are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Getting close to a pre-placed object
« on: 27 Mar 2005, 18:06:28 »
Hi all,

I'm trying to make a script that adds an action when you get close to an object pre-placed on the map (like a house). I know how to add the action, but its the other bit i'm stuck on.  ???

In the comref, it says this:

Code: [Select]
Command :
Distance
 
Description :
Used to find the distance between 2 units/objects.
 
Syntax :
Name1 Distance Name2

Name1 is the name of a unit or object.
Name2 is the name of a second unit or object
 
Returns :
Distance in meters between Name1 and Name2.
 
Example:
?(MyGuy Distance MyLeader > 300):MyLeader SideChat "Get over here!"
 

But that doesn't say what to do if you want Name1 to be the player, and Name2 to be one of the pre-placed objects.

I tried:

?(Guy1 Distance Object 25344 > 50):Guy1 sidechat "bah"

But it didn't work.
Was I on the right lines, or is it something completely different?  :P

Thanks.
« Last Edit: 27 Mar 2005, 18:06:54 by greg147 »
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Getting close to a pre-placed object
« Reply #1 on: 27 Mar 2005, 18:08:43 »
Add the Action to the object.   It will appear in the player's Action menu automatically when he gets close enough.

Distance is a funny command:  it works only with certain things.   (For example, not markers.)  Make it work with two loons before trying it on preplaced objects.
Plenty of reviewed ArmA missions for you to play

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Getting close to a pre-placed object
« Reply #2 on: 27 Mar 2005, 19:36:52 »
Thanks. I am such a dumbass. I completely forgot that you just put the trigger on the object with a small radius to make it work.  ::)


Anyway, on the same script, I have another question.  ;)

What is the name of the sound 'Explosion Large'?
So, in my script I have 'playsound xxxxxxxx', and it will make the explosion sound you can activate normally by triggers.

Thanks  ;)
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB