New to advanced modding

I am wanting to create a mod to add more realism to GDT, but I cant find any of the functions I need to overwrite. I may be getting the deobf code, but I’m still confused at what functions to overwrite. I am currently trying to add outsourcing. I have tried looking at the code to other mods, but those are confusing as well.

Any help would be appreciated, sorry if I’m a noob.

2 Likes

I suggest you read the documentation.

I can also give you a sample mod-code if you want :slight_smile:
(also, if you tried reading the code in @Darkly’s mods, no wonder you’re confused)

I read through that, but it didn’t help me that much. I understand how to overwrite the functions, just not what functions to overwrite. Sample code would be great!

You are talking a decent amount of nonsense.

You dont need to overwrite anything.

“For this reason it’s better to patch the games source code, rather than
changing it directly. You can easily do this by overwriting
objects/methods in the game code. Sometimes you might just want to add a
hook when something happens, in this case you can hijack an original
method like this:” That’s from the wiki for advanced modding.

That is advanced-advanced modding. That means adding menu’s, re-writing functions, etc.

Ok, how would I add out sourcing without adding guis, etc.?

Funfact! HTML works in Discourse.

Anyway. You would have to use divs and have excellent knowledge of JavaScript.

To add outsourcing, I don’t think you’d need to override UI.showContextMenu to add a custom menu item.

For the GUI, take a look at how windows are made in defaultbrowser.html in the main GDT folder (use Ctrl+F!). Then use jQuery to add a window, either the ugly way I did it in GDTMP, or the better way of doing it; like it’s done in Platform Randomiser (or TotalRandomiser for a version with a button).

By the way @Stian @Assossa, I sometimes don’t understand my own code that I wrote a few months or sometimes even a few weeks ago, because of how a mess it is. InfoStatsMod, for instance, is much more structurized :stuck_out_tongue: