5133p39 14 Posted February 3, 2005 I need to detect if unit has any weapon in hands. Why? Because there is a situation in my mission, where the weapon IN HANDS or ON BACK makes a difference, so i need to know. I know about "Weapons _unit" and "PrimaryWeapon _unit" and "SecondaryWeapon _unit", but they wont help me. I have also tried "CanFire _unit" - but it wont help me also. Any suggestions? Share this post Link to post Share on other sites
hardrock 1 Posted February 3, 2005 not possible, sorry. There is nothing like "selectedWeapon _unit" Share this post Link to post Share on other sites
@cero 0 Posted February 22, 2005 Damm, I need to know aswell. I supose that the players behaviour is not changed depending on if the weapon is at hand or if is wallking, running, crawling etc? cos if there was a detectable change in the players behaviour depending on the way he/she is playing that could sort it. So the question being, is the behaviour of the player changed as the player change the input, or it don't work like with the AI? The other thing is that the unit, as it is in "Safe" mode have the weapon on his back, so when it change behaviour to other that "careles" or "safe" is actually selecting a weapon, so lets say, if the player is estarting the mission in "safe" mod, he/she will have his/her weapon on the back, so when you get the weapon on hands by the action menu or by trying to fire it when is on your back, could that launch or activate a script or trigger? Thanks. Regards. @CERO. Share this post Link to post Share on other sites
nephilim 0 Posted February 22, 2005 u can alternative detect or set the units behaviour combat behaviour will make the unit hold the weapon in its hands whilest save will make it keep on the back additionally u can querry if the unit has a certain weapon with "unit hasweapon wpnclassname" i dotn remeber the commands right now though.... Share this post Link to post Share on other sites
@cero 0 Posted February 22, 2005 So it is possible to triger a script depending if the unit have the weapon in his hand then. All I'm interested is in the player, no the AI, and only in an area of the map, so I should be able to work it out by "unit hasweapon wpnclassname". I'll search for better and clerer results in the comand reference and see if I can work out the script, but not now, I got to go to work, bloody afternoon shifts Thanks a lot nephilim. Regards. @CERO. Share this post Link to post Share on other sites
nephilim 0 Posted February 22, 2005 no u cant detect with hasweapon if the uits has a gun is his hands but if it "has" it. in combination with checking the behaviour u can do this. cuz when combat behaviour (or idle) weapon in hands safe (or careless) behavior weapon on back :P cheers Share this post Link to post Share on other sites
5133p39 14 Posted February 22, 2005 no u cant detect with hasweapon if the uits has a gun is his hands but if it "has" it.in combination with checking the behaviour u can do this. cuz when combat behaviour (or idle) weapon in hands safe (or careless) behavior weapon on back :P cheers well, i knew this, but i forgot to mention, i need to check it for Player unit - and for Player the Behaviour or CombatMode is allways the same (i don't remember what is the exact result, but it is same all the time and won't change no matter what you do). But thanks, and keep it comming Share this post Link to post Share on other sites
@cero 0 Posted February 22, 2005 Thanks guys. Dosn't OFP have a way to know what is the unit/s velocity? If so, We all know that human units only work in two speeds when they are in "Safe" mod, so if they going faster than that it meens that they are not in "Safe" mod, in other words, the unit have a weapon in his/her hands, so if we can have a value on what is the players speed, and this value excedes certain value, we can launch a script, right? Is that possible? Thanks. @CERO. Share this post Link to post Share on other sites
Blanco 0 Posted February 23, 2005 Just for the record... You can use the weapons command aswell which returns the weapons of the unit in an array. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ?count weapons _unit == 0 : hint "unit has no weapons" Share this post Link to post Share on other sites
@cero 0 Posted February 23, 2005 Thanks Blanco, but the way you sugest only let you know if the unit have any weapons in his/her possession, not necesarely in his/her hands. We need to know if the players unit have a weapon in his/her hands, don't need to know if the unit is actually carreing a weapon, because it may have the weapon on the sling on his shoulder and that's not good. Basicly, we need to know the players change on behaviour, the AI is not important, that would be easy, but the players is not easy So the only way I can sugest to do it is by cheking the players wallking speed( I'll have to make sure that the player don't jump into any vehicles ) The problem I have right now is that I don't know how to implement the "Velocity" comand in a script to let you know the units speed. Thanks. @CERO. @CERO. Share this post Link to post Share on other sites
Blanco 0 Posted February 23, 2005 Why don't you use the speed command? Something like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?(alive player && player == vehicle player && speed player < 7) : hint "player is running, alive and not in a vehicle" Dunno if 7 is the right speed, but I think you got the point. Share this post Link to post Share on other sites
5133p39 14 Posted February 25, 2005 thanks, right Blanco, but Player/AI can have weapon in hand, and move slowly - or not move at all Share this post Link to post Share on other sites