resurrectable corpses

resurrectable corpses

Discuss maps & map creation - from concept to execution to the ever elusive release.

Moderator: Moderators

Post Reply
User avatar
dcore221
Posts: 110
Joined: 09 Jul 2010, 19:53

resurrectable corpses

Post by dcore221 »

is it possible to add resurrectable wreckages to maps?
yanom
Posts: 323
Joined: 10 Jul 2009, 23:34

Re: resurrectable corpses

Post by yanom »

I doubt it, because maps must be used with many mods. For example, If i put a wreck of a mod-specific unit like CA's Meteor Controler, then tried to rez the unit while playing BA, it would crash.
User avatar
dcore221
Posts: 110
Joined: 09 Jul 2010, 19:53

Re: resurrectable corpses

Post by dcore221 »

what about mod specific maps? i want it to work with balanced annihilation,
is this possible?
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: resurrectable corpses

Post by SirMaverick »

You can do it with Lua (gadget):

Code: Select all

local fid = Spring.CreateFeature("armstump_dead", 100, 100, 100)
Spring.SetFeatureResurrect(fid, "armstump")
Just tested, it won't work without SetFeatureResurrect even if feature is resurrectable (feature def).
For details see: http://springrts.com/wiki/Lua_SyncedCtr ... e_Handling
User avatar
dcore221
Posts: 110
Joined: 09 Jul 2010, 19:53

Re: resurrectable corpses

Post by dcore221 »

Thanks :-)
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: resurrectable corpses

Post by Jazcash »

A map with Krog wrecks everywhere would be lolz. First person to rez them wins!
User avatar
JohannesH
Posts: 1793
Joined: 07 Apr 2009, 12:43

Re: resurrectable corpses

Post by JohannesH »

Jazcash wrote:A map with Krog wrecks everywhere would be lolz. First person to rez them wins!
Id just reclaim them...
User avatar
dcore221
Posts: 110
Joined: 09 Jul 2010, 19:53

Re: resurrectable corpses

Post by dcore221 »

the xyz can it be set to random instead of choosing position?
SeanHeron
Engines Of War Developer
Posts: 614
Joined: 09 Jun 2005, 23:39

Re: resurrectable corpses

Post by SeanHeron »

Basiclly yes, but it'll require a little code (relatively simple), rather than being able to use a setting "random". You'll need the map widths and then use math.random(0,widthyouwant), I think. I'd post if I had a little more time.
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: resurrectable corpses

Post by Google_Frog »

You can include units in maps so you could make a rezzable corpse that technically works with any game. I wouldn't recommend this as the unit would not be balanced for any game.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: resurrectable corpses

Post by lurker »

I would advise against making the feature via lua and causing a dependency on BA. Just check if the UnitDef exists, and if so run SetFeatureResurrect. Assuming that doesn't hit a bug, you'll have a normal map for most games, and something you can rez wherever it makes sense.

If you want a randomized location, then I would suggest you include a map_armstump_dead so it still works outside of BA.
User avatar
dcore221
Posts: 110
Joined: 09 Jul 2010, 19:53

Re: resurrectable corpses

Post by dcore221 »

what about if i didt know the map size could random placement still work?
im using this code for a mod im making
at the minute i have resurrectable wreckages in all 4 corners on anymap but id prefer it to be random placement if possible, can this be done without knowing the map dimensions?
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: resurrectable corpses

Post by CarRepairer »

dcore221 wrote:what about if i didt know the map size could random placement still work?
im using this code for a mod im making
at the minute i have resurrectable wreckages in all 4 corners on anymap but id prefer it to be random placement if possible, can this be done without knowing the map dimensions?
If you're doing this for a mod, just put the code in your mod rather than each map.

You can find the map size easily in the gadget by using Game.mapSizeX, Game.mapSizeZ.
User avatar
dcore221
Posts: 110
Joined: 09 Jul 2010, 19:53

Re: resurrectable corpses

Post by dcore221 »

this is what i got so far
LuaRules\Gadgets\rez.lua

Code: Select all

local fid = Spring.CreateFeature("armstump_DEAD", 0, 900, 0)
Spring.SetFeatureResurrect(fid, "armstump")

local fid = Spring.CreateFeature("armstump_DEAD", 0, 900, 100000)
Spring.SetFeatureResurrect(fid, "armstump")

local fid = Spring.CreateFeature("armstump_DEAD", 100000, 900, 0)
Spring.SetFeatureResurrect(fid, "armstump")

local fid = Spring.CreateFeature("armstump_DEAD", 100000, 900, 100000)
Spring.SetFeatureResurrect(fid, "armstump")
will put a stumpy in all corners unless the map is bigger than 100000
what do i need to add to make it random placement?
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Re: resurrectable corpses

Post by oksnoop2 »

Code: Select all

if frame % (30 * meteorInterval) == 0 then 
    -- pick a random location as the meteor spawn point
    local meteorSpawnX = math.random(Game.mapSizeX)
    local meteorSpawnZ = math.random(Game.mapSizeZ)
    local meteorSpawnY = Spring.GetGroundHeight(meteorSpawnX, meteorSpawnZ) + meteorSpawnHeight
maybe something like this can be used? I don't know.
Post Reply

Return to “Map Creation”