Daneel 0 Posted December 22, 2001 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
Damage Inc 0 Posted December 22, 2001 Er....make a trigger and type car distance jeep < 3 in the condition field. Share this post Link to post Share on other sites
Intruder 0 Posted December 22, 2001 Try? car_1 Distance car_2 > 3 in the condition field Sorry damage inc, looks like you beats me to it (Edited by Intruder at 9:27 pm on Dec. 22, 2001) Share this post Link to post Share on other sites
Daneel 0 Posted December 22, 2001 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
Intruder 0 Posted December 22, 2001 Is any one driving the other car? Share this post Link to post Share on other sites
Damage Inc 0 Posted December 22, 2001 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
Daneel 0 Posted December 22, 2001 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
Daneel 0 Posted December 22, 2001 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
Damage Inc 0 Posted December 22, 2001 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
Intruder 0 Posted December 22, 2001 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
Daneel 0 Posted December 22, 2001 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
Damage Inc 0 Posted December 22, 2001 It could be used as: if nearestObject [jeep, "Car"]. Share this post Link to post Share on other sites
Daneel 0 Posted December 22, 2001 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
Damage Inc 0 Posted December 22, 2001 No you don't, Car is a base class that consists of every car in the game. Share this post Link to post Share on other sites
Intruder 0 Posted December 22, 2001 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
Daneel 0 Posted December 22, 2001 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
Daneel 0 Posted December 22, 2001 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
Bart.Jan 0 Posted August 31, 2002 </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
Bren the ruler 0 Posted August 31, 2002 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
RED 0 Posted September 1, 2002 Digging up the past again? Seems to be happing a lot lately. RED Share this post Link to post Share on other sites