Raised This Month: $ Target: $400
 0% 

[TF2] Stop that Tank!


Post New Thread Reply   
 
Thread Tools Display Modes
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 08-21-2015 , 21:03   Re: [TF2] Stop that Tank!
Reply With Quote #41

The workshop is shit anyway (no documentation on how it works), so I'm probably going to do exactly that: Put the maps in tf/maps and in fastdl.

For the record: to load a workshop map, use "changelevel workshop/<mapid>". I have no idea what GetCurrentMap() returns when called. Maybe just do a "if (StrContains(MapName, "pl_") != -1)" somewhere?

PHP Code:
bool Mod_CanBeLoaded()
{
    
// Make a decision on whether the Stop that Tank! is enabled or not.
    // 1. tank_enabled must be set to 1. If it is then it will check the map prefix..
    // 2. The map must have one of the following prefixes: pl_, plr_, stt_.
    // If both of these things are satisfied, then STT will attempt to run.
    
if(GetConVarBool(g_hCvarEnabled))
    {
        
char map[32];
        
GetCurrentMap(mapsizeof(map));
        if(
strncmp(map"pl_"3false) == || strncmp(map"plr_"4false) == || strncmp(map"stt_"4false) == 0)
        {
            return 
true;
        }
    }

    return 
false;

Why? What's wrong with a mere StrContains() call using "pl_"? Is there a reason why you use strncmp?

Or if it's because of stuff like "mvm_mapl_a3" getting caught in the crossfire, possibly do an ExplodeString() and check if one of those strings is equal to "pl"?

In other words, this needs a better way to detect pl/plr/stt maps, especially to support the steam workshop.

But then again I could be talking right out of my ass and workshop maps don't work directly from the workshop; I dunno.

Also, holy shit - so many handles are used.

Last edited by Potato Uno; 08-21-2015 at 21:11.
Potato Uno is offline
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 08-21-2015 , 22:18   Re: [TF2] Stop that Tank!
Reply With Quote #42

Quote:
Originally Posted by Potato Uno View Post
For the record: to load a workshop map, use "changelevel workshop/<mapid>". I have no idea what GetCurrentMap() returns when called. Maybe just do a "if (StrContains(MapName, "pl_") != -1)" somewhere?
If I'm not mistaken, it simply checks the currently loaded map, it might do string checks against the map folder, not sure

And how exactly does "changelevel workshop/<mapid>" work? Workshop maps are not contained inside tf, they appear in steamapps/workshop/content/440, unless Valve was actually smart this time
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is offline
ShinyRazu
Member
Join Date: Feb 2014
Old 08-22-2015 , 12:49   Re: [TF2] Stop that Tank!
Reply With Quote #43

I'm surprised it took so long for this to get released - I almost doubted it'd ever happen. But it looks like you've done a good job with it and I can't wait to try it out on my servers. Thanks.
ShinyRazu is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 08-22-2015 , 15:33   Re: [TF2] Stop that Tank!
Reply With Quote #44

Quote:
Originally Posted by xXDeathreusXx View Post
If I'm not mistaken, it simply checks the currently loaded map, it might do string checks against the map folder, not sure

And how exactly does "changelevel workshop/<mapid>" work? Workshop maps are not contained inside tf, they appear in steamapps/workshop/content/440, unless Valve was actually smart this time
They are not in /tf/, but if you begin a map name with "workshop/" the server seems to peek into the steamapps' workshop folder. The map ID (found on the url of the map page on the steam workshop) dictates which map to load.

So for this map: http://steamcommunity.com/sharedfile...44&searchtext= the map ID is 454195144. To add the map to your server, run "tf_workshop_map_sync 454195144". To load the map, run "changelevel workshop/454195144".

EDIT: I tested it on pl_snowycoast (by E-Arkham) and pl_rust (by Freyja) and STT seems to be working really well on them. I am impressed.

Last edited by Potato Uno; 08-22-2015 at 15:40.
Potato Uno is offline
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 08-22-2015 , 17:28   Re: [TF2] Stop that Tank!
Reply With Quote #45

Quote:
Originally Posted by Potato Uno View Post
They are not in /tf/, but if you begin a map name with "workshop/" the server seems to peek into the steamapps' workshop folder. The map ID (found on the url of the map page on the steam workshop) dictates which map to load.

So for this map: http://steamcommunity.com/sharedfile...44&searchtext= the map ID is 454195144. To add the map to your server, run "tf_workshop_map_sync 454195144". To load the map, run "changelevel workshop/454195144".

EDIT: I tested it on pl_snowycoast (by E-Arkham) and pl_rust (by Freyja) and STT seems to be working really well on them. I am impressed.
I just put the map onto the server normally and call it by name, even in TF2
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it

Last edited by xXDeathreusXx; 08-22-2015 at 17:28.
xXDeathreusXx is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 08-22-2015 , 17:43   Re: [TF2] Stop that Tank!
Reply With Quote #46

Quote:
Originally Posted by xXDeathreusXx View Post
I just put the map onto the server normally and call it by name, even in TF2
I do that for MvM because it has some dependencies like nav and pop files. However, for pvp maps, it's best to do it the workshop way because then the clients will automatically download the map from the steam workshop rather than from your fastdl. Plus, I also am not sure if you will introduce bugs with map names since now workshop maps can be edited without bumping the version number and automatically have clients download the latest update (whereas in the normal way the server will reject a client for a differing map).

But again I have no idea how the hell the workshop works. This is namely Ross' (Powerlord's) expertise, not mine. Although TF2Maps encourages mappers to bump their version number on every edit even on the workshop, the fact that mappers don't have to obey it makes things.... more tricky....

