Random map rotation
-
Hey guys, im trying to somehow randomize the map rotation AND gamemodes.
Is there any setting i can set to do so or do i need to implement something through gsc's myself?
(or can i set the rotation to groundwar and add gamemodes?)
Thank you guys -
There are several ways to achieve what you want depending on what you want exactly
One way to do that is using a mapvote, like mine for example
https://forum.plutonium.pw/topic/25896/mp-zm-black-ops-ii-mapvote/ -
I've got a python script i can post soon that randomizes maps
-
first of all sorry for the late response guys
Resxt ive seen your work and thought about using it as a base for implementing it through gsc. Til now was too lazy tho
Ill take a look at it today and hope to finish it. Ig it wont be that hard.MSund12 Python? I didnt even know there was a way that python could interfere with the server. Tell me more
-
Resxt after hacking some of your code (thanks btw) together for five minutes i got a working randomized script. Good job, keep it up
for anyone whos interested (all credit obv goes to Resxt) :
||
#include maps\mp\gametypes\_hud_util; #include maps\mp\gametypes_zm\_hud_util; #include common_scripts\utility; #include maps\mp\_utility; SetDvarIfNotInitialized(dvar, value) { if (!IsInitialized(dvar)) { SetDvar(dvar, value); } } IsInitialized(dvar) { result = GetDvar(dvar); return result != ""; } IsMultiplayerMode() { return !IsDefined(level.zombiemode) || !level.zombiemode; } Init() { replaceFunc(maps\mp\gametypes\_killcam::finalkillcamwaiter, ::OnKillcamEnd); SetDvarIfNotInitialized("mapvote_default_rotation_maps", "Hijacked:Raid:Nuketown:Carrier:Express:Slums:Cargo:Yemen:Plaza"); SetDvarIfNotInitialized("mapvote_default_rotation_modes", "war:dom:dm:koth:ctf:onflag:sd:oic:gun:sas"); } OnKillcamEnd() { if (!IsDefined(level.finalkillcam_winner)) { if (isRoundBased() && !wasLastRound()) return false; wait 5; DoRotation(); return false; } level waittill("final_killcam_done"); if (isRoundBased() && !wasLastRound()) return true; wait 5; DoRotation(); return true; } GetRandomElementInArray(array) { return array[GetArrayKeys(array)[randomint(array.size)]]; } GetMapCodeName(mapName) { formattedMapName = ToUpper(mapName); if (IsMultiplayerMode()) { switch(formattedMapName) { case "NUKETOWN": return "mp_nuketown_2020"; case "HIJACKED": return "mp_hijacked"; case "MELTDOWN": return "mp_meltdown"; case "EXPRESS": return "mp_express"; case "CARRIER": return "mp_carrier"; case "OVERFLOW": return "mp_overflow"; case "SLUMS": return "mp_slums"; case "AFTERMATH": return "mp_la"; case "CARGO": return "mp_dockside"; case "TURBINE": return "mp_turbine"; case "DRONE": return "mp_drone"; case "RAID": return "mp_raid"; case "STANDOFF": return "mp_village"; case "PLAZA": return "mp_nightclub"; case "YEMEN": return "mp_socotra"; case "UPLINK": return "mp_uplink"; case "DETOUR": return "mp_bridge"; case "COVE": return "mp_castaway"; case "RUSH": return "mp_paintball"; case "STUDIO": return "mp_studio"; case "MAGMA": return "mp_magma"; case "VERTIGO": return "mp_vertigo"; case "ENCORE": return "mp_concert"; case "DOWNHILL": return "mp_downhill"; case "GRIND": return "mp_skate"; case "HYDRO": return "mp_hydro"; case "MIRAGE": return "mp_mirage"; case "FROST": return "mp_frostbite"; case "TAKEOFF": return "mp_takeoff"; case "POD": return "mp_pod"; case "DIG": return "mp_dig"; } } else { switch(formattedMapName) { case "BURIED": return "zm_buried"; case "DIE RISE": return "zm_highrise"; case "MOB OF THE DEAD": return "zm_prison"; case "NUKETOWN": return "zm_nuked"; case "ORIGINS": return "zm_tomb"; case "TRANZIT": case "FARM": case "TOWN": case "BUS DEPOT": return "zm_transit"; case "DINER": return "zm_transit_dr"; } } } DoRotation() { modeCfg = GetRandomElementInArray(StrTok(GetDvar("mapvote_default_rotation_modes"), ":")); mapName = GetMapCodeName(GetRandomElementInArray(StrTok(GetDvar("mapvote_default_rotation_maps"), ":"))); SetDvar("sv_maprotationcurrent", "execgts " + modeCfg + ".cfg map " + mapName); SetDvar("sv_maprotation", "execgts " + modeCfg + ".cfg map " + mapName); }
||