Let's make a Tutorial Game for new modders - Page 4

Let's make a Tutorial Game for new modders

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderators: Moderators, Moderators

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Let's make a Tutorial Game for new modders

Post 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.
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10263
Joined: 24 Jan 2006, 21:12

Re: Let's make a Tutorial Game for new modders

Post by PicassoCT »

pasted script into the opera, doesent show up.. now does it read the script or not?
0 x

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6113
Joined: 29 Apr 2005, 01:14

Re: Let's make a Tutorial Game for new modders

Post by FLOZi »

Do you have:

LuaRules/main.lua
LuaRules/draw.lua
LuaRules/Gadgets/unit_script.lua

?
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10263
Joined: 24 Jan 2006, 21:12

Re: Let's make a Tutorial Game for new modders

Post by PicassoCT »

FLOZi wrote:Do you have:

LuaRules/main.lua
LuaRules/draw.lua
LuaRules/Gadgets/unit_script.lua

?
yes, copied from knorkes tutorial mod
0 x

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6113
Joined: 29 Apr 2005, 01:14

Re: Let's make a Tutorial Game for new modders

Post by FLOZi »

pastebin an infolog then
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10263
Joined: 24 Jan 2006, 21:12

Re: Let's make a Tutorial Game for new modders

Post by PicassoCT »

will do so once at home..
0 x

SDBryan
Posts: 10
Joined: 23 May 2010, 06:24

Re: Let's make a Tutorial Game for new modders

Post 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?
Attachments
infolog.txt
Infolog containing crash information
(13.16 KiB) Downloaded 113 times
0 x

User avatar
hoijui
Former Engine Dev
Posts: 4342
Joined: 22 Sep 2007, 09:51

Re: Let's make a Tutorial Game for new modders

Post 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.
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10263
Joined: 24 Jan 2006, 21:12

Re: Let's make a Tutorial Game for new modders

Post 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++...
0 x

User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: Let's make a Tutorial Game for new modders

Post by Erik »

Thx from me aswell, helped a lot 8)
0 x

SDBryan
Posts: 10
Joined: 23 May 2010, 06:24

Re: Let's make a Tutorial Game for new modders

Post 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
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Let's make a Tutorial Game for new modders

Post 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.
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Let's make a Tutorial Game for new modders

Post by knorke »

I was asked if this still works in current spring.
As far as I tested, it does.
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10263
Joined: 24 Jan 2006, 21:12

Re: Let's make a Tutorial Game for new modders

Post by PicassoCT »

but did you do all the tests? With all the gadgets, on virtual maschines running all systems?
0 x

Post Reply

Return to “Game Development”