Page 1 of 1

Gadget to override box spawning?

Posted: 21 Jan 2016, 22:12
by Forboding Angel
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? :-)

Re: Gadget to override box spawning?

Posted: 21 Jan 2016, 22:21
by Silentwings
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.

Re: Gadget to override box spawning?

Posted: 22 Jan 2016, 01:15
by Forboding Angel
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?

Re: Gadget to override box spawning?

Posted: 22 Jan 2016, 19:35
by 8611z
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.

Re: Gadget to override box spawning?

Posted: 22 Jan 2016, 20:21
by zwzsg
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?

Posted: 22 Jan 2016, 20:30
by Jools
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).

Re: Gadget to override box spawning?

Posted: 22 Jan 2016, 20:48
by FLOZi
zwzsg 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.
+9001

Re: Gadget to override box spawning?

Posted: 23 Jan 2016, 00:16
by Forboding Angel
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).
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.

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?

Posted: 23 Jan 2016, 22:14
by Anarchid
I know this sounds like a broken record but

ZK has something to "override startboxes".

Re: Gadget to override box spawning?

Posted: 24 Jan 2016, 00:00
by 8611z