AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc) (https://forums.alliedmods.net/showthread.php?t=68668)

FLOOR_MASTER 03-20-2008 21:41

Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
2 Attachment(s)
Dynamic Map Rotations is a plugin I wrote to allow me to automatically alter the map rotation based on the current server conditions. With Dynamic Map Rotations, you can skip maps based on the number of players on the server or the time of day, and it's easy to add more conditions.

Dynamic Map Rotations replaces nextmap.smx but reproduces the in-game "nextmap" functionality and the sm_setnextmap command.

For brevity, I'll sometimes use "DMR" in place of dynamic map rotations.

Configuration
  • dmr_file (default "dmr.txt")
    • Specifies the filename your DMR is stored in. The default filename resolves to orangebox/tf/dmr.txt in TF2, for example.
  • sm_nextmap
    • Specifies the current nextmap. This updates every minute and should be considered read-only.

Commands
  • nextmap
    • This is an in-game chat trigger that displays the current nextmap, based on server conditions.
  • nextmaps
    • This is an in-game chat trigger that displays the next 5 maps, based on server conditions.
  • sm_setnextmap <mapname>
    • Force the specified mapname (e.g. "sm_setnextmap cp_dustbowl") to be the next map. After the forced nextmap is run, the rotation continues from where it left off (no maps are skipped).
  • sm_unsetnextmap
    • If you've used sm_setnextmap to force a nextmap, this command will undo that action and allow the DMR to proceed uninterrupted.
  • sm_reloaddmr
    • Reload your Dynamic Map Rotation if you've made any changes to it. Also display the current status of the plugin.
Dynamic Map Rotations
Dynamic map rotations are essentially keyvalues structures. I'll go through an illustrative example of how to create a simple DMR. Let's begin with a simple basic mapcycle.txt:
Code:

cp_gravelpit
cp_well
cp_dustbowl

Here's an equivalent DMR:
Code:

"rotation"
{
    "start"    "10"
    "10"
    {
        "map"            "cp_gravelpit"
        "default_nextmap"    "20"
    }
    "20"
    {
        "map"            "cp_well"
        "default_nextmap"    "30"
    }
    "30"
    {
        "map"            "cp_dustbowl"
        "default_nextmap"    "10"
    }
}

There are several things to note about the DMR:
  • The entire keyvalues structure is called "rotation"
  • Every map is its own section with an arbitrary section name. In this case, the names are "10", "20", and "30", but they could easily be the mapnames themselves or whatever you want.
  • There is a "start" keyvalue pair that indicates the first map in the rotation.
  • Within each section is a "map" keyvalue pair whose value is the actual name of the map.
  • Within each section is a "default_nextmap" keyvalue pair. The value points to the section of the nextmap. For example, notice how in section 30 (cp_dustbowl), the default_nextmap is section 10 (cp_gravelpit).
The above DMR looks like:
http://www.2fort2furious.com/images/dmr_original.gif
Now let's say we want to skip ctf_well when the number of players on the server is <= 12. The corresponding DMR looks like:
Code:

"rotation"
{
    "start"    "10"
    "10"
    {
        "map"            "cp_gravelpit"
        "default_nextmap"    "20"
        "30"
        {
            "players_lte"    "12"
        }

    }
    "20"
    {
        "map"            "cp_well"
        "default_nextmap"    "30"
    }
    "30"
    {
        "map"            "cp_dustbowl"
        "default_nextmap"    "10"
    }
}

Notice the subsection added within section 10 (cp_dustbowl). This is called a conditional nextmap. Basically, the red highlighted section can be read as "if the number of players is lte (less than or equal to) 12, then the nextmap is section 30 (cp_dustbowl)". If the conditional nextmap isn't true, which in this case means there are more than 12 players on the server, then the default_nextmap is used as the next map. Visualized, this looks like:
http://www.2fort2furious.com/images/dmr_skipwell.gif
One more example. Let's add cp_badlands to the rotation and throw in a few more conditional nextmaps:
Code:

"rotation"
{
    "start"    "10"
    "10"
    {
        "map"            "cp_gravelpit"
        "default_nextmap"    "20"
        "30"
        {
            "players_lte"    "12"
        }

    }
    "20"
    {
        "map"            "ctf_well"
        "default_nextmap"    "30"
        "bdlnds"
        {
            "players_lte"    "10"
            "time_lte"    "11:00"
        }
        "10"
        {
            "players_lte"    "10"
        }

    }
    "30"
    {
        "map"            "cp_dustbowl"
        "default_nextmap"    "10"
    }

    "bdlnds"
    {
        "map"            "cp_badlands"
        "default_nextmap"    "30"
    }

}

Before I discuss it, here is the visualization:
http://www.2fort2furious.com/images/dmr_badlands.gif
First, notice how I used the section name "bdlnds". Remember that section names are arbitrary -- I could have just been consistent and chosen "40" or chosen anything at all.

Let's look closely at section 20 (ctf_well). There are two conditional nextmaps and a default_nextmap. The first condition reads "IF the number of players <= 10 AND the current server time is <= 11AM, THEN the next map is section bdlnds (cp_badlands)". The second condition reads "IF the number of players <= 10 THEN the next map is section 10 (cp_gravelpit). If none of the conditional nextmaps are true, then the nextmap is the default_nextmap: section 30 (cp_dustbowl).

Conditional nextmaps are evaluated in the order they're written, and the first one that is true is taken. So in the case of ctf_well, if the number of players were, for example 8, and it was 1AM, then the next map would be cp_badlands. If the number of players were 8 and it was 2PM, then the next map would be cp_gravelpit. It's really pretty straightforward!

Automated DMR Generator
Understandably, typing up a DMR is a pain. I've written a simple web tool to help get you started as well as visualize your DMR.
Simply paste your mapcycle.txt into the top text box to generate the basic DMR. You can then modify it to add custom conditions. You can use the bottom text box to create a visualization of your DMR similar to the example images you've seen in this post.

Custom Conditions
  • players_lte - the number of players on the server is less than or equal to the specified number
  • players_gte - ditto, but greater than or equal to
  • time_lte - the current server time is less than or equal to the specified time, in 24-hour "h:mm" format
  • time_gte - ditto, but greater than or equal to
  • day_eq - the day is currently a certain day of the week, where the day is specified with m, t, w, r, f, s, and u for Monday, Tuesday, etc. You can specify multiple days. For example, "day_eq" "mwf" will be true if the day is Monday, Wednesday, or Friday. "day_eq" "u" will be true if the day is Sunday.
  • day_neq - ditto, but if the day is NOT a certain day of the week
Please send me your ideas for new custom conditions to add.

Installation
  1. Move nextmap.smx from your SourceMod plugins directory to the "plugins/disabled" directory
  2. Create a dynamic map rotation and copy it to your game's root directory (the same directory as mapcycle.txt, most likely
  3. Copy dmr.smx to your SourceMod plugins directory
  4. Note: dmr.inc is for plugin authors. You do not need to download dmr.inc for a normal installation.
Other Cvars
These cvars are modified and used directly by the plugin and should be considered read only. Modify them at your own peril.
  • dmr_map_key - the current section key in the rotation. DMR will base its nextmap decisions on this section's conditional nextmaps/default_nextmap.
  • dmr_force_nextmap - if sm_setnextmap was used, this cvar stores the value of the nextmap that will be loaded in lieu of the DMR-based nextmap. Setting this value directly will not guarantee it will be used: use sm_setnextmap.
Compatibility
This plugin was developed for a TF2 server, but I don't have any reason to believe it would misbehave in other games. Please let me know if it works with other games.

Version History
  • 2008-03-20 - v0.1
    • Initial release
  • 2008-03-25 - v0.2
    • Fixed bug with Insurgency mod
    • Added GetNextMaps() function for other plugins to retrieve a mapcycle-like list of next maps
  • 2008-04-06 - v0.3
    • Added custom conditions day_eq and day_neq
  • 2008-05-01 - v0.5
    • Added nextmaps command
    • Added sm_nextmap cvar for compatibility with plugins that need to know nextmap info via cvars (ads, etc)
  • 2008-05-06 - v0.6
    • Fixed conditional nextmap bug where times weren't properly calculated when both time_lte and time_gte are used in a single conditional nextmap
    • Added sm_unsetnextmap command
    • Added sm_reloaddmr command
  • 2008-05-14 - v0.7
    • Fixed bug involving time ranges (when both time_lte and time_gte are used in the same conditional nextmap)
Todo
  • Complete comments
  • Add better support for specifying time ranges that straddle midnight
  • Global conditional nextmaps
  • Verify compatibility with other rotation-related plugins (rtv/votemaps/etc)
How am I using it? This is my server's rotation as of this writing: http://tf2.2fort2furious.com/images/dmr.php

I'd love to hear any feedback or suggestions about the plugin.

DontWannaName 03-20-2008 22:53

Re: Dynamic Map Rotations
 
I will try this out. Just what I needed. Have to figure out the txt file a little bit more.

FLOOR_MASTER 03-20-2008 23:25

Re: Dynamic Map Rotations
 
One thing I should note is that I don't know if DMR plays nice with rockthevote and similar map-related plugins. I really don't know either way (I haven't looked into it) but I'll be sure to resolve this for the next version. DMR seems to work fine with basevotes/votemap and rockthevote. I don't know enough about mapchooser yet to test it out with mapchooser, but I suspect there will be issues with mapchooser.

Let me know if you need any help constructing your dmr.txt. I'm on gamesurge as FLOOR_MASTER.

tony2kownz 03-21-2008 12:14

Re: Dynamic Map Rotations
 
looks very interesting, I'll check this out.

Caught off Guard 03-24-2008 06:52

Re: Dynamic Map Rotations
 
hi

im gonna try this on my insurgency server (217.163.31.17:27015). many thanks for the automated generator - it helped me alot for figuring this baby out :) i'll let you know the outcome. for your reference my following rotation is set to:

Code:

"rotation"
{
 "start" "10"
 "10"
 {
  "map"  "ins_almaden"
  "default_nextmap" "20"
  "30"
        {
              "players_lte"    "18"
        }
 }
 "20"
 {
  "map"  "ins_ramadi"
  "default_nextmap" "30"
  }
 "30"
 {
  "map"  "ins_baghdad"
  "default_nextmap" "40"
  "50"
        {
              "players_lte"    "14"
        }
 }
 "40"
 {
  "map"  "ins_haditha"
  "default_nextmap" "50"
 }
 "50"
 {
  "map"  "ins_sinjar"
  "default_nextmap" "60"
  "10"
  {
            "players_lte"    "18"
        }
 }
 "60"
 {
  "map"  "ins_hillah"
  "default_nextmap" "10"
 }
}

If working correctly it should miss out 3 maps if there are unsufficient numbers on the server :)

