I have been sticking my nose a bit into LUA and made a first attempt for a very small test gadget not for use in any game but just to get some result :D
i tryed the gadget but here is the problem:
i don't get any message ingame as i am trying to get but also i don't get any error messages
Can somebody tell me why it does not do anything or what i did do wrong ?
Code: Select all
function gadget:GetInfo()
return {
name = "Test",
desc = "Test",
author = "[MW]Razorblade",
date = "2011",
license = "Test",
layer = 1,
enabled = true
}
end
if gadgetHandler:IsSyncedCode() then
local MapSizeX, MapSizeZ = Spring.GetMapSize()
local X = Game.MapSizeX
local Z = Game.MapSizeZ
function gadget:initialize()
function gadget:GameFrame(f)
local X = Game.MapSizeX
local Z = Game.MapSizeZ
if Game.MapSizeX > Z then Spring.Echo("hello"..MapSizeX,MapSizeZ)
elseif Game.MapSizeX < Z then Spring.Echo("BOO"..MapSizeZ,MapSizeX)
end
end
end
end