OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: SimonRussi on 28 Apr 2003, 08:52:00
-
I need to create units in a place and then make them moving to a position. I wrote this:
_soldier = "Soldier" createvehicle [x,z]
_soldier move [x1,z1]
guess what? He shows up and goes nowhere.
I tried this:
"Soldier" createunit [xz, group, "this domove [x1,z1]"]
guess what? fucking the same.
Now, can somebody teach me how to kick this lazy bastard and make him moving?
Thanks,
Simon
-
wat group didu give him ? ;)
nywayz wat u shud do is smin like dat (its script right ?)
"Soldier" createunit [[x,z,y], group, "_soldier = this"]
_soldier domove [x1,z1]
it may work :o ;D
LCD OUT
-
ok LCD, we are almost done :).
It works now, the unit start running toward the destination. But, what if I want him to be a group itself. I mean, i used this
"Soldier" createunit [[x,z,y], group unitxx, "_soldier = this"]
what if unitxx dies? And, since I use this to generate units randomly, what happens when the group grows over 12 elements?
-
it suposed 2 work if he is grouped also ;D
but i didnt know u can do it w/o sayin wich group u r groupin da unit to ::)
if da unit dies da group is likly 2 stil b da same group ;D
nd wen da group have 12 units it stops creatin units ;D
LCD OUT
-
do you know if i can group the created units with a gamelogic or something so that the group leader will never die?
about the 12 elements trick: will the creation start again when the group units number is below 12 elements again?
-
I guess you could create a simple script that will always keep the leader nice and healthy.
;[unitname] exec "alive.sqs"
_loon1 = _this select 0
#start
?!(alive _loon1): exit
_loon1 setdamage 0
~1
goto "start"
IW
-
I think you can make the group leader a gamelogic. Or you could put him on an outlying island where he can't come to any harm.
-
about the 12 elements trick: will the creation start again when the group units number is below 12 elements again?
yes it wil continue ;D
do you know if i can group the created units with a gamelogic or something so that the group leader will never die?
u can put da group leader far away ;D
but if u put him GL i think da side of da units created wil b GLs nd dats meens dey wont kill oders :-X
LCD OUT
-
You could also do this:
place a unit in the editor
type in the init field: mygroup=group this;deletevehicle this
The groupname is created and is still there after the unit is deleted. The groupname can be used in the createunit command and you don't have to have a unit off in the bushes somewhere day dreaming. :)
-
Ok guys, tried the put-the-leader-away trick and it works.
It doesn't work with a gamelogic, the created units don't move.
About the Deaddog trick I will give it a try.
Anyway, thanks you all and topic solved.