Page 2 of 4
Re: Engine will stop spawning start units and resources
Posted: 28 Feb 2010, 20:29
by Tobi
You could spawn the start unit directly in LuaRules' main.lua
Re: Engine will stop spawning start units and resources
Posted: 28 Feb 2010, 20:31
by FLOZi
Kerr wrote:but you are making it more complicated on mods that don't want random starting units...
Not really as the gadget is provided in the base files to be backwards compatible, you just have to have gadgets set up..
If I did not want any lua gadgets in my mod, would my mod run in any capacity?
Would basically never happen.
Re: Engine will stop spawning start units and resources
Posted: 28 Feb 2010, 23:55
by zwzsg
The exemple 'game_spawn.lua' provided doesn't work:
Code: Select all
Unsafe attempt to change game state
Not sure if it's best to fix by allowing unsafe changes or by moving the spawning to GameFrame.
Re: Engine will stop spawning start units and resources
Posted: 19 Mar 2010, 23:48
by TradeMark
cant you leave the default behaviour if some file is not found etc?
will just make mods harder to make when the amount of needed lua files is growing constantly.
Re: Engine will stop spawning start units and resources
Posted: 20 Mar 2010, 00:53
by Argh
It involves dropping exactly one file into LuaRules. It's not the end of the world.
Re: Engine will stop spawning start units and resources
Posted: 20 Mar 2010, 13:06
by TradeMark
yeah.... and what next, one another lua file... then one another... and so on.
Re: Engine will stop spawning start units and resources
Posted: 20 Mar 2010, 15:15
by SinbadEV
TradeMark wrote:yeah.... and what next, one another lua file... then one another... and so on.
NO, it would involve adding a few lines of code to said one file until all of the behavior required to make a TA game with the spring engine has been moved out of the engine proper and into a single lua file and we can finally get the open source community to like us.
Re: Engine will stop spawning start units and resources
Posted: 20 Mar 2010, 15:45
by TradeMark
okay... few lines of code vs few files is as messed up IMO.
Re: Engine will stop spawning start units and resources
Posted: 20 Mar 2010, 18:53
by SanadaUjiosan
I don't know, I'm happy with leaving the engine in the hands of those who are capable. If we want Spring to get better, it'll have to change. Just the way things work.
Re: Engine will stop spawning start units and resources
Posted: 20 Mar 2010, 19:24
by TradeMark
well... theres no cons in making default options really
Re: Engine will stop spawning start units and resources
Posted: 28 Mar 2010, 07:58
by ScarySquirrel
Wow, even more improvements.
This is what makes Open Source great: it's always improving.
Re: Engine will stop spawning start units and resources
Posted: 21 Apr 2010, 22:44
by zwzsg
Here is a better version of game_spawn.lua
- Switch off error about unsafe change
- Snap start unit to 16x16 grid
- Start unit face toward map center
Re: Engine will stop spawning start units and resources
Posted: 22 Apr 2010, 15:39
by hoijui
zwzsg, i have it ready to put into spring source, put i do not get the snap-to-grid thing. i mean... i can imagine what id does, but what is it good for? could it be negative for any mod?
edit: .. is it that in-game, you can only place buildings into this grid too?
Re: Engine will stop spawning start units and resources
Posted: 22 Apr 2010, 16:16
by zwzsg
For mods that start with mobile units, it doesn't really matter since the unit can move.
A naive concern would be that displacing units could make them spawn in a cliff or acid if they were already very close to it. However, a proper examination dispels this argument: if you stay within the same 16x16 cell, you are in the same passability "tile" gameplaywise.
For mods that start with immobile units (Gundam, EvoRTS, KP, ...), it makes them align to the building grid that all the regularly built structures are forced into. This helps with two things:
- Decals alignement. For start pos that are not roundish, decal gets slightly misaligned. It's a hard to notice small detail, but would still looks a bit sloppy.
- Lining up with regulary built structure around the start structure.
hoijui wrote:edit: .. is it that in-game, you can only place buildings into this grid too?

Is it an actual question I'm supposed to answer?
Re: Engine will stop spawning start units and resources
Posted: 12 May 2010, 17:50
by AF
"AF fully endorses zwszgs improvements and looks forward to future additions"
*gives zwzsg a cookie*
Re: Engine will stop spawning start units and resources
Posted: 02 Jun 2010, 21:13
by FLOZi
Link in first post should be updated to reflect new git directory structure
http://github.com/spring/spring/blob/ma ... _spawn.lua
Re: Engine will stop spawning start units and resources
Posted: 02 Jun 2010, 21:20
by Tobi
Thanks, updated.
Re: Engine will stop spawning start units and resources
Posted: 02 Jun 2010, 22:34
by bobthedinosaur
I'm sorry, I am confused. Where are devs defining what units are the start units with this gadget?
Re: Engine will stop spawning start units and resources
Posted: 02 Jun 2010, 22:57
by zwzsg
Spring.GetSideData fetches it from your mod /gamedata/sidedata.tdf
Re: Engine will stop spawning start units and resources
Posted: 03 Jun 2010, 03:26
by bobthedinosaur
oh neeto