Jump to content

Recommended Posts

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
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
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

  • Like 1

Share this post


Link to post
Share on other sites
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

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.

  • Like 2

Share this post


Link to post
Share on other sites

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
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.

 

  • Like 1

Share this post


Link to post
Share on other sites
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

 

  • Like 2

Share this post


Link to post
Share on other sites
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.

 

Ie4ziJV.jpg?1

 

{
	_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

 

  • Like 5

Share this post


Link to post
Share on other sites

I can always count on @Grumpy Old Man for some thorough testing :rthumb:.

 

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

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×