@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.
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
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);
Manual modding gave me headache. Iâm using UME. But it is outdated⌠NOOOOOOOOOO
WOW, I really hope this will get much simpler.
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
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
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?
might be best to enable toolbar then set a breakpoint and see what GDT.getRelativePath() returns
@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
@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'