<?xml version="1.0" standalone="yes" ?>
<scenario>
	<maxplayers value="8"/>
	<difficulty value="3"/>
	<players>
		<player control="human" faction="towers" team="1"/>
		<player control="network" faction="towers" team="1"/>
		<player control="network" faction="towers" team="1"/>
		<player control="network" faction="towers" team="1"/>
		<player control="cpu" faction="creeps" team="5"/>
		<player control="cpu" faction="creeps" team="5"/>
		<player control="cpu" faction="creeps" team="5"/>
		<player control="cpu" faction="creeps" team="5"/>

	</players>
	<map value="rounddefense" />
	<tileset value="hell"/>
	<tech-tree value="creepsntowers"/>
	<default-resources value="true"/>
	<default-units value="true"/>
	<fog-of-war value="false"/>
	<default-victory-conditions value="false"/>
	<scripts>
		<global>
			print("global");
			package.path = getSystemMacroValue("$SCENARIO_PATH") .. "/?.lua;" .. package.path;
			MgEnums = require "libs.MgEnums"
			JSON = require "libs.JSON"
			require "compatibility.3.9.0"
			TD = require "lua.towerdefense"
		</global>
		<startup>
			--dofile(getSystemMacroValue("$SCENARIO_PATH").."lua/startup.lua")
			--TD:startup();
			(require "lua.startup")();
		</startup>
		<unitDied>
			--dofile(getSystemMacroValue("$SCENARIO_PATH").."lua/unitDied.lua");
			--TD:unitDied();
			(require "lua.unitDied")();
		</unitDied>
		<cellTriggerEvent>
			--dofile(getSystemMacroValue("$SCENARIO_PATH").."lua/cellTriggerEvent.lua");
			--TD:cellTriggerEvent();
			(require "lua.cellTriggerEvent")();
		</cellTriggerEvent>
		<timerTriggerEvent>
			--dofile(getSystemMacroValue("$SCENARIO_PATH").."lua/timerTriggerEvent.lua");
			--TD:timerTriggerEvent();
			(require "lua.timerTriggerEvent")();
		</timerTriggerEvent>
		<onSave>
			print("saaaave!\n");
			storeSaveGameData("pathtrigger",JSON:encode(pathtrigger));
		</onSave>
        <onLoad>
			JSON = require "libs.JSON"
			--print("onload");
            print(loadSaveGameData("pathtrigger"));
            pathtrigger = JSON:decode(loadSaveGameData("pathtrigger"));
        </onLoad>
	</scripts>
</scenario>

