combat-agent 0 Posted March 1, 2006 As stated, How do i detect if a unit is in a vehicle? It needs to be dynamic because every soldier in the mission has an event handler, and if the the unit is in a vehicle, the event handler will be ran, but the script attached needs to exit the script. Thanks, Agent Share this post Link to post Share on other sites
Chris Death 0 Posted March 1, 2006 hmm - basically: vehicle _unit != _unit or an eventhandler "GETIN". Maybe you could be more specific about your eventhandler and scripts what is running when. ~S~ CD Share this post Link to post Share on other sites
XCess 0 Posted March 1, 2006 ?(unitName in vehicleName) Simple Share this post Link to post Share on other sites
Chris Death 0 Posted March 1, 2006 Quote[/b] ]?(unitName in vehicleName) Off course it's working too but then you gonna have to ask for each vehicle seperately while <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">vehicle _unit != _unit will return wether the unit is inside any vehicle or not. ~S~ CD Share this post Link to post Share on other sites
combat-agent 0 Posted March 1, 2006 Thanks for the replies. I havnt tested all of the it yet, but will soon. Im going to explain the enitire situation here. Each unit has a "killed" event handler. Everytime a unit is killed he will drop his weapon. This event handler is defined in the units .cpp file. Obviously, when a unit is killed in a vehicle, he should not drop his weapon. That is the case. So what I need, once again, is a way to check if a any unit is in any vehicle. It obviously has to be dynamic. Any number of these units could board any number of vehicles within a mission. Like I said, I havnt tested all the proposed solution yet, but ill be doing that now. Thanks again Share this post Link to post Share on other sites
General Barron 0 Posted March 1, 2006 That's pretty simple then. At the top of your 'drop weapon' script, just add the condition CD mentioned: ? (vehicle _guy) != _guy : exit ...continue with code to drop weapon... Obviously replace _guy with whatever variable you use to refer to the unit who will drop his weapon. I'm a little confused about this though... you can already pick weapons up off of dead guys, so why do you need to 'separate' the weapon from the guy ("drop" it)? Share this post Link to post Share on other sites
combat-agent 0 Posted March 2, 2006 It worked without flaw. Quote[/b] ]I'm a little confused about this though... you can already pick weapons up off of dead guys, so why do you need to 'separate' the weapon from the guy ("drop" it)? I guess i just like it. No one else seems to be to fond about it. But really, when a units gets blown up, i hate seeing his gun attached to him like its part of his body. Also, I think its eye candy when you see a group of dead guys (perferably that you just killed) with their weapons all in diffrent positions near their body. For one set of weapons, I actually created a model for each weapons so it had physics and would conform to the ground. Think about shooting at a group of guys with HE, Its great watching the weapons fly through the air. Share this post Link to post Share on other sites