KMFrog 03-24-2008 08:00

Re: Dynamic Map Rotations
 
nice work

Caught off Guard 03-25-2008 06:07

Re: Dynamic Map Rotations
 
hi

unfortuantely this plugin doesnt seem to be working for insurgency. I used your automated tool to generate the dmr.txt (seen above^^).

unfortuantely there isnt much in the way of info in the error logs except for:

Code:

L 03/23/2008 - 21:49:58: Info (map "ins_almaden") (file "errors_20080323.log")
L 03/23/2008 - 22:17:04: Info (map "ins_ramadi") (file "errors_20080323.log")
L 03/23/2008 - 22:37:26: Info (map "ins_baghdad") (file "errors_20080323.log")
L 03/23/2008 - 23:10:19: Info (map "ins_haditha") (file "errors_20080323.log")
L 03/23/2008 - 23:33:10: Info (map "ins_sinjar") (file "errors_20080323.log")

As far as I am aware there wasnt sufficient players on to play some of the maps.

have i implemented the plugin incorrectly?

thanks in advance

FLOOR_MASTER 03-25-2008 08:51

Re: Dynamic Map Rotations
 
Your dmr.txt is perfect, so the error involves some incompatibility between the plugin and Insurgency. I'm downloading the Insurgency client/server now and will try to duplicate the problem.

