whiztler 137 Posted February 27, 2018 Been racking my brain how to get the 'allowFleeing' (0 - 1) number from a group. Been messing around with the 'courage' skill from a leader to see if that matches up, but it does not. Anyone tried a solution before? Dev's we need a 'allowFleeing' getter! (getAllowFleeing) Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted February 27, 2018 1 hour ago, whiztler said: Been racking my brain how to get the 'allowFleeing' (0 - 1) number from a group. Been messing around with the 'courage' skill from a leader to see if that matches up, but it does not. Anyone tried a solution before? Dev's we need a 'allowFleeing' getter! (getAllowFleeing) https://community.bistudio.com/wiki/fleeing Share this post Link to post Share on other sites
whiztler 137 Posted February 27, 2018 1 hour ago, fn_Quiksilver said: https://community.bistudio.com/wiki/fleeing That just returns bool. I need it to return the number. Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted February 27, 2018 1 hour ago, whiztler said: That just returns bool. I need it to return the number. What number? It' either 0 or 1, to flee, or not to flee. Cheers 1 Share this post Link to post Share on other sites
whiztler 137 Posted February 27, 2018 27 minutes ago, Grumpy Old Man said: What number? It' either 0 or 1, to flee, or not to flee. Cheers According to https://community.bistudio.com/wiki/allowFleeing: Sets the cowardice level (the lack of courage or bravery) of a group or unit. The more cowardice a Group or Object has, the sooner it will start fleeing. 0 means maximum courage, while 1 means always fleeing. This to me means that the number could be between 0 and 1. Like setDamage. Correct me if I am wrong please. Share this post Link to post Share on other sites
AZCoder 921 Posted February 27, 2018 I think you are correct. You can set the likelihood of fleeing. Conversely, the fleeing command only tells you if they are currently fleeing or not. There is nothing that returns the original cowardice value. Interesting question, I don't know how the courage skill plays into this, or if it does. 2 Share this post Link to post Share on other sites
pierremgi 4862 Posted February 27, 2018 You can try: getSuppression unit1; 1 Share this post Link to post Share on other sites
Stormmy1950 42 Posted February 27, 2018 i dont know how is this scripted but did you try with float i mean name allowFleeing cowardice name - object cowardice- Number this allowFleeing 0.8; Share this post Link to post Share on other sites
Lucullus 71 Posted February 27, 2018 Can't test it yet, but what about skill _courageUnit = nameUnit skill "courage"; Share this post Link to post Share on other sites
AZCoder 921 Posted February 27, 2018 21 minutes ago, Lucullus said: Can't test it yet, but what about skill _courageUnit = nameUnit skill "courage"; The OP said he was messing around with courage and did not see a correlation. Sure it seems logical, but it doesn't appear to be related unfortunately. 1 Share this post Link to post Share on other sites
Lucullus 71 Posted February 27, 2018 Sometimes I should read better, OP meant the group... Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted February 28, 2018 9 hours ago, whiztler said: According to https://community.bistudio.com/wiki/allowFleeing: Sets the cowardice level (the lack of courage or bravery) of a group or unit. The more cowardice a Group or Object has, the sooner it will start fleeing. 0 means maximum courage, while 1 means always fleeing. This to me means that the number could be between 0 and 1. Like setDamage. Correct me if I am wrong please. check the morale command. if it drops below (-1 + <allowfleeing>), the unit will start fleeing 2 Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted February 28, 2018 3 hours ago, fn_Quiksilver said: check the morale command. if it drops below (-1 + <allowfleeing>), the unit will start fleeing Units can flee with morale above 0. Value range is between -1 and 1, so it won't drop below -1 according to wiki. { _test = _x spawn { params ["_unit"]; while {alive _unit} do { waitUntil {fleeing _unit}; if (fleeing _unit) exitWith { _text = format ["%1 is fleeing! Morale: %2",_unit,morale _unit]; diag_log _text; systemchat _text}; } } } forEach allUnits; This depends on many other factors than morale alone, have yet to figure out what exactly it is, but courage, unit damage and unit losses in own group most likely play into it. So using the fleeing command is your best bet, no reliable way to predict if a unit is about to flee, at least that I know of. Cheers 5 Share this post Link to post Share on other sites
whiztler 137 Posted February 28, 2018 I can always count on @Grumpy Old Man for some thorough testing . I came to the same conclusions with my previous test. From my testing I would say there are quite a lot of factors the determine the fleeing behavior. Hope to see a getter engine function in the (near) future 1 Share this post Link to post Share on other sites