A way to make a function which checks if the user uses the workshop version of a mod

So, you have two versions of your mod. The one that goes in the mods folder, and the other which is downloaded from the workshop. Can I make a function which checks if the user uses the workshop version?

Thanks in advance.

2 Likes

You could assign a different URL for the workshop version as to the standalone version in the package.json, and then check it using mod.url

1 Like

Change the ID to “workshop”.

I still don’t get it. I don’t want to make 2 seperate instances of the mod.

1 Like

An instance is a running mod. Do you want your mod running twice at the same time? That wouldn’t work.

1 Like

I meant two different mod versiosns. One for the ‘mods’ and a steam workshop one. I want to avoid that

Exactly why do you need to know if the mod is running on workshop or not? You wont be able too, unless you create an additional script in the workshop version adding “isWorkshop = true” to your global mod object.

1 Like

I would like to check if a player uses the workshop version. If yes, then it will show a message, so the player knows the mod is updated for example.

The user isn’t an idiot. I doubt that is necessary. If you want to check for workshop, use two versions. (just one extra script, simple)

1 Like

You could check if the parent folder of the mod mods_ws is. Might be the easiest way of doing it

2 Likes

No. Some people don’t know about that version. Making 2 versions would be time wasting, since I update the mod when needed. It will be a double waste for a bug to be fixed, just to change the changelog, rar them both up, introduce new versions for both, upload each to here and workshop, just for the next week to push another update. If you can tell me a way, good.

@DzjengisKhan. That’s nice. I’m wondering how to do that though. Hmm.

Maybe by using something named a search engine? :open_mouth: lol, I think theres a “find folder” function in JavaScript. OR! Use GDT.getRelativePath() and check it for containing “mods-ws”

1 Like

What about “mods_ws”?
How could you not think of that, even I did :stuck_out_tongue:

EDIT: Oh wait, @DzjengisKhan said that already.

2 Likes