Caught off Guard 03-25-2008 09:33

Re: Dynamic Map Rotations
 
Quote:

Originally Posted by FLOOR_MASTER (Post 601704)
Your dmr.txt is perfect, so the error involves some incompatibility between the plugin and Insurgency. I'm downloading the Insurgency client/server now and will try to duplicate the problem.

thanks thats very much appreciated.

just in case its me being thick......i added the cvars (dmr_map_key and dmr_force_nextmap) to the sourcemod.cfg file, exactly how you wrote them above ^^ (e.g. without numbers/values against them). if it was me being thick - apologies :)

just so you know it is controlling the map rotation as nextmap.smx is disabled and the maps are rotating just not using the dynamic function that this plugin is made for.

many thanks in advance for your time

FLOOR_MASTER 03-25-2008 17:15

Re: Dynamic Map Rotations
 
I've uploaded version 0.2 which should address the bug in Insurgency - I wasn't able to reproduce your specific errors but I did find what I think is the bug that lead to your errors.

The other thing I noticed was that the in-game "nextmap" command didn't work, and the command didn't work in nextmap.smx either. I've added fixing this on my todo list.

Please let me know if this version works out for you...

Caught off Guard 03-25-2008 17:29

Re: Dynamic Map Rotations
 
Hi thanks for the quick response. ive uploaded it and now testing it.

