Raised This Month: $32 Target: $400
 8% 

How to get a map id from workshop?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joao7yt
Senior Member
Join Date: Nov 2014
Location: Brazil
Old 12-17-2017 , 21:51   How to get a map id from workshop?
Reply With Quote #1

So, there's maps that are not inside "map/workshop" folder, so its id can't be obtained using its path, for example Dust 2: http://steamcommunity.com/sharedfile.../?id=125438255

You can see it's the official map on workshop, its id is in its link, but how can I get it using code?

If there was a function, it would be something like this:
Code:
void GetMapId(const char[] map, char[] id, int maxlength)

Parameters
const char[] map
Map name (usually same as map path relative to maps/ dir, excluding .bsp extension).

char[] id
Buffer to store the map's id.

int maxlength
Maximum length of string buffer.

Last edited by joao7yt; 12-17-2017 at 22:04.
joao7yt is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 12-17-2017 , 23:01   Re: How to get a map id from workshop?
Reply With Quote #2

Not that I have a solution for this, but wouldn't an int be a better fit for this function?
__________________
retired
shavit is offline
joao7yt
Senior Member
Join Date: Nov 2014
Location: Brazil
Old 12-17-2017 , 23:23   Re: How to get a map id from workshop?
Reply With Quote #3

Quote:
Originally Posted by shavit View Post
Not that I have a solution for this, but wouldn't an int be a better fit for this function?
I think so, only if there’s 64bit ids, then we would need large int or strings to store them...

Would be something like that:
Code:
int GetMapId(const char[] map)

Parameters
const char[] map
Map name (usually same as map path relative to maps/ dir, excluding .bsp extension).
Then if it outputs -1, means that the map couldn’t be found.

Last edited by joao7yt; 12-17-2017 at 23:23.
joao7yt is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-18-2017 , 01:14   Re: How to get a map id from workshop?
Reply With Quote #4

...but you don't need to install this from the workshop as it's shipped with the game.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
joao7yt
Senior Member
Join Date: Nov 2014
Location: Brazil
Old 12-18-2017 , 01:17   Re: How to get a map id from workshop?
Reply With Quote #5

Quote:
Originally Posted by Powerlord View Post
...but you don't need to install this from the workshop as it's shipped with the game.
I know, I just gave the example of Dust 2 to show that, using its link, it’s possible to get the map id. The problem is that I need to get it in my plugin, so I can use it for other stuff...
joao7yt is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode