St0l3n_ID Posted February 6, 2022 Share Posted February 6, 2022 Hey there, I'm considering to start my own little mod, i already have some concepts and did implement some stuff already, but i'm having trouble finding a comprehensive list of global vars and their purpose. I saw in some of the updates the moddablitiy of the game got enhanced by providing a variable here and there but it would be extremly helpful to know what hooks are actually intented for modding and what should be left alone etc. Atm im hooking into the progression of 2 characters to create new card packs but its really backwards from a scripting point (load every milestone seperatly and then add mine in the end) Just wondering there is a document somehwere that describes the most important hooks and vars. Greez, Stolen Link to comment Share on other sites More sharing options...
Newbiespud Posted February 6, 2022 Share Posted February 6, 2022 Not a whole lot of documentation, I'm afraid. Those of us who've been sticking with it have mostly been figuring it out on our own or conferring with each other on the unofficial Griftlands Discord. Generally, the most important functions that add content to the game are in, well, the Content functions. (data_scripts.zip/scripts/content/content.lua) Content is the master table of all preloaded moddable game content, and its constituent functions are how you load in most new things into the game on launch. Content.AddBattleCard(), Content.AddNegotiationModifier(), Content.AddDeck()... There's a small handful of global floating functions like AddPlayerCharacter(), but for the most part Content is where the rubber meets the road in terms of loading new game data like cards and mechanics and unlocks. The main exception to this is quests, which does not require the modder to call any Content functions, but instead just deal each new quest's QuestDef (data_scripts.zip/scripts/quest_def.lua), which in the process of Define{}-ing itself adds itself to Content. Currently, the best method of learning what the most important methods are is to look up the base game's Lua scripts and other mods' Lua scripts and learn by example based on what you're looking to do. But there's a couple of us with lots of experience with the engine by now and still active, so don't be afraid to ask. Link to comment Share on other sites More sharing options...
St0l3n_ID Posted February 6, 2022 Author Share Posted February 6, 2022 Thanks for the reply! Right now im looking for a way to implement a new "attribute" to cards similar to XP, but as far as i can tell it will require a lot of modification to stuff thats not easily modifyable or patch proof Link to comment Share on other sites More sharing options...
RageLeague Posted February 7, 2022 Share Posted February 7, 2022 A good starting point is unpack the game script somewhere on your computer. Then, you can easily reference different methods and their implementations using vs code or some other code search tools. Also, depending on what you do, some methods can be patched by the mod while ensuring maximum compatibility using a technique in lua. Basically, you can assign the old function in a local variable, and replace that method with a new method that calls the old function (by the local variable), but also do some side effects or modifications before or after calling the old function. I use this technique a lot in my mods. Link to comment Share on other sites More sharing options...
Newbiespud Posted February 7, 2022 Share Posted February 7, 2022 If you're looking to modify existing cards, Content.GetBattleCard() and Content.GetNegotiationCard() are what you're looking for. There's even Content.GetAllBattleCards() and Content.GetAllNegotiationCards(). We probably can't do anything to add, like, a second visual track to the card graphics, but you might be able to append tracked attributes to the descriptions of cards. Like RageLeague says above, it's possible to non-destructively modify existing functions in Lua so that your changes are somewhat patch-proof. Link to comment Share on other sites More sharing options...
St0l3n_ID Posted February 8, 2022 Author Share Posted February 8, 2022 Alright that should keep me going i guess, thx so far! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.