Page 4 of 4
Re: Let's make a Tutorial Game for new modders
Posted: 31 Jul 2011, 23:28
by knorke
the Operahouse has a red circle and a attackbutton, that does nothing.
looks like the weapondef was correct and assigned correct.
(maybe missing projectile 3d object though?)
not firing/doing anything: probally script error.
no message in infolog.txt about the unit or script?
add this to your unitscript:
Code: Select all
function script.Create()
Spring.Echo ("WEEE! HERE I AM!")
end
if the unit does not happily cheer on being spawned, the unit script does not get loaded.
might have errors somewhere else: remove everything but those 3 lines, then slowly add stuff in
3 line script does not work: check file names and script= tag in unitdef.
Re: Let's make a Tutorial Game for new modders
Posted: 01 Aug 2011, 00:09
by PicassoCT
pasted script into the opera, doesent show up.. now does it read the script or not?
Re: Let's make a Tutorial Game for new modders
Posted: 01 Aug 2011, 01:10
by FLOZi
Do you have:
LuaRules/main.lua
LuaRules/draw.lua
LuaRules/Gadgets/unit_script.lua
?
Re: Let's make a Tutorial Game for new modders
Posted: 01 Aug 2011, 07:49
by PicassoCT
FLOZi wrote:Do you have:
LuaRules/main.lua
LuaRules/draw.lua
LuaRules/Gadgets/unit_script.lua
?
yes, copied from knorkes tutorial mod
Re: Let's make a Tutorial Game for new modders
Posted: 01 Aug 2011, 13:48
by FLOZi
pastebin an infolog then
Re: Let's make a Tutorial Game for new modders
Posted: 01 Aug 2011, 14:14
by PicassoCT
will do so once at home..
Re: Let's make a Tutorial Game for new modders
Posted: 10 Sep 2011, 18:46
by SDBryan
Just tested out the game with some skirmish AIs, but I'm getting an error that caused Spring to crash, as seen in infolog.txt attached. Have anyone get this same error?
Re: Let's make a Tutorial Game for new modders
Posted: 10 Sep 2011, 18:54
by hoijui
The skirmish AIs do not work with all games. They are mostly made for *A mods, an all of them should work with BA. RAI and AAI are more likely to work with other games then KAIK and E323AI. Shard can be adjusted to play practically any game, but you need to configure stuff.
i think there is no AI for this game.
Re: Let's make a Tutorial Game for new modders
Posted: 10 Sep 2011, 19:46
by PicassoCT
this is a tutorial game- its not ment to be played. Its ment to show beginners the basics, and it does so in a excellent way. Thx knorke, still have the simplewalker in notepad++...
Re: Let's make a Tutorial Game for new modders
Posted: 10 Sep 2011, 19:59
by Erik
Thx from me aswell, helped a lot

Re: Let's make a Tutorial Game for new modders
Posted: 10 Sep 2011, 20:10
by SDBryan
Try this, this might be useful. It is called LuaAI.
LuaAI.lua:
Code: Select all
return {
{
name = "TestAI",
desc = "Test AI",
},
}
TestAI.lua in (place in directory LuaRules\Gadgets):
Code: Select all
function gadget:GetInfo()
return {
name = "TestAI",
desc = "An AI that knows how to play Spring Tutorial Game",
author = "Me",
date = "2020-12-31",
license = "Public Domain",
layer = 82,
enabled = true
}
end
function gadget:GameStart()
-- Initialise AI for all teams that are set to use it
for _,t in ipairs(Spring.GetTeamList()) do
local _,_,_,isAI,side = Spring.GetTeamInfo(t)
if Spring.GetTeamLuaAI(t) == gadget:GetInfo().name then
Spring.Echo("Team "..t.." assigned to "..gadget:GetInfo().name)
local pos = {}
local home_x,home_y,home_z = Spring.GetTeamStartPosition(t)
end
end
end
Re: Let's make a Tutorial Game for new modders
Posted: 11 Sep 2011, 07:50
by knorke
There is no AI because the game is not playable - there are just random example units.
NullAI will not crash but not do anything else either. Good for testing.
I think RAI will also not crash and if you give it some units it will drive them around.
I thought about including some simple Lua but it would have to be something less complicated than an AI.
Re: Let's make a Tutorial Game for new modders
Posted: 25 Jun 2012, 23:18
by knorke
I was asked if this still works in current spring.
As far as I tested, it does.
Re: Let's make a Tutorial Game for new modders
Posted: 26 Jun 2012, 08:10
by PicassoCT
but did you do all the tests? With all the gadgets, on virtual maschines running all systems?