thanks for spotting the other bug and putting it on your list - that would be excellent!


thanks again

Caught off Guard 03-25-2008 18:03

Re: Dynamic Map Rotations
 
hi ive just tested it and with 9 people on the server the map changed from baghdad to haditha whereas it should have moved to sinjar.

sorry :)

let me know what i can do to help and thanks for looking into this

cheers

CoG

FLOOR_MASTER 03-26-2008 08:59

Re: Dynamic Map Rotations
 
I'm sorry for the late reply. Would you be willing to send me a copy of your server config (please delete any passwords stored within)?

Caught off Guard 03-26-2008 13:04

Re: Dynamic Map Rotations
 
wanted to send it via pm but unfortunately it was too long so here it is:

hostname "The.O.C Insurgency | 2.0e | *recruiting*"

sv_lan "0" // Server is a lan server ( no heartbeat, no authentication, no non-class C addresses
sv_region "3" // The region of the world to report this server in.
sv_alltalk "0" // If 0, players from team one cannot talk to players in team two over voice
sv_password "" // Server password for entry into multiplayer games
rcon_password "" // Remote Console Password.
sv_rcon_banpenalty "30" // Number of minutes to ban users who fail rcon authentication
sv_rcon_log "1" // Enable/disable rcon logging.
sv_rcon_maxfailures "5" // Max number of times a user can fail rcon authentication before being banned
sv_rcon_minfailures "5" // Number of times a user can fail rcon authentication in sv_rcon_minfailuretime before being banned
sv_rcon_minfailuretime "30" // Number of seconds to track failed rcon authentications
sv_rcon_banpenalty "30" // Number of minutes to ban users who fail rcon authentication
sv_rcon_log "1" // Enable/disable rcon logging.
sv_rcon_maxfailures "5" // Max number of times a user can fail rcon authentication before being banned
sv_rcon_minfailures "5" // Number of times a user can fail rcon authentication in sv_rcon_minfailuretime before being banned
sv_rcon_minfailuretime "30" // Number of seconds to track failed rcon authentications

