Nooby question but what do you mean by define?
Well, are you a modder?
What should i be changing here?
Infa.addPlatformA = function () {
var icon = './mods/InfaMod_v1.0.0/Consoles/img/A.png';
GDT.addPlatform(
If you follow the recommendations written above, you would use:
var InfaMod_MrDewDew = {};
(function () {
InfaMod_MrDewDew.modPath = GDT.getRelativePath();
var ready = function () {
};
var error = function () {
};
GDT.loadJs(['source/source.js',
'source/OtherFile.js',
'source/SubFolder/AnotherFile.js'
], ready, error);
})();
And then in your implementation:
Infa.addPlatformA = function () {
var icon = InfaMod_MrDewDew.modPath + '/Consoles/img/A.png';
GDT.addPlatform(
alphabit got me. He ninjaâd me.
Question, do we have to make it like this? var exGDT_FireChaos and not jsut exGDT?
Basically it doesnât matter BUT, we recommend a certain way to do it, in order to make it easier for all to:
- distinguish this variables and try to make as much as possible sure that there are no name collisions
- allow other mod-writers to use this convention for accessing other modâs feature (for interaction between mods)
So my recommendation would be (especially to make support easier) to use the proposed convention.
Also, @alphabit Iâm having problems getting my platform images done. Itâs annoying. I tried to fix it many times but it doesnât work.
What exactly is your problem? Any chances I can take a look at your mod?
Well, we can use jsfiddle, (an online collaboration site, built for JS, also has chat etc.Join here: http://jsfiddle.net/#&togetherjs=ENAerFGTaJ ), or i can send you the file, or I can paste it here (I donât prefer the 3rd option.
Problem: Images missing.
Letâs fiddle
Important Note about modding with and without Steam Workshop
Just to avoid some confusion:
The changes described in this topic are necessary to allow your mod to correctly work with Steam Workshop.
BUT your mods will work after all these changes also when installed manually (like you always did in the /mods/ folder).
Path acquisition is dynamic (when used as we recommended), so it doesnât matter if your mod has been downloaded from Workshop or has been installed manually.
When you develop your mods, you would do that like you did before, with the differences / changes discussed here.
Hope this clarifies some confusion.
Of some reason I dont seem to get any image. I am sure the image is in the location it should return.
Doesnât work:
var buntuIcon = GDT.getRelativePath() + "/img/buntu.png";
Doesnât work:
var buntuIcon = GDT.getRelativePath() + "img/buntu.png";
This should work. I donât know if it makes a difference, put it like this.
var buntuIcon = GDT.getRelativePath() + 'img/buntu.png'
This is how you call the image.
In your file which loads the modâs jsâs in the same folder as package.json is, that file which package.json sais to load, did you define this?
Part of the code.
var buntuIcon = {};
(function () {Â Â Â
   buntuIcon.modPath = GDT.getRelativePath();
you should keep a copy of what GDT.getRelativePath() returns at the start of your mod and then use this value to build your paths. Donât call GDT.getRelativePath() every time you need the value as it will not reliably return the correct value.
Have a look at the example in the original post.
That was the exact same as I explained.
@PatrickKlug could you please explain in detail, I didnt understand. I tried it, but my mod couldnt recognize the variable declared in my maim file.
Thank you
Did you fix it? What was the problem?