Jump to content
Sign in to follow this  

Prevent AI from going PRONE

Recommended Posts

So, there is no way I can figure how to PREVENT AI from going prone.

this setunitpos "UP";this setunitposweak "UP";

Those above doesn't work.

I've even made my own danger.fsm but I don't know how to execute it, neither

this doFSM "danger.fsm"


this execFSM "danger.fsm"


So is there any WORKING solution for this issue? I have a buliding full of badguys and my team is landing on the roof, as soon as enemy hear the rotors they drop to the ground. I'm biting my teeth right now, it took me way over 20h now to fight this single issue once and for all.

Also there is this script posted here (http://forums.bistudio.com/showthread.php?141702-Prevent-indoor-units-from-going-prone&highlight=prone)

JTK_fnc_Prevent_Prone = {//by Kempco_unit = _this select 0;JTK_Prevent_Prone = ["AmovPercMstpSlowWrflDnon_AmovPpneMstpSrasWrflDnon ","AmovPercMstpSrasWrflDnon_AmovPpneMstpSrasWrflDnon ","amovppnemstpsraswrfldnon","AmovPknlMstpSrasWrflDnon_AmovPpneMstpSrasWrflDnon "];_unit addEventHandler ["AnimChanged",{_unit = _this select 0; _anim = _this select 1;_anim_Restricted = _anim in JTK_Prevent_Prone;if ((_anim_Restricted) OR (unitPos _unit == "down")) then {_unit setunitPos "middle"};	}];};

What I did is put this script in noprone.sqf, then in init.sqf:

pronprev = compile preprocessFileLineNumbers "scripts\noprone.sqf";

Then in trigger

{_x call pronprev;} forEach thislist;

Still no joy.

Share this post

Link to post
Share on other sites

Try using:

{[_x] call pronprev;} forEach thislist;

The function has:

_unit = _this select 0;

"_this select 0" is used when choosing from a passed array. Passing in _x without an array, the define would have to be "_unit = _this;" .

Edited by OpusFmSPol

Share this post

Link to post
Share on other sites

You could also make the enemy AI soldiers officers and make sure they have the highest skill level.

It makes them a little less afraid :)

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
Sign in to follow this