Engine will stop spawning start units and resources
Moderator: Moderators
Re: Engine will stop spawning start units and resources
You could spawn the start unit directly in LuaRules' main.lua
Re: Engine will stop spawning start units and resources
Not really as the gadget is provided in the base files to be backwards compatible, you just have to have gadgets set up..Kerr wrote:but you are making it more complicated on mods that don't want random starting units...
Would basically never happen.If I did not want any lua gadgets in my mod, would my mod run in any capacity?
Re: Engine will stop spawning start units and resources
The exemple 'game_spawn.lua' provided doesn't work:
Not sure if it's best to fix by allowing unsafe changes or by moving the spawning to GameFrame.
Code: Select all
Unsafe attempt to change game state
Re: Engine will stop spawning start units and resources
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.
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
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
yeah.... and what next, one another lua file... then one another... and so on.
Re: Engine will stop spawning start units and resources
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.TradeMark wrote:yeah.... and what next, one another lua file... then one another... and so on.
Re: Engine will stop spawning start units and resources
okay... few lines of code vs few files is as messed up IMO.
- SanadaUjiosan
- Conflict Terra Developer
- Posts: 907
- Joined: 21 Jan 2010, 06:21
Re: Engine will stop spawning start units and resources
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
well... theres no cons in making default options really
- ScarySquirrel
- Posts: 82
- Joined: 29 Apr 2007, 04:25
Re: Engine will stop spawning start units and resources
Wow, even more improvements.
This is what makes Open Source great: it's always improving.
This is what makes Open Source great: it's always improving.
Re: Engine will stop spawning start units and resources
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
- Attachments
-
- game_spawn.lua
- (4.02 KiB) Downloaded 195 times
Re: Engine will stop spawning start units and resources
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?
edit: .. is it that in-game, you can only place buildings into this grid too?
Re: Engine will stop spawning start units and resources
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.
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.
Is it an actual question I'm supposed to answer?hoijui wrote:edit: .. is it that in-game, you can only place buildings into this grid too?
Re: Engine will stop spawning start units and resources
"AF fully endorses zwszgs improvements and looks forward to future additions"
*gives zwzsg a cookie*
*gives zwzsg a cookie*
Re: Engine will stop spawning start units and resources
Link in first post should be updated to reflect new git directory structure
http://github.com/spring/spring/blob/ma ... _spawn.lua
http://github.com/spring/spring/blob/ma ... _spawn.lua
Re: Engine will stop spawning start units and resources
Thanks, updated.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2700
- Joined: 25 Aug 2004, 13:31
Re: Engine will stop spawning start units and resources
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
Spring.GetSideData fetches it from your mod /gamedata/sidedata.tdf
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2700
- Joined: 25 Aug 2004, 13:31