SpeedyDonkey 0 Posted July 3, 2003 The objective is to kill a dude. The dude has alot of guards... The problem is that i can walk around there with my weapon visible (ingram) and the guards couldn't care less, and imo thats very unrealisitc. (In the mission im a west guy with a civilian outfit (edited in the mission.sqm) and in the start of the there's a trigger that makes me captive so they wont fire. As soon as i kill one of em' the trigger switches to setcaptive false and they try to kill me...) SpeedyDonkey Share this post Link to post Share on other sites
SpeedyDonkey 0 Posted July 3, 2003 BronzeEagle sugests: Quote[/b] ]would it be possible to have a condition that states if your gun is out or in other words if you are in combat mode? Â that way when your gun is in your hand they fire at you? This sounds like a good idea. I just don't know exactly how to achieve this. Share this post Link to post Share on other sites
bn880 5 Posted July 3, 2003 At first glance your choices appear to be: Quote[/b] ]combatMode grpOperand types: grp: Object or Group Type of returned value: String Description: Combat mode of given unit ("BLUE","GREEN","YELLOW","RED") Example: combatMode group player and Quote[/b] ]weapons vehicleOperand types: vehicle: Object Compatibility: Version 1.75 required. Type of returned value: Array Description: Returns array of names of all vehicle's weapons.. Example: weapons player I am not sure if combatMode follows your stance, ok I just checked, it does not. Your only choice appears to be to check the weapons array. Share this post Link to post Share on other sites
SpeedyDonkey 0 Posted July 3, 2003 Thank you BN 880. But Im a really donkey when it comes to scripting so honestly i don't know where to type that {8^¤ /SD Share this post Link to post Share on other sites
bn880 5 Posted July 3, 2003 Well this condition should be true if the player has any weapons, and false if the player has no weapons: (count (weapons player) > 0) I think. So you can use that in a trigger or a script. Share this post Link to post Share on other sites
SpeedyDonkey 0 Posted July 3, 2003 okey but will they will shoot me wether my weapon is visible or not As long as i have a weapon.. ? Share this post Link to post Share on other sites
bn880 5 Posted July 3, 2003 Yep. Sorry at the moment i don't have time to poke around more, but I think I have seen some posts about this problem before. Maybe several months back. The only other thing that comes to mind is checking the players relative hight above ground to see his combat stance, but, I wouldn't set my hopes high. Share this post Link to post Share on other sites
SpeedyDonkey 0 Posted July 3, 2003 Okey thanks for the help anyway oh and if you come up with a solution, feel free to post it here Share this post Link to post Share on other sites
RED 0 Posted July 3, 2003 You could add an action to the player: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">player addaction ["Pull weapon", "weapon.sqs"] weapon.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> player addweapon "weaponname" ~4 player setcaptive false RED Share this post Link to post Share on other sites
SpeedyDonkey 0 Posted July 3, 2003 Hey that's a smart way to solve it!! cheers RED Â btw, i realized that i cant have a custom weapons selection on the briefing but that's a small price considering the realism this adds Share this post Link to post Share on other sites
RED 0 Posted July 3, 2003 No you could do it, but it would be a bit more work. In the init.sqs (at the end of your code you have now) put: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ~0.01 secondaryWeapon = secondaryWeapon player primaryweapon = primaryWeapon player removeAllWeapons player In the weapon.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">player addweapon secondaryWeapon player addweapon primaryweapon ~4 player setcaptive false You could make the code better but I don't have time to do that for you RED Share this post Link to post Share on other sites
bn880 5 Posted July 4, 2003 Yep, I think that must have been the solution someone came up with when the problem was "unsolvable" a whiel back. . . (sorry I couldn't assist more SpeedyDonkey, but some people have just wasted half my day ;) ) Share this post Link to post Share on other sites
SpeedyDonkey 0 Posted July 4, 2003 Quote[/b] ](but some people have just wasted half my day ;) ) Sure my english sucks but it can hardly be that bad... Share this post Link to post Share on other sites
bn880 5 Posted July 4, 2003 LOL, no it wasn't you or anything to do with the forums or OFP. Share this post Link to post Share on other sites
SpeedyDonkey 0 Posted July 4, 2003 Ok well that was a relief... Anyway i made my stupid little mission (can be found in the user missions thread ^^) so you guys wont have to wory about me bitching and asking all kinds of basic newbie questions ... for a while Share this post Link to post Share on other sites
SpeedyDonkey 0 Posted July 5, 2003 QUOTE: BronzeEagle (cos' he cant post) "hey, can't you do a: player addEventHandler ["combat", {_this exec "guninhand.sqs"}] you just have to know the event to match up with gun in hand then, right? Â so what event would that be? Â Â combat is a behaviour i think. Â there are also combats modes that are the colors of a stoplight: red, green, yellow, orange, blue. Â I'm not sure about orange but you do realize that with this in the script you could say: player setcaptive false." Share this post Link to post Share on other sites