Forged Alliance Forever Forged Alliance Forever Forums 2016-03-22T00:49:16+02:00 /feed.php?f=41&t=12049 2016-03-22T00:49:16+02:00 2016-03-22T00:49:16+02:00 /viewtopic.php?t=12049&p=123335#p123335 <![CDATA[Re: Mod request]]> This is the new script:

Code:
local oldUnit=Unit
Unit = Class(oldUnit) {
   OnLayerChange = function(self, new, old)
      oldUnit.OnLayerChange(self, new, old)
      if not EntityCategoryContains(categories.SUBCOMMANDER + categories.COMMAND, self) then
         if new == 'Water' and old == 'Land' then
            self:SetCustomName( 'Jesus' )
         elseif new == 'Seabed' and old == 'Land' then
            self:SetCustomName( 'Moses' )
         elseif new == 'Land' and (old == 'Water' or old == 'Seabed') then
            self:SetCustomName( '' )
         end
      end
   end,
}


And here is the downloadable mod:
http://faforever.uveso.de/HilariousMadMozart.rar

Extract the Rar and copy the folder HilariousMadMozart to your Modfolder.

Its now using the Unit.lua with a nondestructive hook.

It also filters commander and subcommander.

greetings Uveso.

Statistics: Posted by Uveso — 22 Mar 2016, 00:49


]]>
2016-03-21T23:50:10+02:00 2016-03-21T23:50:10+02:00 /viewtopic.php?t=12049&p=123327#p123327 <![CDATA[Re: Mod request]]>
you are absolutly right. My first try was to hook the unit Class inside Unit.lua.

But BlackOps is also using the hook for all the cloak stuff. And i dont want to destroy Black Ops with it.

Maybe we can include the code in the official Version of BlackOps.

If i see IceDramer next time, i will ask him.

Statistics: Posted by Uveso — 21 Mar 2016, 23:50


]]>
2016-03-21T21:20:00+02:00 2016-03-21T21:20:00+02:00 /viewtopic.php?t=12049&p=123307#p123307 <![CDATA[Re: Mod request]]>
i mean that would work if you hook it into unit.lua or default_units.lua

but i kinda thought it would be better if it was a ui mod :/

Statistics: Posted by Exotic_Retard — 21 Mar 2016, 21:20


]]>
2016-03-21T20:25:23+02:00 2016-03-21T20:25:23+02:00 /viewtopic.php?t=12049&p=123295#p123295 <![CDATA[Re: Mod request]]>
If the Unit Changes the layer from land to water it will be renamed to Jesus, and will delete the name if it's returned to Land.
Same with Underwater (seabed) and Moses.

Code:
   OnLayerChange = function(self, new, old)
      TConstructionUnit.OnLayerChange(self, new, old)
      if new == 'Water' and old == 'Land' then
         self:SetCustomName( 'Jesus' )
      elseif new == 'Seabed' and old == 'Land' then
         self:SetCustomName( 'Moses' )
      elseif new == 'Land' and (old == 'Water' or old == 'Seabed') then
         self:SetCustomName( '' )
      end
   end,


greetings, Uveso.

Ps: Script is tested and working.

Statistics: Posted by Uveso — 21 Mar 2016, 20:25


]]>
2016-03-20T19:57:51+02:00 2016-03-20T19:57:51+02:00 /viewtopic.php?t=12049&p=123238#p123238 <![CDATA[Re: Mod request]]> Statistics: Posted by Mephi — 20 Mar 2016, 19:57


]]>
2016-03-20T19:01:38+02:00 2016-03-20T19:01:38+02:00 /viewtopic.php?t=12049&p=123233#p123233 <![CDATA[Mod request]]>

Every hover unit that moves on water is renamed to "Jesus". Name is taken away when it moves on land again.
Same for every amphibious unit that moves underwater (except ACU, SACU and maybe t4) is renamed to "Moses". Name is taken away when it moves on land again.

Anyone who can make it happen will earn tons of fake internet fame points.

Statistics: Posted by Mad`Mozart — 20 Mar 2016, 19:01


]]>