Forged Alliance Forever Forged Alliance Forever Forums 2020-05-20T05:30:16+02:00 /feed.php?f=41&t=19263 2020-05-20T05:29:40+02:00 2020-05-20T05:29:40+02:00 /viewtopic.php?t=19263&p=184297#p184297 <![CDATA[Re: Unique unit]]> DDDX, Perfect!! Works!!!
GREAT THANKS!!!

Statistics: Posted by Mavr390 — 20 May 2020, 05:29


]]>
2020-05-20T01:12:56+02:00 2020-05-20T01:12:56+02:00 /viewtopic.php?t=19263&p=184290#p184290 <![CDATA[Re: Unique unit]]> So that whe it's destroyed,you RemoveBuildRestriction(...)
Check the same mod, unit sxsc1901 for example. Or any turret that the hero from xsl9905 can make, they al work on the same principle

Statistics: Posted by DDDX — 20 May 2020, 01:12


]]>
2020-05-19T05:34:04+02:00 2020-05-19T05:34:04+02:00 /viewtopic.php?t=19263&p=184257#p184257 <![CDATA[Re: Unique unit]]> DDDX, I found an error due to which it did not work.
But your code only removes the unit from the construction list. How to make sure that a unit appears on the ACU construction list after destruction?

Code:
    OnStartBeingBuilt = function(self,builder,layer)   
        TLandUnit.OnStartBeingBuilt(self,builder,layer)
   for i, Army in ListArmies() do
       if (Army == "ARMY_1") then                 
      local army = self:GetArmy();                 
      List = GetArmyBrain(army):GetListOfUnits(categories.COMMAND, false, true)
      for k, unit in List do 
          if (unit:GetUnitId() == 'uel0001') then
         unit:AddBuildRestriction( categories.UNIQUE )
          end
      end
       end
   end
    end,

Statistics: Posted by Mavr390 — 19 May 2020, 05:34


]]>
2020-05-19T00:31:15+02:00 2020-05-19T00:31:15+02:00 /viewtopic.php?t=19263&p=184247#p184247 <![CDATA[Re: Unique unit]]> Statistics: Posted by DDDX — 19 May 2020, 00:31


]]>
2020-05-18T21:48:16+02:00 2020-05-18T21:48:16+02:00 /viewtopic.php?t=19263&p=184243#p184243 <![CDATA[Re: Unique unit]]> DDDX, I tried copy and paste, but there is no effect. Perhaps because I am making a mod for the retail version of the game, that is, not a FAF and not a steam version of the game.

Statistics: Posted by Mavr390 — 18 May 2020, 21:48


]]>
2020-05-17T23:49:42+02:00 2020-05-17T23:49:42+02:00 /viewtopic.php?t=19263&p=184223#p184223 <![CDATA[Re: Unique unit]]> Statistics: Posted by DDDX — 17 May 2020, 23:49


]]>
2020-05-17T13:19:11+02:00 2020-05-17T13:19:11+02:00 /viewtopic.php?t=19263&p=184200#p184200 <![CDATA[Re: Unique unit]]>
DDDX wrote:
OnStartBeingBuilt and OnCreate

How to do using this?

Statistics: Posted by Mavr390 — 17 May 2020, 13:19


]]>
2020-05-17T00:10:54+02:00 2020-05-17T00:10:54+02:00 /viewtopic.php?t=19263&p=184195#p184195 <![CDATA[Re: Unique unit]]> There are a couple of ways to do this

You could do it with the map script, make the map scan through all your units, or just the unique category of that unit (you can put anything in its category list), or you can list the unit by blueprint id. This is more CPU intensive, but works nicely.
Then if it is found, you can add restrictions to building it into your ACU, or whatever. if it's not there, nothing happens life goes on

Another way would be with a mod, to modify that unit's script file so that it kills any specific units that are over a total number (of 1, in your case)
Third way, again through a mod, with that unit's script file, would be to use the units OnStartBeingBuilt and OnCreate functions to immediately restrict further building when you start or when you complete building that unit.

2 things though, if you use OnStartBeingBuilt function, then you need to finish the unit completely, if you stop constructing or if it gets killed before being finished, you will not be able to make another one, or continue constructing that one. That's because SupCom does not even allow you to assist building of units you don't have available for building...
And if you use OnCreate function then nothing prevents you to start making 20 before you finish the 1.st one.
But that can be contered with the script that kills any unit over a total number (of 1). or you could make the build time 1 second, but require to have insane mass and energy in storages in order to build it instantly.

Check my mod called "Survival Mayhem&BO balance".
In it there is a series of hero units that can build limited numbers of improved turrets, and some OP minibosses. For example, check the unit XSL9905, that's a final level (out of 5) Seraphim hero, and check xac1101 or sxslew0001u (both are very OP units, max 1 allowed of either one of the other, you cannot have both). Those 2 are not in the units folder, but in the hook folder, find them there.

And if you have any questions, let me know.

Statistics: Posted by DDDX — 17 May 2020, 00:10


]]>
2020-05-20T05:30:16+02:00 2020-05-16T20:34:44+02:00 /viewtopic.php?t=19263&p=184192#p184192 <![CDATA[[SOLVED] Unique unit]]> Maybe someone knows how to make sure that after the ACU/SCU/engineer builds an experimental unit, he no longer appears on the construction list before he is destroyed?

Statistics: Posted by Mavr390 — 16 May 2020, 20:34


]]>