Statistics: Posted by Sprouto — 18 Apr 2018, 01:19
Sprouto wrote:Clearest explanation of how to use the debugger - ever. Thanks Speed.
Statistics: Posted by speed2 — 18 Apr 2018, 00:21
Statistics: Posted by Domino — 17 Apr 2018, 23:14
Statistics: Posted by speed2 — 17 Apr 2018, 20:19
Statistics: Posted by Domino — 17 Apr 2018, 19:33
Statistics: Posted by DDDX — 05 Apr 2018, 12:53
local ScenarioUtils = import('/lua/sim/ScenarioUtilities.lua')
-- create a table for ModNames and UIDs
local InstalledMods = {}
function OnPopulate()
ScenarioUtils.InitializeArmies()
-- loop over __active_mods table.
for index, moddata in __active_mods do
-- save the modname as index and set it to true.
InstalledMods[moddata.name] = true
-- Save also the ModID as index and set it also to true
InstalledMods[moddata.uid] = true
-- Debug line for the debuglog [F9]
LOG('Mapscript: found Mod with name: '..moddata.name..' - UID: '..moddata.uid )
end
end
function OnStart(self)
-- identify Total Mayhem by Mod Name:
if InstalledMods['Total Mayhem'] == true then
LOG('Mapscript: Yes, Total mayhem is installed. (identified by name)')
end
-- identify Total Mayhem by UID (every version has a different UID)
if InstalledMods['62e2j64a-TOMA-3652-01360-146as555a8u3'] == true then
LOG('Mapscript: Yes, Total Mayhem Version 1.36 is installed (identified by UID)')
end
end
Statistics: Posted by Uveso — 04 Apr 2018, 21:13
Survival_UpdateWavesB = function(GameTime)
local OldWaveID = 1;
for index, mods in __active_mods do -- THIS seems to be the problem
if mods == "Survival Mayhem&BO balance" then -- and this.
LOG("----- Ballance mod is ON...");
-- check the wave table times vs the wave spawn time to see which waves we spawn
for x = 1, table.getn(Survival_WaveTablesB) do -- loop through each of the wavetable entries (ground/air/sea...)
-- OldWaveID = 1;
OldWaveID = Survival_WaveTablesB[x][1];
for y = Survival_WaveTablesB[x][1], table.getn(Survival_WaveTablesB[x]) do -- loop through each wave table within the category
if (GameTime >= (Survival_WaveTablesB[x][y][1] * 60)) then -- compare spawn time against the first entry spawn time for each wave table
if (Survival_WaveTablesB[x][1] < y) then -- should only update a wave once
Survival_WaveTablesB[x][1] = y; -- update the wave id for this wave category
--if (x == 1) then -- if this is the special category update, immediately call the setup function
-- Survival_SpawnSpecialWave(GameTime);
--end
end
else break; end
end
if (Survival_WaveTablesB[x][1] != OldWaveID) then -- if we have a new wave ID for this table
LOG("----- Survival MOD: Updating wave table from C:" .. x .. " ID:" .. Survival_WaveTablesB[x][1] .. " ( Set:" .. (Survival_WaveTablesB[x][1] - 1) ..") at " .. SecondsToTime(GameTime));
end
end
else
LOG("----- Balance mod is not ON..."); -- I get this in the log
end
end
end
Statistics: Posted by DDDX — 04 Apr 2018, 17:29
Statistics: Posted by speed2 — 04 Apr 2018, 15:57
function OnPopulate()
LOG("----- Survival MOD: OnPopulate()");
-- start the armies
ScenarioUtils.InitializeArmies();
-- prepare all the survival stuff
Survival_InitGame();
-- which mods are active?
local mods = __active_mods
LOG('Map Script ... active mods in sim: ', repr(__active_mods))
end
-- function OnStart()
-- end
function OnStart(self)
LOG("----- Survival MOD: Initializing game start sequence...");
-- start the survival tick
ForkThread(Survival_Tick);
end
for index, moddata in __active_mods do
if moddata == 'Survival Mayhem&BO balance' then
Statistics: Posted by DDDX — 04 Apr 2018, 15:22
speed2 wrote:
Well you have to edit the map script. The mods are saved in the global variable __active_mods as Uveso posted.
You can access it like this for example (map script):
- Code:
local ScenarioUtils = import('/lua/sim/ScenarioUtilities.lua')
function OnPopulate()
ScenarioUtils.InitializeArmies()
local mods = __active_mods
LOG('Map Script ... active mods in sim: ', repr(__active_mods))
end
function OnStart()
end
Statistics: Posted by speed2 — 04 Apr 2018, 14:49
Statistics: Posted by DDDX — 04 Apr 2018, 11:56