OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: beefholishness on 08 Jan 2006, 07:19:28
-
With a search of the forums I found how to make a trigger that will make a specific unit crouch, but I need to make a large group crouch. I only found one crouch action on the lists here, and it dosn't appear to work. Is there an init line that will make a unit crouch? (hence easy to copy and paste)
-
I have created a script even though it is probably not exactly what your looking for it may help.
http://www.ofpec.com/yabbse/index.php?board=27;action=display;threadid=24748
-
I dunno what Penguinman's script looks like but usually it's done by a fast loop. I'd be wary of such a thing if I were you as a lot of guys crouching in a fast loop will eat up fps.
I reckon anyway.
-
Playmove and switchmove do not always work if they are in the unit's init field. It is better to have a small delay after the start of the mission before actioning them. Also some of the moves only work for a limited time after which the unit goes back its default setting - you need to experiment with this.
To do something for a large number of units that you can do for one unit try this:
{instruction1 _x;_x instruction2;etc...} forEach (units group1name + units group2name + etc)
This will result in the following being done
instruction1 unitname
unitname instruction2
etc...
for all units in group1name + group2name + etc.
instruction1 might be something like unassignVehicle
instruction2 might be something liek setPos ...
-
So essentially, there is no 100% effective init line that will just make a unit crouch and keep him there.
-
i think this is in the FAQ cant remember but im sure it is
But what they said never 100% worked they will stay where they are but once they stand up they will stay stood up but still wont move but them standing only happens rarely
-
there is no 100% effective init line that will just make a unit crouch and keep him there.
Correct. Moreover, there is no 100% effective init line that will make him crouch at all.
-
no, my script dosent use a loop, and the units all stay crouched, and can shoot. you should check it out.
-
You can make a unit freeze in the crouching position by using the following code on him:
loon1 setUnitPos "UP"
loon1 setBehaviour "Combat"
loon1 switchMove "Crouch"
loon1 disableAI "Move"
He will not stand up if he is firing, etc, but be warned that he cannot move from that position. Otherwise, execute everything but the disableAI command on him. Unfortunatly, he will generally stand up when he sees the enemy, but he can move. You could also try a doStop command, which might prevent him from standing.
-
Thanks guys, I'll try everything suggested... I just got done a complete reinstall of XP today so it may be a while before I'm back to editing anyway. I'm making civil war engagements, so not being able to move is actually beneficial. ;)
-
or you can use an Anim addon that has crouching and aiming addons in, ICP Orcs Anims or Wilco's anims are both good ones