Home   Help Search Login Register  

Author Topic: Splitting a group in half and back successfully  (Read 1473 times)

0 Members and 1 Guest are viewing this topic.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Splitting a group in half and back successfully
« on: 14 May 2009, 22:19:46 »
Hello my dear friends,

Want this:

Option (i.e action) to split a 10 unit group into two 5 unit groups.
Original group has leader AND also a potential leader.
Potential leader gets the option to "unjoin" himself and 4 more guys to form a new 5 unit group.
Original leader AND the new (potential) leader both get options to join both groups again.

Tried different ways, but they ALL failed in MP.

HOW?  ???

Laggy
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Sparticus76

  • Members
  • *
Re: Splitting a group in half and back successfully
« Reply #1 on: 15 May 2009, 11:03:02 »
Probably a stupid question (and I cringe everytime I say that), but have you tried something like this...warning..sqs to follow, I'm lazy at the moment and this is an old script I dug up.

call.sqs
Code: [Select]
_man = _this select 0
_group = [_man] call splitgroup 
_evengroup = _group select 0
_oddgroup = _group select 1
_oddgroup move getmarkerpos "one"
@unitready (leader _oddgroup)


~10
{[_x] join (leader _evengroup)} foreach units _oddgroup

~10
_splitminor join group _man

exit

splitgroup.sqf
Code: [Select]
private ["_Ldrgrp","_grp","_oddPeople","_Oddldr","_numg","_v"];
_Ldrgrp = _this select 0;
_grp    = units _Ldrgrp;
_numg   = count _grp;
_Oddldr = _grp select 1;
_oddPeople = [];

for [{ _v = 1 }, {_v < _numg}, {_v = _v + 2}] do
{
    _oddPeople = _oddPeople + [_grp select _v];
};
_oddPeople join (createGroup (side _Oddldr));
[_Ldrgrp, group _Oddldr];

This takes "man"s group, divides it evenly, then splits the group in two, moves on group to a marker, then rejoins the groups after 10 seconds. If this worked, they'd join from created actions instead of by the 10s timers.

Offline Trexian

  • Members
  • *
Re: Splitting a group in half and back successfully
« Reply #2 on: 15 May 2009, 18:45:53 »
Does only the #2 guy have the addaction?  And, does it matter which of the remaining guys he gets?  And, I assume #2 will be a human player (although, come to think of it, you could maybe set it up so that you could go to the "action" menu item and trigger it for AI)?
Sic semper tyrannosauro.