Migrating your mod to Steam Workshop

Updating is working today for me. Nice job.

Since it works like this, why bother making it use getRelativePath?

1 Like

I get happy, and smile when I see the advanced Modders working with the game devs

Too bad I don’t call myself an advanced modder, but a good worshipper instead

If you don’t want to update the description (just like the image), don’t fill in the information (leave the description field blank).

Confirmed: GDT.getRelativePath() doesn’t seem to always return the expected path.

5 Likes

So? Does that mean we won’t use it at all? Return back to the old format?

I don’t think so :slight_smile:
Looking what is wrong, now :wink:

2 Likes

Cool. That almost means that I won’t have to reconvert 30 files in my mod about images.

Can I make a suggestion? If we use an image file we upload to the workshop as a thumbnail, can you make it without the image be renamed to image-thumbnail? I have an image named as img-Thumbnail-Thumbnail-Thumbnail.png, that’s why.

2 Likes

How is the image called that you upload to steam? Image-Thumbnail? If so, the generated image would, obviously, be called Image-Thumbnail-Thumbnail. Or am I missing the point?

2 Likes

Important notice concerning GDT.getRelativePath()

The method GDT.getRelativePath() returns reliable information only outside events and callbacks.
To make sure you always work with the correct path, we suggest that you implement it the following way:

  • In your main module javascript file (i.e. myMod.js), where you use GDT.loadJs(…), add your own path storing variable
  • Throughout your project, simply reference that variable to always obtain the correct path to your mod folder

Example:

var ModName_AuthorName = {};

(function () {
	ModName_AuthorName.modPath = GDT.getRelativePath();

	var ready = function () {
	};

	var error = function () {
	};


	GDT.loadJs(['source/source.js',
	'source/OtherFile.js',
	'source/SubFolder/AnotherFile.js'
	], ready, error);
})();

Through all your module, you can then use the ModName_AuthorName object to access the modPath property (ModName_AuthorName.modPath) and also extend that object at your wish, to implement whatever you might globally need for your mod. .

As an additional hint:
This approach would also allow other mod writers to take reference to other mods and would open new possibility for mods to interact with each other.

Obviously “ModName_AuthorName” should be replaced with your according values;)

3 Likes

Yeah, so that’s causing the Thumbnail, but what if it wasn’t renamed at all?

1 Like

I suppose you fixed it, lol

I did it slightly wrong, fixing the errors now xD

1 Like

Okay.

Where exactly should the images be placed? In the root folder or should they be auto detected?

You should define the images.

There ya go

T

3 Likes

Thanks, useful.

1 Like

xD

1 Like