If not, any chance someone would make it a reality?
Gadget to override box spawning?
Moderator: Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Gadget to override box spawning?
Does a gadget exist that would override the box spawning method used by autohosts and instead force spawning at map start coordinates set in mapinfo.lua?
If not, any chance someone would make it a reality?
If not, any chance someone would make it a reality?
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Gadget to override box spawning?
All spawning is already done by a gadget. Just fish the gadget out of basecontent, VFS.Include mapinfo.lua if it exists, and read off from the table.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Gadget to override box spawning?
After I made this post I was thinking about it for a bit and thought about game_spawn.lua. I assume that's where you're talking about doing it from.
https://github.com/EvolutionRTS/Evoluti ... wn.lua#L70
This is the relevant section, but I don't really know how to tell it to read the values from there and translate them here. Additionally, would doing it this way nullify the selecting your start position phase?
https://github.com/EvolutionRTS/Evoluti ... wn.lua#L70
This is the relevant section, but I don't really know how to tell it to read the values from there and translate them here. Additionally, would doing it this way nullify the selecting your start position phase?
Re: Gadget to override box spawning?
To access the value associated with the key in a table you can use the table[key] syntax.
http://lua-users.org/wiki/TablesTutorial
https://springrts.com/wiki/Mapdev:mapinfo.lua#teams
The values are already in the correct coordinates system, no need to translate them.
Nullifying the selecting your start position phase iirc can be done with returning true from GameSetup() callin. Or by not using startboxes/chose-ingame mode.
http://lua-users.org/wiki/TablesTutorial
https://springrts.com/wiki/Mapdev:mapinfo.lua#teams
The values are already in the correct coordinates system, no need to translate them.
Nullifying the selecting your start position phase iirc can be done with returning true from GameSetup() callin. Or by not using startboxes/chose-ingame mode.
Re: Gadget to override box spawning?
I wish autohosts would support being configured to use fixed and random start pos, and lobby to use a default StartPosType set in an EngineOptions.lua, instead of every level ignoring what the other levels want and force override their own immutable value.
Re: Gadget to override box spawning?
Spads supports 3 startbox types: random, fixed and choose in game. Did you say you want something else?
Like said before, that gadget only handles the spawning, it doesnt override the startboxes and what they players are presented there. But iirc, if you return true, true from the gamesetup callin, it removes the ready button (that would be the second argument that does that).
Like said before, that gadget only handles the spawning, it doesnt override the startboxes and what they players are presented there. But iirc, if you return true, true from the gamesetup callin, it removes the ready button (that would be the second argument that does that).
Re: Gadget to override box spawning?
+9001zwzsg wrote:I wish autohosts would support being configured to use fixed and random start pos, and lobby to use a default StartPosType set in an EngineOptions.lua, instead of every level ignoring what the other levels want and force override their own immutable value.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Gadget to override box spawning?
Well, you're right. I should do this in the short run, but honestly, I kind of want to set up a sc2 style start location system. Reading from mapinfo is a good start, and I figured I'd give it a go when I got home after this weekend from what knorke posted.Jools wrote:Spads supports 3 startbox types: random, fixed and choose in game. Did you say you want something else?
Like said before, that gadget only handles the spawning, it doesnt override the startboxes and what they players are presented there. But iirc, if you return true, true from the gamesetup callin, it removes the ready button (that would be the second argument that does that).
So to answer your question, yes that is what I want, but I want to take it a wee bit further. That said, when I think about it, would it be better to shoehorn it into the current system? I'm trying a very focused approach to evo which involves maps only made for it, and all teamgames being archon mode style (commsharing), except I want to spawn a new comm unit for every teammate at the same location as the start (offset by a little bit). So this start situation kind of plays into the whole grand scheme of things.
Re: Gadget to override box spawning?
the trick to override spring's startposition systems is to not use the functions at https://springrts.com/wiki/Lua_SyncedRe ... tPositions
short example:
https://code.google.com/p/springtanks/s ... awn.lua#80
https://code.google.com/p/springtanks/s ... artpos.lua
short example:
https://code.google.com/p/springtanks/s ... awn.lua#80
https://code.google.com/p/springtanks/s ... artpos.lua
