Home   Help Search Login Register  

Author Topic: How to rebuild non existing group ?  (Read 495 times)

0 Members and 1 Guest are viewing this topic.

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
How to rebuild non existing group ?
« on: 16 Jun 2003, 21:32:53 »
Code: [Select]
#spawnleader
"OfficerE" createUnit [getPos _base, dummygroup]

;assign to other group
_member = leader dummygroup
[_member] join grpNull
_grp = group _member

#spawnrest
"SoldierEB" createUnit [getPos (leader _grp), _grp]

?(count units _grp == 12):goto "groupfull"
goto "spawnrest"

#groupfull

This code spawns a leader and 11 soldiers, runs great. But only 1 time ! Problem is: i spawn the leader into a pre existing group called DUMMYGROUP which is emtpy. After leader is spawned, he is assigned to another group which name is calculated (_grp).

Sadly, DUMMYGROUP is non existant after the script runs 1 time, because grpNull is used. How can i ...

a.) 'rebuild' DUMMYGROUP

b.) transfer the leader into another group without using 'grpNull' ?


(maybe it's easy to solve, but i don't get it)  :P
« Last Edit: 16 Jun 2003, 21:34:40 by DrStrangelove »

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:How to rebuild non existing group ?
« Reply #1 on: 16 Jun 2003, 22:59:13 »
(ahem) got it.

My mistake was that i deleted the soldier in the editor that had "dummygroup = group this" in his init line. Therefore dummygroup is destroyed upon the only leader in dummygroup joins grpNull.

Now that i don't delete the dummygroup soldier everything is fine.

And here are the outcomes: it's a spawnmanager. after loading the mission you spawn a group after hitting 0-0-0. The group is sent immediately on a random patrol with a radius of 400m around their spawnpoint.

Hitting 0-0-0 again and again, you can spawn more groups that go onto a patrol. You get infos about the latest spawned group and the global allgroups-array in the upper left corner of the screen. Enjoy !