Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Server Hosting Support
  3. Random map rotation

Random map rotation

Scheduled Pinned Locked Moved BO2 Server Hosting Support
5 Posts 3 Posters 269 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • rvyASVPundefined Offline
    rvyASVPundefined Offline
    rvyASVP
    wrote on last edited by rvyASVP
    #1

    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 🙂

    1 Reply Last reply
    0
    • Resxtundefined Offline
      Resxtundefined Offline
      Resxt Plutonium Staff
      wrote on last edited by
      #2

      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/

      rvyASVPundefined 2 Replies Last reply
      0
      • MSund12undefined Offline
        MSund12undefined Offline
        MSund12
        wrote on last edited by
        #3

        I've got a python script i can post soon that randomizes maps

        1 Reply Last reply
        0
        • rvyASVPundefined Offline
          rvyASVPundefined Offline
          rvyASVP
          replied to Resxt on last edited by
          #4

          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 😄

          1 Reply Last reply
          0
          • rvyASVPundefined Offline
            rvyASVPundefined Offline
            rvyASVP
            replied to Resxt on last edited by rvyASVP
            #5

            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);
            }
            

            ||

            1 Reply Last reply
            1

            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Donate