Page 1 of 1

Map Idea - Is this possible?

Posted: 27 Mar 2007, 15:32
by TheFatController
I was wondering since it seems with Speed_Ball and Duck_Fusions and such its possible to add new mod units within the map file, could wrecks of units be added to a map that could be resurrected to create custom units (from the map file).

My immediate idea is an Experimental Scrapyards map for BA4.7 where the theme was all sorts of corpses in a metal world that could be resurrected into unique units such as an Orcone or stuff like 'Flash Tank MkII' that had a different gun and any other crazy stuff. If possible the stuff wouldn't be reclaimable and it would lead to some fun gameplay having people fight over the rights to resurrect the more powerful units.

Posted: 27 Mar 2007, 18:06
by Comp1337
think of the mod imbalances :)

On a serious note tho, you cabt resurrect features that are placed on the map by the mapmaker.
Would be really cool, but alas, it is not meant to be.

Posted: 27 Mar 2007, 18:13
by trepan
LuaGaia can be used to do what you want:

Code: Select all

local featureID = Spring.CreateFeature("name", x, y, z, heading)
Spring.SetFeatureResurrect(featureID, "armcom", facing)
You could also use the map defined features rather then create your own:

Code: Select all

local mapX, mapY = Game.mapX * 512, Game.mapY * 512
for _,fID in ipairs(Spring.GetFeaturesInRectangle(0,0, mapX, mapY)) do
  local fDefID = Spring.GetFeatureDefID(fID)
  local fDef = FeatureDefs[fDefID]
  if (fDef.name == "treetype0") then
    Spring.SetFeatureResurrect(fID, "armmav")
  end
end

resurrecting things on map

Posted: 27 Mar 2007, 18:51
by Daan
Wow +1

This really would rock if this was ahppening not only ppl would start fighting on metal but also resurecting great units. This would also be very usefull in a campain story line where new tecnology could be gained by reserecting nuke facilitys for example

Posted: 30 Mar 2007, 22:03
by manored
Yeah... it could be fun. But it would probaly be even funnier if those units would stay hiden and you had to waste resources in some searching facilities to find em...

Posted: 31 Mar 2007, 00:17
by imbaczek
trepan: what happens when there's no 'armcom' unit defined in the mod? is it possible to make resurrection possible only if a given name actually exists?

Posted: 31 Mar 2007, 00:25
by trepan
Not much happens if there's no "armcom" or "armmav".
The resurrector keeps trying to resurrect a unit that can't
be resurrected.

It's easy to determine if a mod has a particular unit. You
can set up the UnitDefs table to have bidirectional mapping
(the CMD and CMDTYPE tables have the name mapping
already done for you, but not the Defs tables).

Code: Select all

for _,ud in pairs(UnitDefs) do
  UnitDefs[ud.name] = ud
end
Then:

Code: Select all

if (UnitDefs["unitName"]) then ... end

Posted: 01 Apr 2007, 13:36
by NOiZE
So is it also possible to place units on a map now, with script and stuff? To a team which no player can control?