// Specific settings
ins_forceautoassign 0 // Forces a Player to Auto-Assign when Joining
ins_forcesquadopen 0 // Forces all Squads to be Open
ins_gamecount 3 // How many rounds pr map
ins_roundtimer 300 // Maximum length of a round in seconds
ins_tkdetect "0" // Auto Kick TKs
ins_tkremove "0" // How Many TKs before Kicking
mp_chattime "8" // Length of Time (in Seconds) for Players to Commune When the Game is Over (min. 2.000000 max. 10.000000)
mp_friendlyfire "1" // Defines Friendly-Fire Status (min. 0.000000 max. 1.000000)
//mp_timelimit "25" // Time on one map
mp_limitteams "2" // Maximum Difference between Team Sizes
mp_winlimit "5" // Defines how Many Rounds Played by One Team before Map Rotates
mp_respawnlimit "10"
sv_pausable "0" // Is the server pausable.
sv_cheats "0" // Allow cheats on server
sv_voiceenable "1" // Enables Ingame Voices
sv_contact "" // Contact email for server sysop
sv_downloadurl "" // Location from which clients can download missing files
sv_allowdownload "1" // Allow clients to download files (Enable= 1 Disable= 0)
sv_allowupload "1" // Allow clients to upload files like spraylogo's (Enable= 1 Disable= 0)
sv_timeout "30" // After this many seconds without a message from a client, the client is dropped
sv_gravity "800" // World gravity settings (Default= 800)
sv_maxvelocity "3500" // Maximum velocity an object can have ingame (Default= 3500)
sv_maxspeed "350" // Maximum speed a player can move (Default= 350) ///////////////manual!
sv_unlag "1" // Enables player lag compensation
sv_maxrate "25000" // Max bandwidth rate allowed on server, 0 == unlimited
sv_minrate "7500" // Min bandwidth rate allowed on server, 0 == unlimited
sv_maxunlag "1" // Maximum lag compensation in seconds
sv_unlag_fixstuck "1" // Disallow backtracking a player for lag compensation if it will cause them to become stuck
net_maxfilesize "32" // Maximum allowed file size for uploading in MB
net_queued_packet_thread "0" // Use a high priority thread to send queued packets out instead of sending them each frame.
fps_max "555" // Frame rate limiter
ins_cachesabotage "1" // When Enabled, Allows a Team to Sabotage their own Caches
ins_deadcam_modes "0" // Restricts Spectator Modes
ins_deadcam_targets "1" // Restricts Spectator Targets
ins_deadchat "0" // Determines whether Dead Players can Chat to Alive Players
ins_deadinfofull "1" // Determines whether or not to use Full Death Information
ins_dmgfactor "1" // Factor Reduction of Damage in FF
ins_endgametime "4" // Change how Long the Winning Players get to Wander Around
ins_firetype "0" // Defines if you can Fire either Always, Never or During Warmup
ins_forceautoassign "1" // Forces a Player to Auto-Assign when Joining
ins_forcesquadopen "0" // Forces all Squads to be Open
ins_locksquads "0" // Lock Squads During a Running Game
ins_maskotherteam "0" // When Enabled the Other Teams Score will not be Updated until the End of the Round
ins_objdisable "0" // Ignore Objective States
ins_randomlayout "1" // Determines wether or not to use Random Layouts
ins_roundtimer "900" // Length of Time (in Seconds) of each Round
ins_scorefrozen "0" // Determines whether or not the Score is Frozen
ins_strictnaming "1" // When Enabled, the Player can only Change his name Once per Round
ins_suppresskillhint "0" // Supress the Kill Hint from being Sent
ins_teamsize "0" // Maximum Team Size
ins_teamswap "0" // When Restarting and Enabled, Teams will Swap
ins_timertype "1" // Defines which Timer to Use
ins_tkdetect "0" // Auto Kick TKs
ins_tkremove "4" // How Many TKs before Kicking
ins_warmuptime "12" // Warm-Up Time before a Game (in Seconds)
ins_warmuptype "0" // Defines Warm-Up Type
ins_gamecount "3" // game notifications (min 0, max 30)
ins_clanleaderpass "0" // Defines the Password for Clan Leaders
ins_clanmode "0" // Defines whether Clan Mode is Active
ins_decalfrequency "8" // Decalfrequency

// Execute Ban File
exec banned_user.cfg
// Force Mapcycle File
mapcyclefile "mapcycle.txt"

// Enable bots on this server.
bot_enabled 1

=========================

Now that im looking at my config is the mapcycle "mapcycle.txt" causing the problem?

thanks in advance

FLOOR_MASTER 03-26-2008 23:53

Re: Dynamic Map Rotations
 
I used your config file on my server and the plugin worked properly, skipping the appropriate maps since I was the only one on the server, so unfortunately the particular game settings you're using aren't causing the issue. I have a few more questions to help me reproduce the error you're receiving:

1) Are you running a Windows or Linux server?
2) Did you load the plugin in the middle of some other map that wasn't the first map (which is perfectly fine) or did you restart the server?
3) Could you attach errors_20080323.log to your reply? It should be located in addons/sourcemod/logs in your server's insurgency directory. (Click on "Go Advanced" to attach files)

Caught off Guard 03-27-2008 03:49

Re: Dynamic Map Rotations
 
1 Attachment(s)
Quote:

Originally Posted by FLOOR_MASTER (Post 602552)
I used your config file on my server and the plugin worked properly, skipping the appropriate maps since I was the only one on the server, so unfortunately the particular game settings you're using aren't causing the issue. I have a few more questions to help me reproduce the error you're receiving:

1) Are you running a Windows or Linux server?
2) Did you load the plugin in the middle of some other map that wasn't the first map (which is perfectly fine) or did you restart the server?
3) Could you attach errors_20080323.log to your reply? It should be located in addons/sourcemod/logs in your server's insurgency directory. (Click on "Go Advanced" to attach files)

oh well at least its not my config :) to answer your questions:

1) Its a linux server
2) I loaded the plugin whilst a map was playing (i forget which one) and then restarted the server.
3) attached :)

you will see errors for "deathnotice.smx" which is a plugin for displaying who killed who to admins which is working sporadically so pleas ignore those. (here for reference)

