Statistics: Posted by DDDX — 27 Feb 2018, 01:18
-- spawns a wave of units
--------------------------------------------------------------------------
Survival_SpawnNavy = function(SpawnTime) ((I TRIED ADDING AN EXTRA SPAWN FUNCTION))
-- LOG("----- Survival MOD: Performing a wave spawn at " .. SecondsToTime(SpawnTime));
local WaveTable = nil;
local UnitTable = nil;
local UnitID = nil;
local POS = nil;
local RandID = nil;
for x = 3, table.getn(Survival_WaveTables) do ((I ADDED AN EXTRA WAVE ID IN THE WAVETABLE, REFFERENCING IT HERE WITH THE 3, ALSO ADDED AN EXTRA COLUMN IN THAT TABLE TO REFFERENCE MARKER POSITION))
if (table.getn(Survival_WaveTables[x][Survival_WaveTables[x][1]]) > 1) then
-- for the amount of units we spawn in per wave
for z = 1,Survival_UnitCountPerWave do
WaveTable = Survival_WaveTables[x][Survival_WaveTables[x][1]]; -- grab the wave set table we're spawning from
RandID = math.random(3, table.getn(WaveTable));
UnitTable = WaveTable[RandID]; -- reference that unit table
UnitID = Survival_GetUnitFromTable(UnitTable); -- pick a random unit id from this table
OrderID = UnitTable[2];
POS = Survival_GetPOS(UnitTable[3], 0); ((BORROWED THIS FROM SURVIVAL_SPAWNSPECIALWAVE, ADDED AN EXTRA COLUMN WITH THE MARKER VALUE IN THE NEWLY ADDED WAVETABLE))
Survival_SpawnNavy(UnitID, "ARMY_SURVIVAL_ENEMY", POS, OrderID); ((THIS FOR THE NEXT FUNCTION BELOW))
end
end
end
end
-- spawns a specified unit
--------------------------------------------------------------------------
Survival_SpawnNavy = function(UnitID, ArmyID, POS, OrderID) -- blueprint, army, position, order ((ADDED A NEW FUNCTION BASED ON THE SURVIVAL_SPAWNUNIT))
-- LOG("----- Survival MOD: SPAWNUNIT: Start function...");
local PlatoonList = {};
local NewUnit = CreateUnitHPR(UnitID, ArmyID, POS[1], POS[2], POS[3], 0,0,0);
NewUnit:SetProductionPerSecondEnergy(325);
table.insert(PlatoonList, NewUnit); -- add unit to a platoon
Survival_PlatoonOrder(ArmyID, PlatoonList, OrderID); -- give the unit orders
end
Statistics: Posted by DDDX — 21 Feb 2018, 03:18
Statistics: Posted by speed2 — 21 Feb 2018, 03:10
Statistics: Posted by DDDX — 21 Feb 2018, 02:40
Statistics: Posted by DDDX — 20 Feb 2018, 20:48
Statistics: Posted by DDDX — 20 Feb 2018, 20:14
Statistics: Posted by speed2 — 20 Feb 2018, 18:39
Statistics: Posted by DDDX — 20 Feb 2018, 17:38
Statistics: Posted by DDDX — 20 Feb 2018, 15:16
Statistics: Posted by DDDX — 19 Feb 2018, 02:17
Statistics: Posted by DDDX — 17 Feb 2018, 16:17