Migrating your mod to Steam Workshop

@KizzaGaming have you changed the mod inside the mods_ws folder then started the game and updated the mod?
If you did this then I guess your changes got overwritten when starting the game.

@FireChaos do you have some mods in your mods folder as well? (except gdt-modAPI)

1 Like

Deleted them all except that, and fixed the error by unchecking and checking the mods again

I also have one question about the API.

yes

I made this change, still getting the error

1 Like

The same error?

@KizzaGaming Now you forgot the , after ]
GDT.loadJs([’/main/OPPOS.js’] ready, error);
should be ->
GDT.loadJs([’/main/OPPOS.js’], ready, error);

1 Like

Manual modding gave me headache. I’m using UME. But it is outdated… NOOOOOOOOOO

3 Likes

WOW, I really hope this will get much simpler.

@PatrickKlug @alphabit

I might have found a problem regarding the GDT.getRelativePath() function.

When I try to use it (in my case for loading an image in my source file), it doesn’t work at all. But when I change it back to the original hard coded file path, the images are being loaded again.

I tried multiple options like

GDT.getRelativePath() + '/source/img/img.png' (How it should’ve been I believe)
GDT.getRelativePath() + '/ExpansionPack/source/img/img.png'
and other varieties like that, but it didn’t work until I wrote the entire path again.

I think @DzjengisKhan is right. I used the method @PatrickKlug told me, but it can’t find the image.

GDT.getRelativePath() + './mods/modName/folder/image.png'

works.

Hi @DzjengisKhan, can u please send me the related files?
From where do you call / compose the path?

Please note:
GDT.getRelativePath() always returns the relative path from the caller’s point of view.

Example:
The file is /myFolder/mySubFolder/myFile.js
The code is GDT.loadJs(GDT.getRelativePath + ‘myOtherFile.js’)
The path would be: /myFolder/mySubFolder/myOtherFile.js

The file is /myFolder/myFile.js
The code is GDT.loadJs(GDT.getRelativePath + ‘myOtherFile.js’)
The path would be: /myFolder/myOtherFile.js

1 Like

Hey @alphabit,

The problem wasn’t in the GDT.loadJs function, but when I try to use GDT.getRelativePath to load an image for a console for instance. And I did it the same way as you just did. My folder structure is ExpansionPack/source/image/image.png
So I tried GDT.getRelativePath() + '/image.png' but this didn’t work. And that’s when I started trying multiple options.

I will send you the files either way, but I believe what I did in the first place should’ve worked right?

EDIT: When I tried running my mod this morning the images stopped working again. Maybe due to a new update? I will try using GDT.getRelativePath() again and see if it works now :smiley:

1 Like

assuming your code runs in ExpansionPack/source/ it should probably be

GDT.getRelativePath() + 'image/image.png'

I just tried to use GDT.getRelativePath() + 'image/image.png' but the image still doesn’t load.

I already sent the files to @alphabit, hopefully he can see what the problem is.
Or would it help if I post some screenshots of my folder structure/code?

1 Like

might be best to enable toolbar then set a breakpoint and see what GDT.getRelativePath() returns

1 Like

@DzjengisKhan I noticed that your description is cut off:

http://steamcommunity.com/sharedfiles/filedetails/?id=296912855

Is this something that happened during upload from GDT? Can you edit it on the Workshop website?

I also noticed it was cut off yesterday but I believe it happened when I updated my mod in the mod panel.
Then I edited it on the workshop website but apparently it changed it back when I updated my mod today again.

EDIT:

I’ll do this and see what I get :smiley:

1 Like

@alphabit this shouldn’t happen. We can’t override the description from the package.json as the website description should be much more complete.

When I set a breakpiont all I get back is the 'img/img.png'

from the line GDT.getRelativePath() + 'image/img.png'

1 Like