Home   Help Search Login Register  

Author Topic: simple Ai group respawn script [solved]  (Read 1316 times)

0 Members and 1 Guest are viewing this topic.

Offline Bracks

  • Members
  • *
simple Ai group respawn script [solved]
« on: 15 Dec 2007, 04:56:30 »
Hi,
I'm having problems with a script I have tried to put together from ideas I got from Norrins AI_foot script, but instead using groups... however I am still learning it all so its abit of a struggle.

I think it must be a basic sytax stuff up/misunderstanding because It does not give me an error.  The group does not respawn at all, once they are all dead.

Any help much appreciated.

It is exec'ed with the code

Code: [Select]
a=grpzA execVM "alivey1.sqf";

GrpzA being the group name
wy1,wy2,wy3 are different varibles, depending on how the battle is going.
reswn is a public varible which counts how many times they have respawned.  I would guess I probably went about it the wrong way.

Code: [Select]
if (!local Server) exitWith {};

private "_grpAlive","_group","_name";

_group = _this select 0;
_name = format ["%1",_group];


_grpAlive = true;


while{_grpAlive}do
   {
    if ( {alive _x} count units _group < 1 )
then { _grpAlive = false;reswn=reswn + 1;publicvariable "reswn"}
    else {sleep 10}
   };

if (reswn > 8) exitWith {}

else {

"VIL_SOLDIEReBSTG2" createUnit [getMarkerPos "base1", _name];
"VIL_SOLDIEReBmp2" createUnit [getMarkerPos "base1", _name];
"VIL_SOLDIEReBkarzl" createUnit [getMarkerPos "base1", _name];
"VIL_SOLDIEReBkarzl" createUnit [getMarkerPos "base1", _name];
"VIL_SOLDIEReBmg2" createUnit [getMarkerPos "base1", _name];
"VIL_SOLDIEReBmg2" createUnit [getMarkerPos "base1", _name];
"VIL_SOLDIEReBkarzl" createUnit [getMarkerPos "base1", _name];
};

sleep 5;

_Waychoice= [wy1,wy2,wy3];

switch (_waychoice) do {
case 1: {_way0 = _name addWaypoint [ (getMarkerPos "A_1st"), 1];
[_way0, 1] setWaypointType "SAD";
[_way0, 1] setWaypointFormation "LINE";};

case 2: {_way1 = _name addWaypoint [ (getMarkerPos "A_2nd"), 1];
[_way1, 1] setWaypointType "SAD";
[_way1, 1] setWaypointFormation "LINE";};

case 3: {_way2 = _name addWaypoint [ (getMarkerPos "A_3rd"), 1];
[_way2, 1] setWaypointType "SAD";
[_way2, 1] setWaypointFormation "LINE";};
};

sleep 10;

if (true) exitwith {A=_name execVM "alivey1.sqf"};


Edit: Dr_Eyeball released his set of group respawn script, which I have switched to http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=8e84cdc108520dd2e768ad511484376e;act=ST;f=71;t=69949;st=0;&#entry1190438
 :scratch:
« Last Edit: 18 Dec 2007, 00:33:31 by Bracks »