OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: SnakeFart on 11 Apr 2003, 19:47:26

Title: crouching?
Post by: SnakeFart on 11 Apr 2003, 19:47:26
i need to make an ai soilder crouch so he can try to hold a house from incoming forces how do i tell him to crouch...

this "effectstandcrouch"     doesnt seem to work

(init fields needed..dont know scripting with notepad yet :( )
Title: Re:crouching?
Post by: macguba on 11 Apr 2003, 20:03:47
this switchmove "effectstandcrouch"

or playmove.

You may find that the loon won't stay down, however.  

You'll find a full listing of switchmove/playmove animations in the Ed Depot, in Pending.

If you're writing stuff in init fields, that's scripting.   :)   Read Abuu's Basic editing tutorial followed by Johan Gustafsson's Scripting guide.   And of course snYpir's Friendly introduction to code snippets.
Title: Re:crouching?
Post by: SnakeFart on 11 Apr 2003, 20:07:10
ahh switchmove roger that..but i dont understand the format of scripting with notepad...thats my only issue
Title: Re:crouching?
Post by: macguba on 11 Apr 2003, 20:10:11
There is no format ... you just write the same kind of stuff as you would in the init field.
Title: Re:crouching?
Post by: Gameer_77 on 11 Apr 2003, 20:22:03
Animations don't work in init fields. You need to use triggers (Or scripts, which you don't like ;D)

For the whole crouch thing, the soldier must be made in setunitpos "up", he must be in combat mode and must be stopped.

If you make a script named crouch.txt (or .sqs, but it doesn't actually matter) then in it put:

Code: [Select]
_croucher=_this select 0

_croucher setunitpos "up"
_croucher setbehaviour "combat"
_croucher switchmove "Crouch"
_croucher stop true

Then in the unit's init field put [this] exec "crouch.txt" (Or "crouch.sqs" if you made it a .sqs) and it should work. It should work ;) :P

Gameer
Title: Re:crouching?
Post by: JerryK_387 on 12 Apr 2003, 20:36:33
Ok... I was just wondering how to use loops and stuff like that to keep the guy crouched... cuz I would like to keep a guy behind some sandbags, but it's pointless when he's standing up, and won't fire from behind it laying down.... anybody want to write the script for me please :) :)  ;D
Title: Re:crouching?
Post by: _DaRkMaN_ on 12 Apr 2003, 20:46:39
doesnt
aP setUnitPos "DOWN"
work
Title: Re:crouching?
Post by: Flapje on 12 Apr 2003, 21:14:24
about scripting in notepad: if you want to do i.e. switchmoves in a script, you just do this:

bla switchmove bla

bla2 switchmove bla

END

that's it, you wrote yourself a script ;) mayb add some time or anything, but you get the idea?

ps: this makes dude bla and bla2 do something when the script activates
Title: Re:crouching?
Post by: Tomb on 12 Apr 2003, 22:05:42

...If you make a script ...then ...put:

Code: [Select]
_croucher=_this select 0

_croucher setunitpos "up"
_croucher setbehaviour "combat"
_croucher switchmove "Crouch"
_croucher stop true


Gameer


==================

 Just a detail here:  

         "_croucher stop true"

- is not a perfect way to make a d00d hold, as it will sort of freeze the moron  ::)
Ya might wanna try "DoStop _croucher" instead if ya want him to stand still and yet be able to shoot when attacked.  :) Now, to make a guy crouch the easy way, I'd try som'n like the crap below:

Create the moron, put a WayPoint next to him & slide it upon his head.
Then set the behaviour to "STEALTH" in the WP window and put this lot in the "On Activ." field :

 This setUnitPos "UP"; this switchmove "crouch"; DoStop This  :-*


That'll tell Bob to get on his knee and stay there!
PS - be sure to remove all handgrenades, as he might get up on his feet again
if he suddenly feels like throwing eggs at the enemy!  :P ::) ;D


CYA

=========

PS. Oh, and just in case! To remove all handgrenades, put

  This RemoveMagazines "HandGrenade"

 in the guy's INIT field.  :-*


Title: Re:crouching?
Post by: Gameer_77 on 13 Apr 2003, 00:48:14
 ::)

Whateva! :P

Gameer
Title: Re:crouching?
Post by: Tomb on 13 Apr 2003, 15:12:00
now that we talk crouching, I'm not even sure if the "doStop" is nessesary at all
as any crouched (via switchMove) d00d tend to stop/freeze by default, though he WILL fire.


mm. aah, well... gah! nuff 'z' nuff  ::) Tomb crouched.


(should of been my ol' lady!)
Title: Re:crouching?
Post by: Gameer_77 on 13 Apr 2003, 20:17:40
Aye? :-X

I think they end up standing up to fire on them when you un-stop them.

Gameer
Title: Re:crouching?
Post by: KottE on 19 May 2003, 19:12:26
that switchmove thing never works for me!
watts wrong !?!?!?
 ??? :o >:( :'( :-\ :-[
Title: Re:crouching?
Post by: LCD on 19 May 2003, 20:53:39
mebe try loopin da switchmove commend ;)

#loop
unitname switchmove "Crouch"
~1
goto "loop"

i cant c snakefart sain dat it works - nd it didnt work 4 me also ::) (till i looped it ;D)

LCD OUT
Title: Re:crouching?
Post by: Dandy on 19 May 2003, 23:57:11
Put this in the init of the soldier:

this setBehaviour "combat";this setUnitPos "up";this switchMove "combattocrouch"

It works. Yes it does 8)

Remember me: Dandy