Currently for STT I'm also putting them in /tf/maps even though it may cause problems when mappers update their maps. I'm hoping linux_lover can possibly fix the payload map detection code so that it won't erroneously disable itself on workshop pl/plr maps.

Last edited by Potato Uno; 08-22-2015 at 17:45.
Potato Uno is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 08-23-2015 , 04:35   Re: [TF2] Stop that Tank!
Reply With Quote #47

Turns out someone (read: me) already wrote a TF2 Map Workshop for server owners steam guide.

Now... having said that, for workshop maps, GetCurrentMap will return a map name that looks like this:

workshop/cp_glassworks_rc6a.ugc454118349

SourceMod 1.7.3/1.8's FindMap can be used to resolve tracked maps to this style name as well.

However, there's just one catch: Valve's "Improved handling of workshop maps in a server's map cycle" from the Passtime update was supposed to automatically add workshop maps in the mapcycle to the tracked maps list.

Unfortunately, that doesn't actually work. I was told it was because I was using +mapcyclefile to change which file was in use, but even not using that didn't fix the issue. Supposedly it will be fixed in the next update.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 08-23-2015 at 04:39. Reason: 1.7.3 also has FindMap now
Powerlord is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 09-09-2015 , 19:36   Re: [TF2] Stop that Tank!
Reply With Quote #48

Major update released v1.4. It addresses most of your concerns so thanks for the feedback. See complete list of changes and download on Github.
  • STT is now compiled against SM 1.7, so 1.8 is no longer required
  • Added support for workshop maps
  • RED giants will spawn at a RED control point in payload maps. It should fall back on the start path_track if nothing else is available.
  • Giant spawns can be overrided by config file. In many community maps, the giant could spawn and get stuck in the world. I also added a quick check when the giants spawns to see if they are stuck.
  • Fixed a server crash on shutdown. You need to remove the tank.autoload file to fix it. Possible bug?
  • Fixed entities with physics based movement becoming blocked by the tank. func_tracktrain, func_movelinear, func_door, etc.
__________________

Last edited by pheadxdll; 09-09-2015 at 19:44.
pheadxdll is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 09-24-2015 , 22:22   Re: [TF2] Stop that Tank!
Reply With Quote #49

New gamedata needed after today's update if you run windows. Replace tank.txt with this and restart!
__________________
pheadxdll is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 09-24-2015 , 22:26   Re: [TF2] Stop that Tank!
Reply With Quote #50

Only 10 servers run this plugin? Me sadface.

Spoiler
Potato Uno 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 23:48.


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