Request Map Rotation
#11
Yes.
However, it is somewhat outdated. If you want, I'll post the new version.
Reply

#12
yes that would be great
and how work? just read map rotation in order or need edit weight?
Reply

#13
Code:
const int MAPS = 16; string[] mapdev = { "mp_alpha", "mp_bootleg", "mp_bravo", "mp_carbon", "mp_dome", "mp_exchange", "mp_hardhat", "mp_interchange", "mp_lambeth", "mp_mogadishu", "mp_paris", "mp_plaza2", "mp_radar", "mp_seatown", "mp_underground", "mp_village" }; string[] mapuser = { "lockdown", "bootleg", "mission", "carbon", "dome", "downturn", "hardhat", "interchange", "fallen", "bakaara", "resistance", "arkaden", "outpost", "seatown", "underground", "village" }; int[] maprange = new int[MAPS]; int range; int nextmap = -1; string dspl, dsr; Random rnd = new Random(unchecked((int)DateTime.Now.Ticks)); void GetRotation() { dspl = GetServerCFG("Yu", "dspl", "default") + ".dspl"; dsr = GetServerCFG("Yu", "dsr", "FFA_default"); string[] weights = GetServerCFG("Yu", "weights", "3, 2, 5, 3, 5, 2, 5, 3, 2, 5, 5, 3, 2, 3, 2, 5").Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < MAPS; i++) { range += int.Parse(weights[i]); maprange[i] = range; } } int FindMap(int r) { for (int i = 0; i < MAPS; i++) if (r <= maprange[i]) return i; return -1; } void SetMap(string map) { File.WriteAllText(@"admin\" + dspl, map + "," + dsr + ",1"); } int GetMapByName(string map, bool dev = false) { string[] m = dev ? mapdev : mapuser; for (int i = 0; i < MAPS; i++) if (m[i].StartsWith(map, StringComparison.InvariantCultureIgnoreCase)) return i; return -1; } public override void OnServerLoad() { // ... GetRotation(); // ... } public override void OnMapChange() { // ... int prevmap = GetMapByName(GetDvar("mapname"), true); //LogWrite("----------------------------------------------\nNEW MAP: " + mapuser[prevmap].ToUpperInvariant() + "\n----------------------------------------------"); repeat: nextmap = FindMap(1 + rnd.Next(range)); if (prevmap == nextmap) { goto repeat; } SetMap(mapdev[nextmap]); // ... }



In sv_config.ini:

Code:
[Yu] dspl=default // your dspl-file dsr=FFA_default // your dsr-file weights= 3, 2, 5, 3, 5, 2, 5, 3, 2, 5, 5, 3, 2, 3, 2, 5 // your map weights



The higher the weight, the more likely choice a map as the next map.
Reply

#14
Any chance you could compile it and upload the dll? I don't have the tools to do it myself. Thanks either way for the work you've shared Smile
Reply

#15
Quote:

In sv_config.ini:

Code:
[Yu] dspl=default // your dspl-file dsr=FFA_default // your dsr-file weights= 3, 2, 5, 3, 5, 2, 5, 3, 2, 5, 5, 3, 2, 3, 2, 5 // your map weights



The higher the weight, the more likely choice a map as the next map.


I can use simple 1,2,3,4....14,15,16 weights??

Thank you Big Grin
Reply

#16
@Dumas
Any non-negative integers.

Release here. Enjoy Wink
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  bypass map rotation limit kerm007 3 4,239 07-22-2012, 15:23
Last Post: surtek
  [Release] How to add new maps to rotation ;) hillbilly 7 8,485 06-22-2012, 15:24
Last Post: hillbilly
  Crash After First Map Rotation worldclass 6 5,359 06-08-2012, 21:50
Last Post: SuperNovaAO
  Crash After First Map Rotation worldclass 6 5,480 06-08-2012, 20:30
Last Post: SuperNovaAO
  map rotation blueberry9 3 2,945 04-11-2012, 00:40
Last Post: blueberry9
  Help Map rotation - maps are random only? choobie 4 3,636 03-16-2012, 02:06
Last Post: Predje
  mw3 map rotation configurator kerm007 2 3,171 03-01-2012, 02:53
Last Post: kerm007
  Rcon & map rotation xcondex 5 5,464 02-25-2012, 16:45
Last Post: xcondex

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.