im also using MMS 1.4.3 and soucemod v1 if that helps. my plugins list looks like:
Code:

 
01 "Basic Commands" (1.0.0.1946) by AlliedModders LLC
02 "Basic Info Triggers" (1.0.0.1946) by AlliedModders LLC
03 "Death Notice" (1.0.4) by bl4nk
04 "Basic Comm Control" (1.0.0.1946) by AlliedModders LLC
05 "Server Crontab" (1.0.1.0) by dubbeh
06 "Admin Menu" (1.0.0.1946) by AlliedModders LLC
07 "Anti-Flood" (1.0.0.1946) by AlliedModders LLC
08 "Admin Help" (1.0.0.1946) by AlliedModders LLC
09 "Server Crontab Module" (1.0.1.0) by dubbeh
10 "Basic Chat" (1.0.0.1946) by AlliedModders LLC
11 "Maps and Prefix Maps Configs" (1.2) by graczu
12 "Basic Votes" (1.0.0.1946) by AlliedModders LLC
13 "Basic Ban Commands" (1.0.0.1946) by AlliedModders LLC
14 "Dynamic Map Rotations" (0.2) by Ryan "FLOOR_MASTER" Mannion
15 "Ads" (1.0.4.0) by Shane A. ^BuGs^ Froebel
16 "Admin File Reader" (1.0.0.1946) by AlliedModders LLC

In the logs after the cron job has run at 5am i get:

Code:

L 03/27/2008 - 05:00:48: [dmr.smx] Reset dmr_map_key to "10"
but after that I just get the maps being played in sequence (without missing any out)

appreciate your help on this one.

FLOOR_MASTER 03-30-2008 17:26

Re: Dynamic Map Rotations
 
I'm sorry to say that I still can't duplicate the bug you're experiencing. I've reproduced your setup as close as I can and can't find any reason why it wouldn't work.

Anyone out there have any insights? The plugin's been working flawlessly on my servers...

Caught off Guard 03-31-2008 10:09

Re: Dynamic Map Rotations
 
Quote:

Originally Posted by FLOOR_MASTER (Post 604421)
I'm sorry to say that I still can't duplicate the bug you're experiencing. I've reproduced your setup as close as I can and can't find any reason why it wouldn't work.

Anyone out there have any insights? The plugin's been working flawlessly on my servers...

how odd. well thanks for trying your help in trying to get this resolved was appreciated. I will maybe try a few things with my set up to see if i can find it!

cheers

st0rm_r1der 04-02-2008 11:44

Re: Dynamic Map Rotations
 
1 Attachment(s)
one question before i will start the plugin with my dmr.txt

can i delete/rename the original cycle file to deactivate it?

FLOOR_MASTER 04-02-2008 21:40

Re: Dynamic Map Rotations
 
You can leave mapcycle.txt alone -- what really matters is that you disable nextmap.smx. You can either delete mapcycle.smx or, preferrably, move mapcycle.smx to the disabled folder (addons/sourcemod/plugins/disabled).

FLOOR_MASTER 04-02-2008 22:18

Re: Dynamic Map Rotations
 
This is only for advanced users: By the way, this command will be removed eventually or recreated as another command, but for now, the server console command dmr will reload dmr.txt (dmr_file, actually) and display the nextmap in console. If you want to skip ahead in your DMR, change the cvar dmr_map_key (be sure to use the "dmr" command afterwards to verify that the map key is correct). Remember that the default_nextmap and conditional nextmaps of dmr_map_key are used to determine the next map.

arm5ky 04-06-2008 08:12

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
Fantasic,

Could you add another custom condition? Day of week would be very handy.

Weekdays we would have stock maps, but would like a mixture on Saturday and customs only on Sunday!!

FLOOR_MASTER 04-06-2008 09:09

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
I've uploaded version 0.3 which includes support for specifying the day of the week. Here's what I wrote in the original post about how to use it:
  • day_eq - the day is currently a certain day of the week, where the day is specified with m, t, w, r, f, s, and u for Monday, Tuesday, etc. You can specify multiple days. For example, "day_eq" "mwf" will be true if the day is Monday, Wednesday, or Friday. "day_eq" "u" will be true if the day is Sunday.
  • day_neq - ditto, but if the day is NOT a certain day of the week

arm5ky 04-06-2008 15:37

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
Now tha is fast work.:up:

