OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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 :( )
-
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.
-
ahh switchmove roger that..but i dont understand the format of scripting with notepad...thats my only issue
-
There is no format ... you just write the same kind of stuff as you would in the init field.
-
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:
_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
-
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
-
doesnt
aP setUnitPos "DOWN"
work
-
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
-
...If you make a script ...then ...put:
_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. :-*
-
::)
Whateva! :P
Gameer
-
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!)
-
Aye? :-X
I think they end up standing up to fire on them when you un-stop them.
Gameer
-
that switchmove thing never works for me!
watts wrong !?!?!?
??? :o >:( :'( :-\ :-[
-
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
-
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