Mod request

Everything about mods can be found here.

Moderator: Morax

Mod request

Postby Mad`Mozart » 20 Mar 2016, 19:01

Hilarious mod that everyone who heard it wanted it :)

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.
Mad`Mozart
Supreme Commander
 
Posts: 1092
Joined: 10 Mar 2013, 19:09
Has liked: 138 times
Been liked: 431 times

Re: Mod request

Postby Mephi » 20 Mar 2016, 19:57

Yout dont matter to jesus
My YouTube channel: https://www.youtube.com/channel/UCrS9QsyUnTXhhYw3mAjBAeA
Top Level 1v1 POV and Casts
Mephi
Priest
 
Posts: 349
Joined: 13 May 2013, 17:24
Has liked: 22 times
Been liked: 134 times
FAF User Name: Mephi

Re: Mod request

Postby Uveso » 21 Mar 2016, 20:25

Well, i dont have time to make a mod now, but if you add the code to all unit_script.lua by youself, you can make your own mod:

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: Select all
   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.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Mod request

Postby Exotic_Retard » 21 Mar 2016, 21:20

isnt that a sim side solution?

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 :/
User avatar
Exotic_Retard
Contributor
 
Posts: 1470
Joined: 21 Mar 2013, 22:51
Has liked: 557 times
Been liked: 626 times
FAF User Name: Exotic_Retard

Re: Mod request

Postby Uveso » 21 Mar 2016, 23:50

@Exotic_Retard:

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.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Mod request

Postby Uveso » 22 Mar 2016, 00:49

Well it was faster to made the Mod then asking Icedreamer.
This is the new script:

Code: Select all
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.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest