Jump to content
Sign in to follow this  
Daneel

A worthy question

Recommended Posts

Hei,

I need a line of code which will activate when another car of any type is less than 3m from my stationary jeep.

Any ideas?

Share this post


Link to post
Share on other sites

Try?

car_1 Distance car_2 > 3

in the condition field

Sorry damage inc, looks like you beats me to it smile.gif

(Edited by Intruder at 9:27 pm on Dec. 22, 2001)

Share this post


Link to post
Share on other sites

No, I need to make it activate if ANY vechicle is close.

I would like to avoid creating 30 triggers, one for every vehicle on the map.

Like the title says, this is a worthy question.

Thankyou for responding so quickly!

(Edited by Daneel at 10:28 pm on Dec. 22, 2001)

Share this post


Link to post
Share on other sites

You don't have to create one trigger for every vehicle. Just type car1 distance jeep < 3 or car2 distance jeep < 3 or car3 distance jeep < 3 etc.

Share this post


Link to post
Share on other sites

I am driving the other car, and I am trying to find a single line of code that says "if there is a vehicle next to "myjeep" do........"

Share this post


Link to post
Share on other sites

By the way, I thought of "me in car, me not in "myjeep""

I just want to know if there is an even quicker way

Share this post


Link to post
Share on other sites

I don't think there is a quicker way, but that won't take long if you copy+paste the line.

Share this post


Link to post
Share on other sites

I found this in the command ref

nearestObject pos

Operand types:

   pos: Array

Type of returned value:

   Object

Description:

   Nearest building of given type to given position or object. pos may be [x,y,z, "type"] or [object, "type"].

Example:

   nearestObject [player, "StreetLamp"]

Any use for it?

I think Damage inc is right, you couldn't possibly have that many extra cars in you mission, copy and paste.

(Edited by Intruder at 9:40 pm on Dec. 22, 2001)

Share this post


Link to post
Share on other sites

no cutting and pasting needed, just use:

? (me in vehicle) && (me distance myjeep <3) && (! me in myjeep): do whatever.

I am looking for clarification on how to say (me in ANY vehicle) and asking if there is a quick way than this.

Cutting and pasting lines and lines bumps up the size of the mission and I'll end up with a huge download time.

Share this post


Link to post
Share on other sites

That one looks like it would need me to repeat for every possible different car.

Share this post


Link to post
Share on other sites

There's a mission with a "heat tracker" script. What is does is finds people within 100m a tells you their position and range. May be you can contact the creator?

The mission is Black Sunday by Kronzky

you can get it at http://www.opflashpoint.org/

If it works for any soldier, may be it works for any car?

Share this post


Link to post
Share on other sites

Yes, I was replying to an earlier post, this looks very promising.

I tend to use only the non official comref (a bad habit I have to stop) and I missed this one.

I'll explore it and see if I can get it to consider distances.

Thanks for all of the help guys.

Share this post


Link to post
Share on other sites

I'll look up this heattracker mission if I need to, and open it up. The code should be easy to locate.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Daneel @ Dec. 22 2001,21:23)</td></tr><tr><td id="QUOTE">Hei,<p>I need a line of code which will activate when another car of any type is less than 3m from my stationary jeep.

Any ideas?<span id='postcolor'>

If jeep will be stationary and you do not want to change its location, you can use trigger placed right on jeep:

axis A,B : 5,5

activation : anybody present repeatly

condition : "car" countType thislist-[jeep] >0

Trigger will be activated when another car moves near jeep. But when jeep changes its location, it will not work as you want.

Share this post


Link to post
Share on other sites

Try bart.jans way but if the jeep does move you could try putting another trigger with repeat on and in the act box:

triggername sepos(getpos jeepname)

this will set the trigger that has the activation stuff when another jeep passes in the area on the jeep constantly

did you get that?

Share this post


Link to post
Share on other sites

Digging up the past again?

Seems to be happing a lot lately.

RED

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×