OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: bedges on 02 Feb 2005, 14:28:41

Title: bouncing loonage....
Post by: bedges on 02 Feb 2005, 14:28:41
okay, after a good twenty minutes now trying to get a loon to crouch and stay crouched in combat mode, and watching him bounce up and down instead, i think i'll cave and ask - what's the switch/playmove command for this? or am i going to have to make a fast-repeating switchmove loop?

loon goes down, loon goes up, loon goes down, loon goes up... sigh.
Title: Re:bouncing loonage....
Post by: THobson on 02 Feb 2005, 15:46:40
Have a look at macguba's and ponq's animation demo in the editors dept.  4th from the bottom:
http://www.ofpec.com/editors/browse.php?browseon=&browsewhat=-1&catselected=-1_-1&catagory=-1&subcategory=-1_-1&numreturn=25&displayformat=0&ofpv=1&searchwhat=1&searchlevel=0&searchwhat=1&searchopts=&searchstring=animation&x=11&y=10 (http://www.ofpec.com/editors/browse.php?browseon=&browsewhat=-1&catselected=-1_-1&catagory=-1&subcategory=-1_-1&numreturn=25&displayformat=0&ofpv=1&searchwhat=1&searchlevel=0&searchwhat=1&searchopts=&searchstring=animation&x=11&y=10)
Title: Re:bouncing loonage....
Post by: nominesine on 02 Feb 2005, 15:48:14
In a few moments Macguba will arrive and direct you to his excellent switchMove/playMove tutorial mission ;D

But I usually do like this. If the loon should start as seated I use

loon switchMove "FXinKneel"

If he should start as standing and then go crouching I use

loon switchMove "FXtoKneel"

followed by

loon switchMove "FXinKneel"

and

loon switchMove "FXfromKneel"

when he should get back up again. The last one also releases the unit from it's switchMove position. You don't need to give him the switchMove "NULL" command.

Title: Re:bouncing loonage....
Post by: nominesine on 02 Feb 2005, 15:49:40
Thobson did it while I was writing :-)
Title: Re:bouncing loonage....
Post by: bedges on 02 Feb 2005, 16:36:34
mmmwell i do indeed have the ole ak_moves mission with all the animations, and i have all the moves in front of me here, but it's keeping the loon down that's the fuducker. and i don't want the loon squatting, i want him in combat mode i.e. on one knee pointing his firearm. crouch doesn;t do it, combatcrouch, crouchtocombat... tried pretty much all of them. i suppose i'll just have to move the camera away when the loon gets to his stupid feet again.

ho hum. life goes on :P
Title: Re:bouncing loonage....
Post by: THobson on 02 Feb 2005, 17:19:39
I undertsand the problem better now.  Some of the positions have a limited life and after that time the loon goes back his default position.  Some of the switchmoves (and I was told ) all of the playmoves can be stacked, so you can give a series of moves and the loon will execute them one after another.  

You could try using a loop where you give the loon several switch/playmoves of the type you want to make him stay in that position longer

That is how I got Tatyana to run for instance.
Title: Re:bouncing loonage....
Post by: XCess on 02 Feb 2005, 17:48:16
*sigh* that's prone Mr Peanut.
Title: Re:bouncing loonage....
Post by: RujiK on 02 Feb 2005, 18:31:30
#loop
?(!Alive Homie_G or getup):exit
Homie_G switchmove "Crouch"
~0.01
goto"loop"


Only way to do it that I am aware of unless you made a custom switchmove as crouch is a very temporary switchmove.

Or you could try setting his combat mode "Combat".
Title: Re:bouncing loonage....
Post by: THobson on 02 Feb 2005, 18:45:51
That is the sort of thing I had in mind.  You could go through the loop a specific number of times so that he will eventually get up after he has executed all the switchmoves given to him in the loop.
Title: Re:bouncing loonage....
Post by: nominesine on 02 Feb 2005, 20:07:19
Thanks THobson, maybe I disn't contribute too much to this thread, but this information was great news to me:


Some of the switchmoves (and I was told ) all of the playmoves can be stacked, so you can give a series of moves and the loon will execute them one after another.  


I tried it and it works perfectly. This will save me a lot f wp:s in my missions. Thanks again.
Title: Re:bouncing loonage....
Post by: General Barron on 03 Feb 2005, 00:57:05
My experience with crouching is that if you need to do a few things to keep them crouched:

setbehaviour "combat"
setunitpos "UP"
disableAI "move"
disableAI "target"
switchmove "crouch"

First off, disabling the movement AI seems to be the only way to keep them from standing back up (although I haven't tried looping or stacking switchmoves). I guess they end up trying to move a teeny bit, and that makes them stand back up. The setunitpos and setbehaviour seem to also help them stay in that position. Disabling the "target" AI is required, oddly enough. Without disabling the "target" AI, the units will actually MOVE and try to flank the enemy, or otherwise try to engage them. Yes, this even happens when their "move" AI has been disabled. The only member of the squad who stays put is the squad leader, so if you only have 1-man groups, this isn't really required.

And just as a side note, if you are trying to get units to shoot from behind some sort of cover (esp. sandbags), often you need to "setdammage 1" those objects, in order to help the AI realize they can shoot over them.