Forged Alliance Forever Forged Alliance Forever Forums 2013-04-07T21:41:47+02:00 /feed.php?f=53&t=3577 2013-04-07T21:41:47+02:00 2013-04-07T21:41:47+02:00 /viewtopic.php?t=3577&p=37325#p37325 <![CDATA[Re: Making certain units buildable underwater in your map]]> I've been looking all over the place for a way to do this, but I can't find the precise thing I want to do that I think is possible, but I really can't find how. What I want to do is force the game to hook a lua file, so that I could just supply the map with the mod and it would automatically hook that mod.

Now, if no one knows a way to do that, the second best thing would be to dynamically adjust the blueprints on mapstart. I have found a function in the LUADOC called Sim:GetBlueprint(entity), but I'm not sure what I have to import to have acces to that function, how I need to supply the argument and what it returns and if I modify what it returns if that is automatically reflected in the game, because there doesn't seem to be a SetBlueprint function.

This has to be doable, I just have no idea where to look.

Statistics: Posted by johnie102 — 07 Apr 2013, 21:41


]]>
2013-04-07T19:12:46+02:00 2013-04-07T19:12:46+02:00 /viewtopic.php?t=3577&p=37305#p37305 <![CDATA[Re: Making certain units buildable underwater in your map]]>
I would recommend to use the mod.With more I can't help you.

Statistics: Posted by Prince__ — 07 Apr 2013, 19:12


]]>
2013-04-07T15:38:30+02:00 2013-04-07T15:38:30+02:00 /viewtopic.php?t=3577&p=37270#p37270 <![CDATA[Making certain units buildable underwater in your map]]>
I would like my map to have t1 powergens buildable underwater. Now I found a mod that makes every building buildable under water:
Code:
do
local OldModBlueprints = ModBlueprints
function ModBlueprints(all_bps)
   OldModBlueprints(all_bps)
   for id,bp in all_bps.Unit do
      if table.find(bp.Categories, "INDIRECTFIRE") then
      elseif table.find(bp.Categories, "DIRECTFIRE") then
      elseif table.find(bp.Categories, "FACTORY") then   
      elseif table.find(bp.Categories, "ANTIAIR") then   
      elseif table.find(bp.Categories, "ANTINAVY") then
      elseif table.find(bp.Categories, "INTELLIGENCE") then
      elseif table.find(bp.Categories, "ANTIMISSILE") then
         if table.find(bp.Categories, "SILO") then
            bp.Physics.BuildOnLayerCaps.LAYER_Seabed = true
            if bp.Wreckage then
               bp.Wreckage.WreckageLayers.Seabed = true
            end
         end
      elseif table.find(bp.Categories, "ANTIMISSILE") then
      elseif table.find(bp.Categories, "AIRSTAGINGPLATFORM") then
      elseif table.find(bp.Categories, "STRUCTURE") then
         bp.Physics.BuildOnLayerCaps.LAYER_Seabed = true
         if bp.Wreckage then
            bp.Wreckage.WreckageLayers.Seabed = true
         end
      end
   end
end
end

This would then be in mods/<modname>/hook/lua/system/Blueprints.lua
My question is, how could I do something similar, but integrated in the map, so no mod needs to be activated. I guess I would have to import something to my map_name_script.lua, but I don't have a clue what. Is it even possible to change unit blueprints at map start?

Statistics: Posted by johnie102 — 07 Apr 2013, 15:38


]]>