OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: lipan_marder on 24 Jun 2005, 09:18:07
-
hello... im new to scripting, so just thought would like to share an idea with you all.
okey, here goes: wouldn't it be nice if we could order our units to dig in? so i just thought maybe we can create new user action to "dig in", then magically a foxhole or sandbag appear in front of the unit.
so what do u guys think? or if there is already this kind of script somewhere in the OFP community? i searched ofpec forum and didn't return any result
okey that's all, just an idea
-
It's easy enough.
diginAcc = this addaction ["Dig in","digin.sqs"]
digin.sqs :
_unit = _this select 0
_trench = "TrenchClassName" camcreate getpos _unit
Thats the basic thing, you need to change TrenchClassName to an object class name of a trench or something (Look in readme of the mod/addon that contains the trench your using, or the Lib1942 editing manual thing etc)
Really it should use trig to place it a little infront of the unit, but for some objects the above code will be fine, as it may create the foxhole (or whatever it is) with the unit in it :)
Good luck :)
- Ben
-
thanx... i'll try it right away :)