View topic - Engine will stop spawning start units and resources



All times are UTC + 1 hour


Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: 28 Feb 2010, 20:29 
Spring Developer

Joined: 01 Jun 2005, 10:36
Location: The Netherlands
You could spawn the start unit directly in LuaRules' main.lua


Top
 Offline Profile  
 
PostPosted: 28 Feb 2010, 20:31 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
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..

Quote:
If I did not want any lua gadgets in my mod, would my mod run in any capacity?


Would basically never happen.


Top
 Offline Profile  
 
PostPosted: 28 Feb 2010, 23:55 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
The exemple 'game_spawn.lua' provided doesn't work:
Code:
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.


Top
 Offline Profile  
 
PostPosted: 19 Mar 2010, 23:48 
Map Creator
User avatar

Joined: 17 Feb 2006, 15:58
Location: retired
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.


Top
 Offline Profile  
 
PostPosted: 20 Mar 2010, 00:53 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
It involves dropping exactly one file into LuaRules. It's not the end of the world.


Top
 Offline Profile  
 
PostPosted: 20 Mar 2010, 13:06 
Map Creator
User avatar

Joined: 17 Feb 2006, 15:58
Location: retired
yeah.... and what next, one another lua file... then one another... and so on.


Top
 Offline Profile  
 
PostPosted: 20 Mar 2010, 15:15 
User avatar

Joined: 02 May 2005, 02:56
Location: Canada
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.


Top
 Online Profile  
 
PostPosted: 20 Mar 2010, 15:45 
Map Creator
User avatar

Joined: 17 Feb 2006, 15:58
Location: retired
okay... few lines of code vs few files is as messed up IMO.


Top
 Offline Profile  
 
PostPosted: 20 Mar 2010, 18:53 
Conflict Terra Developer
User avatar

Joined: 21 Jan 2010, 06:21
Location: Tucson
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.


Top
 Offline Profile  
 
PostPosted: 20 Mar 2010, 19:24 
Map Creator
User avatar

Joined: 17 Feb 2006, 15:58
Location: retired
well... theres no cons in making default options really


Top
 Offline Profile  
 
PostPosted: 28 Mar 2010, 06:58 
User avatar

Joined: 29 Apr 2007, 03:25
Location: Cali
Wow, even more improvements.
This is what makes Open Source great: it's always improving.


Top
 Offline Profile  
 
PostPosted: 21 Apr 2010, 21:44 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
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 162 times
Top
 Offline Profile  
 
PostPosted: 22 Apr 2010, 14:39 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
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?


Top
 Offline Profile  
 
PostPosted: 22 Apr 2010, 15:16 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
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?
Image Is it an actual question I'm supposed to answer?


Top
 Offline Profile  
 
PostPosted: 12 May 2010, 16:50 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
"AF fully endorses zwszgs improvements and looks forward to future additions"

*gives zwzsg a cookie*


Top
 Offline Profile  
 
PostPosted: 02 Jun 2010, 20:13 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
Link in first post should be updated to reflect new git directory structure

http://github.com/spring/spring/blob/ma ... _spawn.lua


Top
 Offline Profile  
 
PostPosted: 02 Jun 2010, 20:20 
Spring Developer

Joined: 01 Jun 2005, 10:36
Location: The Netherlands
Thanks, updated.


Top
 Offline Profile  
 
PostPosted: 02 Jun 2010, 21:34 
Blood & Steel Developer
User avatar

Joined: 25 Aug 2004, 12:31
Location: Has not played *a in years.
I'm sorry, I am confused. Where are devs defining what units are the start units with this gadget?


Top
 Offline Profile  
 
PostPosted: 02 Jun 2010, 21:57 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
Spring.GetSideData fetches it from your mod /gamedata/sidedata.tdf


Top
 Offline Profile  
 
PostPosted: 03 Jun 2010, 02:26 
Blood & Steel Developer
User avatar

Joined: 25 Aug 2004, 12:31
Location: Has not played *a in years.
oh neeto


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.