Mod Class and RegisterSlashCommand fix (0.8.2)

johnycilohoklajohnycilohokla Posts: 283 Developer
edited February 2015 in Code
New CommonLib for 0.8.3 download: https://github.com/JohnyCilohokla
Currently the only way to get this functionality is to download CommonLib, I have decided to keep only 1 version and add config options to it(WIP).


Deprecated (0.8.2)
This small mod restores the main mod classes for all of the mods, it includes:
ModScriptClass:Constructor( )
ModScriptClass:Initialize()
ModScriptClass:Enter()
ModScriptClass:Leave()
ModScriptClass:Process(dt)

and it restores the function: Eternus.GameState:RegisterSlashCommand("testcommand", self, "TestCommandFunction")

[strike]Instructions:
1. Download http://tug.ovh/files/CommonLib_mods.zip
2. Extract to Mods folder
3. in TUGConfigmods.txt add as the last entry "Mods/CommonLib_mods"[/strike]
Download link above.

Example:
Mods
{
	"Mods/TestModScript"
	"Game/Survival"
	"Game/Creative"
	"Game/Core"
	"Mods/CommonLib_mods"
}

Please make sure to remove this mod when you are using my mod (SteamPower), CommonLib (core mod for SteamPower) already includes those fixes!
My Blog
jc.png
  yt.png  t.png  

Comments

  • Aha, please bear with me, trying to learn a little from you :D

    So even though ModScriptClass is gone for now adding mods to TUGConfigmods.txt only works as overrides as long as it's last in the load order?

    In other words:
    TUGModsCommonLib_modsScriptsModesTUGGameMode.lua
    overrides
    TUGGameCoreScriptsModesTUGGameMode.lua
    and calls your alternative to ModScriptClass in CL (commonlib)

    Have I understood this correctly?

    Hmm this still means any minor changes by NerdKingdom to TUGGameMode.lua will probably break other unexpected things ?
    Y8KRIoI.png Extra commands with CCommands!
  • johnycilohoklajohnycilohokla Posts: 283 Developer
    edited February 2015
    Cragrim wrote:
    Aha, please bear with me, trying to learn a little from you :D

    So even though ModScriptClass is gone for now adding mods to TUGConfigmods.txt only works as overrides as long as it's last in the load order?

    In other words:
    TUGModsCommonLib_modsScriptsModesTUGGameMode.lua
    overrides
    TUGGameCoreScriptsModesTUGGameMode.lua
    and calls your alternative to ModScriptClass in CL (commonlib)

    Have I understood this correctly?

    Hmm this still means any minor changes by NerdKingdom to TUGGameMode.lua will probably break other unexpected things ?

    Yes, that's how it work, well you can look at it like this it goes through the files from top to bottom and last one wins, or it goes bottom to top until it finds the file.

    While any changes to the TUGGameMode.lua will break other things, it will either be fixed next release(then you can remove this mod) or I will have an updated version on the release day.
    My Blog
    jc.png
      yt.png  t.png  
  • Thank you for taking the time to explain, cheers!
    Y8KRIoI.png Extra commands with CCommands!
  • mercormercor Posts: 64 Seed
    Thanks, this got the ModScriptClass working again.
    Modder in making. Point of Interest mod - Now with GUI

    twitter: @mercorinred
Sign In or Register to comment.