SouthSaturnDelta 1 Posted July 21, 2007 Hi folks,     Came up a bit stumped with what I thought would be straightforward. I define the combat mode of a unit to see if its idle,and then the rest of the script carries on.Problem is that I set a continual loop to detect whenever the units combat mode alters.Then need to 'goto' another point in the script or run a new one seperatly.   <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? ! behaviour _man == "careless": goto "Change" ? ! behaviour _man == "safe": goto "Change" ? behaviour _man == "careless": goto "Idle" ? behaviour _man == "safe": goto "Idle" The above brings up some error regarding the ?! probably because there are 2 variables I'm defining. Would using the correct syntax of  - IF OR  and THEN be a suitable remedy? I couldnt find a combination that works without errors. Also I tried this~ <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? behaviour _man == "careless": goto "Idle" ? behaviour _man == "safe": goto "Idle" goto "Change" But that halted everything. I had a look around but couldnt find anything similar to investigate. Cheers, SSD Share this post Link to post Share on other sites
celery 8 Posted July 21, 2007 Instead of ==, use != and scrap the ! at the beginning. Share this post Link to post Share on other sites
ColonelSandersLite 0 Posted July 22, 2007 Just to make sure you know, the AI does not change combat mode unless either you tell them to via script or waypoint, or a player squad leaders tells them to. I'm not sure exactly what you're trying to do, but that exact script there is probably not going to do jack. Also, you know you posted this topic 3 times? Share this post Link to post Share on other sites
crashdome 3 Posted July 22, 2007 That's not always true. Put an enemy unit in safe mode and then starting behind him, begin shooting ... he will go into combat mode. Share this post Link to post Share on other sites
Caxton Gibbet 0 Posted July 23, 2007 Not sure if this is any use to you.its a little test i was doing for a mission i'm planning. _unit = _this select 0 _Wep = Primaryweapon _Unit #top _WDIR = _unit WeaponDirection _Wep ~1 ?_WDIR Select 2 <= -0.5 :hint "weapon is down" ?_WDIR Select 2 > -0.5 :hint "weapon is UP" Goto "TOP" Â Â Â Â This gets the direction of said units weapon to determine weather their mode is "SAFE" or other than "SAFE". and avoids the need to check their actual Behaviour mode. Be aware that the weapon direction is changed by speed of movment as well as behaviour mode.That is a unit can be in safe mode but if running their weapon is rasied beyond the threshold (-0.5) I've defined due to the animation. Â Â Â Â I plan to use this mainly to determine a civilians reaction to a patroling soldier.ie. Patroling troops in say peacekeeping role need to keep civilians calm and themselves approachable.Soldiers with rasied weapons or soldiers that are running will tend to make civilians nervous and themselves seem less approachable.IRL such things as soft head gear and removing sunglasses are used to achive this but these aren't options in arma. Share this post Link to post Share on other sites
Big Dawg KS 6 Posted July 23, 2007 Just to make sure you know, the AI does not change combat mode unless either you tell them to via script or waypoint, or a player squad leaders tells them to. Â I'm not sure exactly what you're trying to do, but that exact script there is probably not going to do jack.Also, you know you posted this topic 3 times? FSMs have changed that. Share this post Link to post Share on other sites