Forum Jump :

Author Message

FUN|Sniper  

I am spamming Armaholic cause I can


Posts: 5
Rank:


Level: Hidden

Country: us
Location:
Occupation:
Age:
In-game name: chris.derienzo1@gmail.com

 
#1 Posted at 2013-10-08 02:56        
     
Hello,
I was wondering if anybody knew a script to have gamelogic (city) activated one after another randomly like a Xeno Domination mission. I have 16 game logic named d_target_0 to d_target_16 because I want there to be 16 random targets. in my init.sqf I have this:
deadunits = 0;
SMunits = [];
sectorup = false;

_sectors = ["d_target_0","d_target_1","d_target_2","d_target_3","d_target_4","d_target_5","d_target_6","d_target_7","d_target_8","d_target_9","d_target_11","d_target_12","d_target_13","d_target_14","d_target_15","d_target_16"] 

while {true} do {
waitUntil {!sectorup};
_sectorselected = _sectors call BIS_fnc_selectRandom;
_sectors = _sectors - [_sectorselected];

_random = round(random 3) + 1;
for "_i" from 0 to _random do 
{
	_randomPos = [[[getPos _sectorselected, random 300 + 200]],["water","out"]] call BIS_fnc_randomPos;
	_spawnGroup = [_randomPos, EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfTeam")] call BIS_fnc_spawnGroup;
	nul = [_spawnGroup,getpos _sectorselected, random 400 + 300] call BIS_fnc_taskPatrol;
	{_x addEventHandler ["Killed",{deadunits = deadunits + 1}];} foreach units _spawnGroup;
	SMunits = SMunits + (units _spawnGroup);
};

_hint format ["Clear sector %1",_sectorselected];
sectorup = true;
sleep 2;
waitUntil {deadunits > count SMunits / 2};
sectorup = false;
if (count _sectors < 1) exitWith {hint "You have cleared all sectors. Mission Complete."; sleep 5; "END1" call BIS_fnc_endMission; };
hint format ["Sector %1 cleared.",_sectorselected];
deadunits = 0;
{deletevehicle _x} foreach SMunits;
SMunits = [];
};

task1 = player createSimpleTask ["Capture All Sectors"];
task1 setSimpleTaskDescription ["Capture all sectors",""];
task1 setTaskState "Assigned";
player setCurrentTask task1;

---------------------------------------------------------------------------------
None of those scripts are activating, not even the task part. Is there something I am doing wrong? If so do you have an answer? Or do I need to add something other than the gamelogics and this script. So far I have the mission.sqm the init.sqf and the description.ext with the basic loading screen stuff in it and the spawn area all inside the mission directory.

Thanks for the help,

FUN|Sniper

This post was edited by Foxhound (2013-10-09 08:23, ago)


Author Message

FUN|Sniper  

I am spamming Armaholic cause I can


Posts: 5
Rank:


Level: Hidden

Country: us
Location:
Occupation:
Age:
In-game name: chris.derienzo1@gmail.com

 
#2 Posted at 2013-10-09 12:24        
     
Is it even possible to do this?