can you help me please about this question:
i would like a script that create units from an external file list:
For example, I have this code:
Code: Select all
function gadget:GetInfo()
return {
name = "unita_iniziali",
desc = "Aggiunge unità all'inizio del gioco.",
author = " thx to http://springrts.com community"
date = "September 19st, 2010",
license = "GPL, v.2, 2008",
layer = 1,
enabled = true,
}
end
local gaiaTeamId = Spring.GetGaiaTeamID()
eu_pilonax_a=Spring.CreateUnit("EUF_pilonax",3027,0,9301,2,3)
eu_pilonax_b=Spring.CreateUnit("EUF_pilonax",3582,0,9301,1,3)
eu_pilonax_c=Spring.CreateUnit("EUF_pilonax",3343,0,9656,1,3)
eu_pilonax_d=Spring.CreateUnit("EUF_pilonax",3582,0,9640,1,3)
end
I would like read the creating unit list from a file, example:
Code: Select all
function gadget:GetInfo()
return {
name = "unita_iniziali",
desc = "Aggiunge unità all'inizio del gioco.",
author = " thx to http://springrts.com community"
date = "September 19st, 2010",
license = "GPL, v.2, 2008",
layer = 1,
enabled = true,
}
end
local gaiaTeamId = Spring.GetGaiaTeamID()
code that create units by reading the units list from "initialunits.lua" ( or "initial.txt" or other file)
end
Thx you