1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Lua Hook Checker

Discussion in 'Civ5 - Utility Programs' started by Civitar, Jan 16, 2016.

  1. Civitar

    Civitar Adventurer

    Joined:
    Mar 23, 2014
    Messages:
    1,507
    Gender:
    Male
    Location:
    Switzerland
    This is just a little Python script you can use to check if a Lua hook you seem to recall hearing about (or just want to exist) actually exists in Civ5, and what expansions it works for.
    Spoiler What it should look like :


    Instructions:
    • Download and extract the .zip file to wherever you normally put your modding files. Make sure to always keep the .csv and .py files together.
    • Double-click on checker.py to run the script. If a Python window doesn't open then download Python and then try again.
    • When prompted, type in the hook you're looking for. If your entry doesn't exactly match an existing hook, you will get a list of hooks containing your entry (meaning you can use this to search for hooks as well).

    To make this I took whoward69's post from the latest patch and made it into a little .csv file which the script reads from. He did all the real work here.:D
    This currently won't give you the arguments you can get from the hook. Also it only works for GameEvent hooks, and not LuaEvents or whatever the other kind of hook was (if there was another kind and I'm not thinking of a different game). Hope this is useful!

    DOWNLOAD HERE
     
  2. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,297
    Location:
    Near Portsmouth, UK
    Events - typically UI related (but there are some processing related ones), generated by parts of the game we don't have the source code for

    GameEvents - game play related, generated by the game core DLL we do have the C++ source for

    LuaEvents - game play and UI related, generated by the game core Lua files so we have the source code
     
  3. Civitar

    Civitar Adventurer

    Joined:
    Mar 23, 2014
    Messages:
    1,507
    Gender:
    Male
    Location:
    Switzerland
    So I could get ahold of LuaEvents, but not Events?

    EDIT: Added a search hooks function to the script. The Python window would now look like this:

    Spoiler :
     
  4. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,297
    Location:
    Near Portsmouth, UK
    LuaEvents are here, there is a list of Events around somewhere, but it's been compiled from SDK docs and searching the .exe for strings so should be treated with caution
     

Share This Page