Thread Rating:
  • 28 Vote(s) - 2.57 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help overriding/hooking main module functions..
#1
So I'm trying to clean up my code to not require files to be replaced, and simply override the functions instead.

I did some reading around the net and this is generally done by hooks as I understand it.
I used the examples:
http://www.wowwiki.com/HOWTO:_Hook_a_Function
http://forums.wowace.com/showthread.php?p=140802

Seems pretty straightforward, hook the original to a local variable, override it with what you want.

So I put my code into a folder, gave it a modules.def with code:
Code:
[Module]
Name=AssistEnhance
Version=1.0
Files=assist_enhance.lua
dependencies=FFXIVMINION
enabled=1

Inside of my assist_enhance.lua, I decided to start small by hooking the UI load and replacing it with my own, since it's the basis of the mod.

So it starts with:
Code:
AssistEnhance = {} -- I don't know if I actually need this since I'm not really using any variables

function AssistEnhance.HandleInit() -- also tried ffxivminion.HandleInit

   d("Initializing modified module..")
   ..do regular stuff with some changes..

end

RegisterEventHandler("Gameloop.Update",AssistEnhance.OnUpdateHandler) -- the normal pulse from the gameloop
--also tried..
--RegisterEventHandler("Module.Initalize",ffxivminion.HandleInit)
RegisterEventHandler("Module.Initalize",AssistEnhance.HandleInit)

The problem I have is that my version never happens, the HandleInit still uses the built-in one in ffxiv.lua inside of the FFXIVMINION module.
I've tried several version of this type of change but nothing happens. I'm still searching around but every place I've seen on the net points to this exact same methodology. Could somebody (mod maybe?) give me a push in the right direction here?


Attached Files
.zip   AssistEnhance.zip (Size: 2.39 KB / Downloads: 9)
Reply
 


Messages In This Thread
Need help overriding/hooking main module functions.. - by Ace - 12-06-2013, 05:39 PM

Forum Jump:


Users browsing this thread: 9 Guest(s)

We help you win the game.

FFXIV Bot and More.

 

Products