OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Alex on 30 Jan 2004, 21:56:53

Title: How To Set A Unit To Crouch Or Go Prone In The Editor?
Post by: Alex on 30 Jan 2004, 21:56:53
Hi All,
        How Do You Make A Unit Be Prone Or Crouched Via The Editor?
Thanks
Alex
Title: Re:How To Set A Unit To Crouch Or Go Prone In The Editor?
Post by: dmakatra on 30 Jan 2004, 21:58:55
crouch is a bit of a problem, but to set a guy prone use this in his init field:

this setunitpos "down"

to only stand up:

this setunitpos "up"

and to react as he wish(prone when under fire):

this setunitpos "auto"

:beat: *Gets Shot* :beat:
Title: Re:How To Set A Unit To Crouch Or Go Prone In The Editor?
Post by: Alex on 30 Jan 2004, 22:03:05
Thanks But You Don't Know How To Get Him To Crouch
Title: Re:How To Set A Unit To Crouch Or Go Prone In The Editor?
Post by: macguba on 30 Jan 2004, 23:03:32
Use a playmove animation to make him crouch.    Don't put the command in his init field though, they tend not to work there.
Title: Re:How To Set A Unit To Crouch Or Go Prone In The Editor?
Post by: Unnamed on 30 Jan 2004, 23:23:01
You cant make him crouch using just the editor on its own.

You could put this in a trigger:

Code: [Select]
Soldier1 switchmove "Crouch"
But this only fires every 0.5 seconds, which is not enough as he just bobs up and down.

You can do it via the editor, but you will need an addon.

Or you will have to do it via an external looping script, there are plenty of examples here.

Title: Re:How To Set A Unit To Crouch Or Go Prone In The Editor?
Post by: h- on 31 Jan 2004, 02:29:15
You cant make him crouch using just the editor on its own.
Why  ???

I've dunnit several times...

unit setBehaviour "Combat"; unit setUnitPos "UP"; unit switchMove "crouch"

I got that working, but if the AI is behind an (over-shootable) obstacle it might get back up when firing at NME...


As usual, no guarantees on syntaxes  :P
Title: Re:How To Set A Unit To Crouch Or Go Prone In The Editor?
Post by: Unnamed on 31 Jan 2004, 08:10:09
It does work to a certain degree, but it wont make him stay crouched. Which is what I assumed Alex was after?

Even without any obstacles in front of him, he will stand up. But its the best non-looping method I've seen yet.

Title: Re:How To Set A Unit To Crouch Or Go Prone In The Editor?
Post by: h- on 31 Jan 2004, 21:33:35
It does work to a certain degree, but it wont make him stay crouched.
That's odd since once testing this method the AI stayed crouched all the way trough a fight (well they died before the end but anyhoo), only a machinegunner stood up once he spotted the nme...

Well, maybe it was just a on time delight since I haven't been using that for a while...  :-\
Title: Re:How To Set A Unit To Crouch Or Go Prone In The Editor?
Post by: Alex on 01 Feb 2004, 09:25:22
It Works Absoulutely Perfectly For Me, He Stays Crouched Till He Sees The Enemy And Goes Prone And Starts Firing.