Home   Help Search Login Register  

Author Topic: Create units with trigger  (Read 805 times)

0 Members and 1 Guest are viewing this topic.

swordfish

  • Guest
Create units with trigger
« on: 19 Dec 2002, 22:59:56 »
Hi
What i want to do is make it so when you activate a trigger, the game create's the units i want, at a past location. So if you were on patrol, you set off the trigger, and the game create's the units at your base, so they were not there before, and now they will be waiting for you.

CrashnBurn

  • Guest
Re:Create units with trigger
« Reply #1 on: 20 Dec 2002, 16:09:37 »
How many units and what type do you want ? Be specific.

swordfish

  • Guest
Re:Create units with trigger
« Reply #2 on: 29 Dec 2002, 17:54:43 »
Hi
I wanted 3 normal East soldiers and 1 East officier in the same group.

CrashnBurn

  • Guest
Re:Create units with trigger
« Reply #3 on: 29 Dec 2002, 19:57:40 »
heres a little script that will work for you. Instructions are in the script. Use wordpad or notepad to read it.

Deadman

  • Guest
Re:Create units with trigger
« Reply #4 on: 29 Dec 2002, 20:04:42 »
i wanted this very same thing a  map i was making and it took me ages to figure it out.

this is how i did it
i layed a east man on the map in the middle of the sea.
and in his init line i put ...... east1=gfroup this;.....
then i made a sqs example below

;;;;;;;;;;;;east1.sqs;;;;;;;;;;;;;;;;;;;

_units1 = units east1
"_x setunitpos up" foreach _units1
"_x allowfleeing 0" foreach _units1

#loop

? NOT(alive player): exit
?(("Alive _x" count _units1) == 0): goto "create"
~random(5)
goto "loop"

#create
"OfficerE" createunit [getpos a3, east1, "e1 = this", 1, "LIEUTENANT"]
"SoldierEG" createunit [getpos a3, east1, "e2 = this", 1, "SERGEANT"]
"SoldierEB" createunit [getpos a3, east1, "e3 = this", 1, "CORPORAL"]
"SoldierEB" createunit [getpos a3, east1, "e4 = this", 1, "CORPORAL"]
"SoldierEB" createunit [getpos a3, east1, "e5 = this", 1, "PRIVATE"]
"SoldierEMG" createunit [getpos a3, east1, "e6 = this", 1, "PRIVATE"]

hope that helps you, it helped me.

CrashnBurn

  • Guest
Re:Create units with trigger
« Reply #5 on: 29 Dec 2002, 21:47:20 »
LOL! Deadman, that's copy/pasted directly from one of my create scripts. Look at the attachment in my post above. The way I do it now is better, and requires less scripts for a mission. Besides, he didnt say he wanted a looping script that would continually create soldiers each time the group count reaches 0.