DontWannaName 04-06-2008 17:47

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
Does this work with RTV or not? If not I guess its worth taking it out for this. :)

FLOOR_MASTER 04-06-2008 18:48

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
I did some quick testing with RTV and TF2 a few weeks ago and they appear to work fine together. Note that your rotation will continue where it left off after the RTV map (the nextmap won't be skipped).

DontWannaName 04-06-2008 19:41

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
1 Attachment(s)
Here is my new mapcycle. Hope it works :)

FLOOR_MASTER 04-06-2008 20:08

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
I updated dmr.php to support drawing day_eq and day_neq.

DontWannaName 04-06-2008 20:52

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
With the new ads plugin the {SM_NEXTMAP} feature shows my other map cycle. So far thats about it.

FLOOR_MASTER 04-06-2008 20:58

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
Can you link to the specific plugin? I'm guessing the ads plugin gets its information off of a nextmap cvar, and if so, I can fix that easily.

DontWannaName 04-06-2008 21:14

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
http://forums.alliedmods.net/showthread.php?t=67885 :D

Shadowdogg 04-09-2008 19:49

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
Will this be able to do the random map cycle too?

also if it would be possible to automatically change map i.e. if 0 players on?

pRED* 04-12-2008 03:02

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
Impressive work. Approved. Sorry it took so long.

arm5ky 04-13-2008 11:16

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
My problem is that at end of map, when scores are shown, players do nextmap to see whats next, but it gives the name of the map that is on next + 1.

This confuses and doesnt look very good. Cos people leve if they don't like it when in fact it will be something different.

FLOOR_MASTER 04-13-2008 17:35

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
1 Attachment(s)
Here's an interim release v0.3.1 that you can try out that moves the nextmap change from the start of intermission to the actual start of the next map.

Also, the cvar dmr_nextmap is (roughly - still working on this) kind of the value of the nextmap. It doesn't update very often yet, but you can use it as a placeholder in the ads plugin: {dmr_nextmap}. I would suggest not using it now.

FunTF2Server 04-13-2008 19:55

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
I want to make it for my server stays on ctf_2fort unless there are more than 2 people in the server.

How can I do this? This DMR thing is confusing me too much, I'll give +rep to anyone who can make me a DMR cfg file. I want every map on the cycle, but I want it to skip every one of them except 2fort unless there is more than 2 people in the server...

FunTF2Server 04-14-2008 14:32

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
Quote:

Originally Posted by FunTF2Server (Post 611193)
I want to make it for my server stays on ctf_2fort unless there are more than 2 people in the server.

How can I do this? This DMR thing is confusing me too much, I'll give +rep to anyone who can make me a DMR cfg file. I want every map on the cycle, but I want it to skip every one of them except 2fort unless there is more than 2 people in the server...

:down:

arm5ky 04-14-2008 17:59

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
Quote:

Originally Posted by FLOOR_MASTER (Post 611125)
Here's an interim release v0.3.1 that you can try out that moves the nextmap change from the start of intermission to the actual start of the next map.

Also, the cvar dmr_nextmap is (roughly - still working on this) kind of the value of the nextmap. It doesn't update very often yet, but you can use it as a placeholder in the ads plugin: {dmr_nextmap}. I would suggest not using it now.

Great job m8, works a treat. :up:

ratty 04-15-2008 22:10

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
This breaks any plugin that relies on the "sm_nextmap" cvar, I found another, autonextmap. Can that be made to work in DMR? I saw your post about dmr_nextmap, what prevents just exporting a public sm_nextmap cvar?

And just a random suggestion, I don't really care if you add it, but I had the idea and figured I'd throw it out there in case anyone likes it.. Add a condition for "if an admin is present", for those custom maps that are fun, but maybe a little buggy, then you can be sure griefers wont just run rampant.

FLOOR_MASTER 04-15-2008 22:19

Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
 
Incidentally, the last few versions I've posted define "admins_lte" and "admins_gte". I honestly haven't tested them at all and have no idea if they work yet, which is why I haven't mentioned that they exist. Feel free to try them out and let me know :).

In your case, you'd want "admins_gte" "1" to check if there's at least one admin on or "admins_lte" "0" to check if there are no admins on.

[EDIT] I'll be gone for a week and back Wednesday the 23rd, after which I'll start working on this again.


All times are GMT -4. The time now is 20:36.

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