Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Strive for Power

Fantasy Slave Management/RPG Erotic Game · By Strive4Power

Code merge problems for mods

A topic by Leonais created Nov 11, 2018 Views: 1,428 Replies: 5
Viewing posts 1 to 5
(1 edit)

I'm having a lot of code merge problems when trying to make my own mod. I'm applying my mod to a fresh install of the game, the source code is merged and compiled, but parts of the mod code are lost or put into the wrong places in the combined file. I can get some simple changes to work, like fixing Chloe to talk to gnomes in the forest, but doing anything more complicated hits these merge problems. Supposedly cosmetic changes to the mod files, such as changing the order functions are defined or putting copies of unchanged functions into the mod file, can change the merge results and fix/cause problems. Code can easily fail to compile, in which case the game does not run properly, the in-game facility to remove mods is lost, so a full delete and reinstall seems to be needed (is that correct?).

I saw in the help thread that the var {} lines may be causing problems on merge and this may be the case with my files as it is very difficult to do something, like add an extra job, without changing these var{} lines. In the advice for modders it suggests using <AddTo> style code to bypass some merge problems, however I'm using a Godot Engine editor to check the code for syntax errors (as a syntax error can cause a compile error and a reinstall of the game) and the <AddTo> will just throw up a syntax error that will hide any others.

Is anyone else finding these problems, have solutions, or can suggest different methods for me to use?

(1 edit)

I`m just don't use mod folder and work straight with game files. Partly bc i have too many changes in different places in files. Trying to separate mod from core gonna be my headache for weeks if not more, So just replace game files, it can solve you problem.

UPD. Also its easier for merging old files with new game version, u can see by yourself what changes new and how they work now. Save a lot of time, really.

Ok thanks I'll look at UPD.

It's true the mod system for godot is flaky. Trail and error will lead to more experience for the best way to mod files (that's how I made my mod).

1. var {} is a dictionary, and it's true, you can't just overwrite it. You have to modify it after the object gets created. Alternatively, you can overwrite the whole function or class where the var is being defined.

2. <addto -1> should add it to the beginning, but actually overwrites the whole function or class a lot of the time. <addto x> will add it to line x. I use addto x most of the time, and it seems to work well enough.

3. I don't use a compiler / code editor, just notepad++. When I break the mod loader, then I have to extract a fresh version of strive, and overwrite all files. It's a pain in the ass, but it's what I know.

It is somehow reassuring to hear that I am not alone with these problems. I will stick to an editor with syntax checking as my typing is clumsy.

I'm now using a GD editor for coding (with syntax checking) and also using notepad++ for its handy file comparion add on. With this I can pick up the merge problems quite quickly but there were still a lot of them moving into this latest version. Lines of code were being lost and changes not put into the combined code. I'm finding that the best way to get the merge to behave is to put an in obvious but cosmetic change (like the order of items in a big var statement) that wakes up the merge function and makes it notice your real changes nearby. I still have to find each failed merge though before I can fix it.