Jump to content
Sign in to follow this  
SolidSnake-(SNK)

Need help with a script

Recommended Posts

Hi.

Can someone make a script for me that let's a Ai group switch between standing up and Crouched (SetUnitPos UP & MIDDLE)

but keeps them from going Prone.

You will get credit for the script in my mission.

Thanx

Share this post


Link to post
Share on other sites

I don't know if this is, what you are looking for.

You haven't told much about how you like to use it for.

Script and Example Mission:

Example unitPos

Share this post


Link to post
Share on other sites

I think this is what i am looking for.

I dident see any of the unit's laying down when i ran the intro mission.

This script is made for keeping Ai soldiers from laying down right?..

I want to use the script in a mission i am making with the taliban units from LoBo and i want to keep the taliban soldiers from going prone.

Shal i credit the script to you?..

Share this post


Link to post
Share on other sites

Well this script do only set the unitPos once.

If you like to monitor the unitPos so, for example the units never go prono then there must be a loop checking the unit pos all the time.

Well we do not have a command to check the unit position, so it's a bit tricky.

The best way would be to add a "Anim Changed Event Handler" to the units and change the unit position to "UP" or "MIDDLE" every time the "Anim Changed Event Handler" has detected a prone animation.

Replace this code with the code of the "unitPos.sqf" you already have.

unitPos.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

private "_group";

_group = _this select 0;

while { ( ({alive _x} count (units _group) > 0) && (vehicle leader _group isKindOf "Man") ) } do

{

      {if (speed _x < 3) then

      {

             if (floor(random 100) > 50) then {_x setUnitPos "UP"} else {_x setunitPos "MIDDLE"};

      };

      } forEach units _group;

      sleep 10;

};

Now the script will loop every 10 sec. and check if a unit of a group is moving, if not then the script do set the unit pos to "UP" or "MIDDLE".

Also a alive and vehicle check is inside, becouse the script now do loop.

I will give you a example with the "Anim Event Handler" way tomorrow.

B.t.w.: No need to give me credit's for this.

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  

×