Home   Help Search Login Register  

Author Topic: Spawning groups  (Read 1843 times)

0 Members and 1 Guest are viewing this topic.

Mizilus

  • Guest
Spawning groups
« on: 04 Oct 2005, 09:11:22 »
I made a place keeper dummy group off and away from the action, made a trigger that detects my group/player and a place for them to spawn..

When the spawn occurs it is a single west guy when I want a group of east.


What is the trick to spawning groups of enemy off of a detect west/east trigger?


my buddies have slow computers and I'm looking for ways to make missions so they go easy on them and we can play.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Spawning groups
« Reply #1 on: 04 Oct 2005, 10:54:53 »

1) the least intensive method for  the cpu, is to already have the units on the map somewhere, say a safe island away from the playing area, and place them incargo in a vehicle that will take 12 men, a chinook is good for this

and then when you are ready, simply unnasign, eject them and setpos them

2) Second least intensive
is to create the group you want, somewhere on the island
(You can then create an array, with the info required about each  attribute for each member of the unit, which can then be used later when you use "Createeunit")
Then deletevehicle each member of this group

(There is far less lag caused when you use createunit to create a class of unit that has "ALREADY" existed on the map somewhere, even if that unit classtype is already dead)

3) 3rd option is to use BN880's superb AI on demand (Download from the C0C site), however this is more useful for recreating vast amounts of units or groups when triggered by booleans, distance or triggers

4) Worst system, use createunit to create a unit class that has never existed on the map, have lots of entry's in the createunit "Init" field, run the create script too fast.



To create a group, you will have to run a createunit command for each unit you want

RE: Trigger Question
Quote
What is the trick to spawning groups of enemy off of a detect west/east trigger?
On Activation: []Exec "Myscript.sqs"

Myscript.sqs
?!(local server): exit


That will stop any other system, eg other players on your network, from running the create/ setpos script for your new group
« Last Edit: 04 Oct 2005, 10:57:55 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Mizilus

  • Guest
Re:Spawning groups
« Reply #2 on: 04 Oct 2005, 11:15:51 »
thank you. This will be  a great help.

I'm pretty new at this and I'm curious exactly how I would make this particular series of events happen.


and then when you are ready, simply unnasign, eject them and setpos them



Also, would I be able to spawn multiple groups off of the dummy squad? For example: I want to spawn VC infantry squads as well as heavy weapons squads using the same dummy squads several times. Is this possible?

Other than that I am saving the info you just provided to a file. Thanks again.

« Last Edit: 04 Oct 2005, 11:20:12 by Mizilus »

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Spawning groups
« Reply #3 on: 04 Oct 2005, 18:39:03 »
Using the createunit command to create several units , the script would look something like the followinhg


MISSION EDITOR
Create an empty marker, name the marker "Spawn1"
Place a unit somewhere safe on the map, with waypoints wherever you need them and name the unit Spawn1, this will be the group leader for your spawned units

Create a trigger "East detected by west", or whatever condition you want the trigger to work on
Set it to NONE REPEATING
On Activation: [] exec "Spawnunits.sqs"

INIT.SQS
Spawn1Group = group Spawn1
Spawn1Group lockwp true




SpawnUnits.sqs
~1
"SoldierWB" createUnit [getMarkerPos "Spawn1", Spawn1Group, "U1 = this; this addweapon {binocular}", 0.6, "corporal"]
~2
"SoldierWB" createUnit [getMarkerPos "Spawn1", Spawn1Group, "U2 = this; this addweapon {Laserdesignator}", 0.6, "private"]
~2
"SoldierWB" createUnit [getMarkerPos "Spawn1", Spawn1Group, "U1 = this; removeallweapons this;this addweapon {M60};this addmagazineM60}", 0.6, "private"]
~2
Spawn1 setpos (getmarkerpos "Spawn1"}
Spawn1Group LockWP False
exit

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ALTERNATIVELY
using units already created in the mission editor and placing then incargo until required


MISSION EDITOR
Create a chinook somewhere on the island away from any playable units, remove the fuel just incase some player manages to make it to the chinook and name it Chin1

Create your group in the mission editor, name 1 of the units "Spawn1" and in each units init field, place the following code
this moveincargo Chin1

Create whatever waypoints your group required and place them at their required locations

Create exactly the same trigger as you did for method 1

and create the same empty marker "Spawn1" at the location you want the units setpossed too

INIT.sqs
Spawn1Group = group Spawn1

SpawnUnits.sqs

{unnasignvehicle _x}foreach units Spawn1group
~3
@ ({_x in chin1}count units Spawn1group <1)
{_x setpos (getmarkerpos "Spawn1")} foreach units spawn1group
deletevehehicle chin1
exit


Script written on the fly, untested, so there may be a syntax mistake





« Last Edit: 04 Oct 2005, 18:40:08 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Mizilus

  • Guest
Re:Spawning groups
« Reply #4 on: 04 Oct 2005, 21:07:33 »
Thanks Terox. I'll try it and post again if I have any problems or questions.