Gadget to override box spawning?

Gadget to override box spawning?

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Gadget to override box spawning?

Post 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? :-)
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Gadget to override box spawning?

Post 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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Gadget to override box spawning?

Post 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?
8611z
Posts: 169
Joined: 08 Jul 2015, 20:20

Re: Gadget to override box spawning?

Post 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.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Gadget to override box spawning?

Post 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.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Gadget to override box spawning?

Post 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).
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: Gadget to override box spawning?

Post 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
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Gadget to override box spawning?

Post 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.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Gadget to override box spawning?

Post by Anarchid »

I know this sounds like a broken record but

ZK has something to "override startboxes".
8611z
Posts: 169
Joined: 08 Jul 2015, 20:20

Re: Gadget to override box spawning?

Post by 8611z »

Post Reply

Return to “Help & Bugs”