Author Topic: How to Modify the Cheats?  (Read 2683 times)

Offline RCIX

  • Core Member Mark II
  • *****
  • Posts: 2,808
  • Avatar credit goes to Spookypatrol on League forum
Re: How to Modify the Cheats?
« Reply #15 on: October 23, 2009, 03:44:53 am »
True, but you could grab LuaInterface or something (very easy to use lua interpreter; literally just make a new Lua object then start using it) and extend it to offer basic game monkeying with functions (add ships, knowledge, resources, and maybe a couple specialized ones), then use a system similar to what altPlanetNames.txt gets to sync the cheats.
It would look something like this i suppose:

Code: [Select]
    Lua lua = new Lua();
    lua.DoFile("cheats.lua");//this file defines a processCheat function
    lua.RegisterFunction("addResources", this, this.GetType().GetMethod("AddResources");
    ...
    public static void AddResources(int player, int metalAmount, int crystalAmount, int knowledgeAmount, int energyAmount)
    {
        //code to add resources here
    }
    ... lua code
    processCheat = function(string)
        if string == "Give Me K" then
            addResources(0, 0, 0, 10000, 0)
        end
    end

Of course subject to implementation details. Not trying to tell you how/what to code or anything but you really have to weigh how much it will cost you to install (something like) LuaInterface versus the accumulated cost of creating the associated code for, keeping up with the requests of, and verifying that player requested cheats work over a couple years. Is it really worth it?
I will, like SO Totally understand if you say yes. ;)
Avid League player and apparently back from the dead!

If we weren't going for your money, you wouldn't have gotten as much value for it!

Oh, wait... *causation loop detonates*