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

Plutonium

  1. Home
  2. WAW Modding Releases & Resources
  3. [ZM][RELEASE] First box patch + timer + electric trap timer + movement speed for Der Riese

[ZM][RELEASE] First box patch + timer + electric trap timer + movement speed for Der Riese

Scheduled Pinned Locked Moved WAW Modding Releases & Resources
13 Posts 8 Posters 1.8k 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.
  • AlexInVrundefined Offline
    AlexInVrundefined Offline
    AlexInVr
    wrote on last edited by AlexInVr
    #1

    There is, the final First box patch for WAW, all 4 maps are now patched.

    Installation

    • Create a folder named nazi_zombie_factory inside %localappdata%/Plutonium/storage/t4/raw/scripts/sp

    • Create a file with the name of your choice, that ends with the file extension GSC, so for example, file.gsc

    • Paste the code inside this file

    • save it

    • you now have a script

    • Drop the script inside

    • Enjoy

    
    
    #include maps\_utility;
    #include common_scripts\utility;
    #include maps\_zombiemode_utility;
    
    //First Box by twitch.tv/AlexInVR
    
    init()
    {
    	 replacefunc(maps\_zombiemode::round_think, ::custom_round_think);
    	 replacefunc(maps\_zombiemode_weapons::treasure_chest_ChooseRandomWeapon, ::custom_treasure_chest_ChooseRandomWeapon);
         replacefunc(maps\_zombiemode_weapons::treasure_chest_ChooseWeightedRandomWeapon, ::custom_treasure_chest_ChooseWeightedRandomWeapon);
    	 replacefunc(maps\nazi_zombie_factory::electric_trap_think, ::custom_electric_trap_think);
    	thread onConnect();
    
    }
    
    onConnect()
    {
    	for(;;)
    	{
    		level waittill( "connecting", player );
    		player thread OnPlayerSpawned();
    	}
    }
    
    
    game_timer()
    {
    	hud = create_simple_hud( self );
    	hud.foreground = true;
    	hud.sort = 1;
    	hud.hidewheninmenu = true;
    	hud.alignX = "left";
    	hud.alignY = "top";
    	hud.horzAlign = "user_left";
    	hud.vertAlign = "user_top";
    	hud.x = hud.x - -720;
    	hud.y = hud.y + 35;
    	hud.alpha = 1;
    	flag_wait("all_players_spawned");
    	hud setTimerUp(1);
    }
    
    round_timer()
    {
    	timerHud = create_simple_hud( self );
    	timerHud.foreground = true;
    	timerHud.sort = 1;
    	timerHud.hidewheninmenu = true;
    	timerHud.alignX = "left";
    	timerHud.alignY = "top";
    	timerHud.horzAlign = "user_left";
    	timerHud.vertAlign = "user_top";
    	timerHud.x = timerHud.x - -720;
    	timerHud.y = timerHud.y + 45;
    	timerHud.color =  (1, 0, 0);
    	timerHud.alpha = 1;
    	flag_wait("all_players_spawned");
    	for (;;){
    		start_time = GetTime() / 1000;
    		timerHud setTimerUp(0);
    		level waittill("end_of_round");
    		end_time = GetTime() / 1000;
    		time = end_time - start_time;
    		set_time_frozen(timerHud, time);
    	}
    
    }
    
    set_time_frozen(hud, time)
    {
    	level endon("start_of_round");
    	time = time - 0.1;
    	while(1)
    	{
    		hud settimer(time);
    		wait(0.5);
    	}
    }
    
    trap_timer()
    {
    	TtimerHud = create_simple_hud( self );
    	TtimerHud.foreground = true;
    	TtimerHud.sort = 1;
    	TtimerHud.hidewheninmenu = true;
    	TtimerHud.alignX = "left";
    	TtimerHud.alignY = "top";
    	TtimerHud.horzAlign = "user_left";
    	TtimerHud.vertAlign = "user_top";
    	TtimerHud.x = TtimerHud.x - -720;
    	TtimerHud.y = TtimerHud.y + 25;
    	TtimerHud.color =  (1, 1, 0);
    	TtimerHud.alpha = 1;
    	flag_wait("all_players_spawned");
    	for (;;){
    		level waittill("electric_trap_start");
    		start_time = 50;
    		TtimerHud settimer(start_time);
    	}
    }
    
    
    
    timer_til_despawn(floatHeight)
    {
    
    
    	// SRS 9/3/2008: if we timed out, move the weapon back into the box instead of deleting it
    	putBackTime = 12;
    	self MoveTo( self.origin - ( 0, 0, floatHeight ), putBackTime, ( putBackTime * 0.5 ) );
    	wait( putBackTime );
    
    	if(isdefined(self))
    	{
    		self Delete();
    	}
    }
    
    
    custom_electric_trap_think( enable_flag )
    {
    	self sethintstring(&"ZOMBIE_FLAMES_UNAVAILABLE");
    	self.zombie_cost = 1000;
    
    	self thread maps\nazi_zombie_factory::electric_trap_dialog();
    
    	// get a list of all of the other triggers with the same name
    	triggers = getentarray( self.targetname, "targetname" );
    	flag_wait( "electricity_on" );
    
    	// Get the damage trigger.  This is the unifying element to let us know it's been activated.
    	self.zombie_dmg_trig = getent(self.target,"targetname");
    	self.zombie_dmg_trig.in_use = 0;
    
    	// Set buy string
    	self sethintstring(&"ZOMBIE_BUTTON_NORTH_FLAMES");
    
    	// Getting the light that's related is a little esoteric, but there isn't
    	// a better way at the moment.  It uses linknames, which are really dodgy.
    	light_name = "";	// scope declaration
    	tswitch = getent(self.script_linkto,"script_linkname");
    	switch ( tswitch.script_linkname )
    	{
    	case "10":	// wnuen
    	case "11":
    		light_name = "zapper_light_wuen";
    		break;
    
    	case "20":	// warehouse
    	case "21":
    		light_name = "zapper_light_warehouse";
    		break;
    
    	case "30":	// Bridge
    	case "31":
    		light_name = "zapper_light_bridge";
    		break;
    	}
    
    	// The power is now on, but keep it disabled until a certain condition is met
    	//	such as opening the door it is blocking or waiting for the bridge to lower.
    	if ( !flag( enable_flag ) )
    	{
    		self trigger_off();
    
    		maps\nazi_zombie_factory::zapper_light_red( light_name );
    		flag_wait( enable_flag );
    
    		self trigger_on();
    	}
    
    	// Open for business!
    	maps\nazi_zombie_factory::zapper_light_green( light_name );
    
    	while(1)
    	{
    		//valve_trigs = getentarray(self.script_noteworthy ,"script_noteworthy");
    
    		//wait until someone uses the valve
    		self waittill("trigger",who);
    		if( who in_revive_trigger() )
    		{
    			continue;
    		}
    
    		if( is_player_valid( who ) )
    		{
    			if( who.score >= self.zombie_cost )
    			{
    				if(!self.zombie_dmg_trig.in_use)
    				{
    					self.zombie_dmg_trig.in_use = 1;
    
    					//turn off the valve triggers associated with this trap until available again
    					array_thread (triggers, ::trigger_off);
    
    					play_sound_at_pos( "purchase", who.origin );
    					self thread maps\nazi_zombie_factory::electric_trap_move_switch(self);
    					//need to play a 'woosh' sound here, like a gas furnace starting up
    					self waittill("switch_activated");
    					level notify( "electric_trap_start" );
    					//set the score
    					who maps\_zombiemode_score::minus_to_player_score( self.zombie_cost );
    
    					//this trigger detects zombies walking thru the flames
    					self.zombie_dmg_trig trigger_on();
    
    					//play the flame FX and do the actual damage
    					self thread maps\nazi_zombie_factory::activate_electric_trap();
    
    					//wait until done and then re-enable the valve for purchase again
    					self waittill("elec_done");
    
    					clientnotify(self.script_string +"off");
    					level notify( "electric_trap_end" );
    
    					//delete any FX ents
    					if(isDefined(self.fx_org))
    					{
    						self.fx_org delete();
    					}
    					if(isDefined(self.zapper_fx_org))
    					{
    						self.zapper_fx_org delete();
    					}
    					if(isDefined(self.zapper_fx_switch_org))
    					{
    						self.zapper_fx_switch_org delete();
    					}
    
    					//turn the damage detection trigger off until the flames are used again
    			 		self.zombie_dmg_trig trigger_off();
    					wait(25);
    
    					array_thread (triggers, ::trigger_on);
    
    					//COLLIN: Play the 'alarm' sound to alert players that the traps are available again (playing on a temp ent in case the PA is already in use.
    					//speakerA = getstruct("loudspeaker", "targetname");
    					//playsoundatposition("warning", speakera.origin);
    					self notify("available");
    
    					self.zombie_dmg_trig.in_use = 0;
    				}
    			}
    		}
    	}
    }
    
    custom_round_think()
    {
    	for( ;; )
    	{
    		level.round_spawn_func = maps\_zombiemode::round_spawning;
    		//////////////////////////////////////////
    		//designed by prod DT#36173
    		maxreward = 50 * level.round_number;
    		if ( maxreward > 500 )
    			maxreward = 500;
    		level.zombie_vars["rebuild_barrier_cap_per_round"] = maxreward;
    		//////////////////////////////////////////
    
    		level.round_timer = level.zombie_vars["zombie_round_time"];
    
    		add_later_round_spawners();
    
    		maps\_zombiemode::chalk_one_up();
    		//		round_text( &"ZOMBIE_ROUND_BEGIN" );
    
    		maps\_zombiemode_powerups::powerup_round_start();
    
    		players = get_players();
    		array_thread( players, maps\_zombiemode_blockers::rebuild_barrier_reward_reset );
    
    		level thread maps\_zombiemode::award_grenades_for_survivors();
    
    		level.round_start_time = getTime();
    		level thread [[level.round_spawn_func]]();
    		level notify("start_of_round");
    
    		maps\_zombiemode::round_wait();
    		level.first_round = false;
    		level notify("end_of_round");
    
    		level thread maps\_zombiemode::spectators_respawn();
    
    		//		round_text( &"ZOMBIE_ROUND_END" );
    		level thread maps\_zombiemode::chalk_round_hint();
    
    		wait( level.zombie_vars["zombie_between_round_time"] );
    
    		// here's the difficulty increase over time area
    		timer = level.zombie_vars["zombie_spawn_delay"];
    
    		if( timer < 0.08 )
    		{
    			timer = 0.08;
    		}
    
    		level.zombie_vars["zombie_spawn_delay"] = timer * 0.95;
    
    		// Increase the zombie move speed
    		level.zombie_move_speed = level.round_number * 8;
    
    		level.round_number++;
    
    		level notify( "between_round_over" );
    	}
    }
    
    
    
    
    
    
    custom_treasure_chest_ChooseRandomWeapon( player )
    {
    	if (level.round_number <= 20){
    		if (!(player HasWeapon("tesla_gun"))){
    			return "tesla_gun";
    		}
    
    		if (!(player HasWeapon("zombie_cymbal_monkey"))){
    			return "zombie_cymbal_monkey";
    		}
    
    		if (!(player HasWeapon("ray_gun"))){
    			return "ray_gun";
    		}
    
    
    	}
    
    	keys = GetArrayKeys( level.zombie_weapons );
    
    	// Filter out any weapons the player already has
    	filtered = [];
    	for( i = 0; i < keys.size; i++ )
    	{
    		if( !maps\_zombiemode_weapons::get_is_in_box( keys[i] ) )
    		{
    			continue;
    		}
    
    		if( player maps\_zombiemode_weapons::has_weapon_or_upgrade( keys[i] ) )
    		{
    			continue;
    		}
    
    		if( !IsDefined( keys[i] ) )
    		{
    			continue;
    		}
    
    		filtered[filtered.size] = keys[i];
    	}
    
    	// Filter out the limited weapons
    	if( IsDefined( level.limited_weapons ) )
    	{
    		keys2 = GetArrayKeys( level.limited_weapons );
    		players = get_players();
    		pap_triggers = GetEntArray("zombie_vending_upgrade", "targetname");
    		for( q = 0; q < keys2.size; q++ )
    		{
    			count = 0;
    			for( i = 0; i < players.size; i++ )
    			{
    				if( players[i] maps\_zombiemode_weapons::has_weapon_or_upgrade( keys2[q] ) )
    				{
    					count++;
    				}
    			}
    
    			// Check the pack a punch machines to see if they are holding what we're looking for
    			for ( k=0; k<pap_triggers.size; k++ )
    			{
    				if ( IsDefined(pap_triggers[k].current_weapon) && pap_triggers[k].current_weapon == keys2[q] )
    				{
    					count++;
    				}
    			}
    
    			if( count >= level.limited_weapons[keys2[q]] )
    			{
    				filtered = array_remove( filtered, keys2[q] );
    			}
    		}
    	}
    
    	return filtered[RandomInt( filtered.size )];
    }
    
    custom_treasure_chest_ChooseWeightedRandomWeapon( player )
    {
    
    	if (level.round_number <= 20){
    		if (!(player HasWeapon("tesla_gun"))){
    			return "tesla_gun";
    		}
    
    		if (!(player HasWeapon("zombie_cymbal_monkey"))){
    			return "zombie_cymbal_monkey";
    		}
    
    		if (!(player HasWeapon("ray_gun"))){
    			return "ray_gun";
    		}
    
    
    	}
    
    	keys = GetArrayKeys( level.zombie_weapons );
    
    	// Filter out any weapons the player already has
    	filtered = [];
    	for( i = 0; i < keys.size; i++ )
    	{
    		if( !maps\_zombiemode_weapons::get_is_in_box( keys[i] ) )
    		{
    			continue;
    		}
    
    		if( player maps\_zombiemode_weapons::has_weapon_or_upgrade( keys[i] ) )
    		{
    			continue;
    		}
    
    		if( !IsDefined( keys[i] ) )
    		{
    			continue;
    		}
    
    		num_entries = [[ level.weapon_weighting_funcs[keys[i]] ]]();
    
    		for( j = 0; j < num_entries; j++ )
    		{
    			filtered[filtered.size] = keys[i];
    		}
    	}
    
    	// Filter out the limited weapons
    	if( IsDefined( level.limited_weapons ) )
    	{
    		keys2 = GetArrayKeys( level.limited_weapons );
    		players = get_players();
    		pap_triggers = GetEntArray("zombie_vending_upgrade", "targetname");
    		for( q = 0; q < keys2.size; q++ )
    		{
    			count = 0;
    			for( i = 0; i < players.size; i++ )
    			{
    				if( players[i] maps\_zombiemode_weapons::has_weapon_or_upgrade( keys2[q] ) )
    				{
    					count++;
    				}
    			}
    
    			// Check the pack a punch machines to see if they are holding what we're looking for
    			for ( k=0; k<pap_triggers.size; k++ )
    			{
    				if ( IsDefined(pap_triggers[k].current_weapon) && pap_triggers[k].current_weapon == keys2[q] )
    				{
    					count++;
    				}
    			}
    
    			if( count >= level.limited_weapons[keys2[q]] )
    			{
    				filtered = array_remove( filtered, keys2[q] );
    			}
    		}
    	}
    
    	return filtered[RandomInt( filtered.size )];
    }
    
    weapon_give_custom( weapon, is_upgrade )
    {
    	primaryWeapons = self GetWeaponsListPrimaries();
    	current_weapon = undefined;
    
    	//if is not an upgraded perk purchase
    
    	self play_sound_on_ent( "purchase" );
    	self GiveWeapon( weapon, 0 );
    	self GiveMaxAmmo( weapon );
    	self SwitchToWeapon( weapon );
    
    	maps\_zombiemode_weapons::play_weapon_vo(weapon);
    }
    
    power_electric_switch_custom()
    {
    	trig = getent("use_power_switch","targetname");
    	master_switch = getent("power_switch","targetname");
    	master_switch notsolid();
    	//master_switch rotatepitch(90,1);
    	trig sethintstring(&"ZOMBIE_ELECTRIC_SWITCH");
    
    	//turn off the buyable door triggers for electric doors
    // 	door_trigs = getentarray("electric_door","script_noteworthy");
    // 	array_thread(door_trigs,::set_door_unusable);
    // 	array_thread(door_trigs,::play_door_dialog);
    
    	cheat = false;
    
    /#
    	if( GetDvarInt( "zombie_cheat" ) >= 3 )
    	{
    		wait( 5 );
    		cheat = true;
    	}
    #/
    
    	user = undefined;
    
    	// MM - turning on the power powers the entire map
    // 	if ( IsDefined(user) )	// only send a notify if we weren't originally triggered through script
    // 	{
    // 		other_trig = getent("use_warehouse_switch","targetname");
    // 		other_trig notify( "trigger", undefined );
    //
    // 		wuen_trig = getent("use_wuen_switch", "targetname" );
    // 		wuen_trig notify( "trigger", undefined );
    // 	}
    
    	master_switch rotateroll(-90,.3);
    
    	//TO DO (TUEY) - kick off a 'switch' on client script here that operates similiarly to Berlin2 subway.
    	master_switch playsound("switch_flip");
    	flag_set( "electricity_on" );
    	wait_network_frame();
    	clientnotify( "revive_on" );
    	wait_network_frame();
    	clientnotify( "fast_reload_on" );
    	wait_network_frame();
    	clientnotify( "doubletap_on" );
    	wait_network_frame();
    	clientnotify( "jugger_on" );
    	wait_network_frame();
    	level notify( "sleight_on" );
    	wait_network_frame();
    	level notify( "revive_on" );
    	wait_network_frame();
    	level notify( "doubletap_on" );
    	wait_network_frame();
    	level notify( "juggernog_on" );
    	wait_network_frame();
    	level notify( "Pack_A_Punch_on" );
    	wait_network_frame();
    	level notify( "specialty_armorvest_power_on" );
    	wait_network_frame();
    	level notify( "specialty_rof_power_on" );
    	wait_network_frame();
    	level notify( "specialty_quickrevive_power_on" );
    	wait_network_frame();
    	level notify( "specialty_fastreload_power_on" );
    	wait_network_frame();
    
    //	clientnotify( "power_on" );
    	ClientNotify( "pl1" );	// power lights on
    	exploder(600);
    
    	trig delete();
    
    	playfx(level._effect["switch_sparks"] ,getstruct("power_switch_fx","targetname").origin);
    
    	// Don't want east or west to spawn when in south zone, but vice versa is okay
    	maps\_zombiemode_zone_manager::connect_zones( "outside_east_zone", "outside_south_zone" );
    	maps\_zombiemode_zone_manager::connect_zones( "outside_west_zone", "outside_south_zone", true );
    }
    
    
    onPlayerSpawned()
    {
    	self endon( "disconnect" );
    
    	for( ;; )
    	{
    
    		level waittill( "connected", player );
    		self thread round_timer();
    		self thread game_timer();
    		self thread trap_timer();
    		self SetClientDvars(
    			"player_backSpeedScale", "1",
    			"player_strafeSpeedScale", "1");
    
    
    		wait 1.5;
    
    		self IPrintLnBold("First box by ^1twitch.tv/^2AlexInZombies");
    	}
    
    }
    
    
    1 Reply Last reply
    2
    • Cornal_Fundefined Offline
      Cornal_Fundefined Offline
      Cornal_F
      wrote on last edited by
      #2

      The way you explain this makes no sense to me. So idk what to do exactly.

      WolflexZundefined FaZe Flickundefined 2 Replies Last reply
      0
      • WolflexZundefined Offline
        WolflexZundefined Offline
        WolflexZ Contributor
        replied to Cornal_F on last edited by
        #3

        Cornal_F You create a txt file anywhere and copy and paste the code into it. You then pull the file into a compiler, which changes it to a script file. You then put the file into %localappdata%/Plutonium/storage/t4/raw/scripts/sp

        Cornal_Fundefined 1 Reply Last reply
        0
        • Cornal_Fundefined Offline
          Cornal_Fundefined Offline
          Cornal_F
          replied to WolflexZ on last edited by
          #4

          WolflexZ ok thank you, but I'm still confused on compiling the file?

          1 Reply Last reply
          0
          • AkaHexxundefined Offline
            AkaHexxundefined Offline
            AkaHexx
            wrote on last edited by
            #5

            Hey, what can I use to compile this script I don't really heavily go into waw modding.

            1 Reply Last reply
            0
            • Xerxesundefined Offline
              Xerxesundefined Offline
              Xerxes Plutonium Staff
              wrote on last edited by
              #6

              You don't need to compile anything, the game will do that when it tries to load the file.

              1 Reply Last reply
              0
              • FaZe Flickundefined Offline
                FaZe Flickundefined Offline
                FaZe Flick
                replied to Cornal_F on last edited by
                #7

                Cornal_F exactly what im saying lmao. he doesnt compile his scripts

                AlexInVrundefined 1 Reply Last reply
                0
                • AlexInVrundefined Offline
                  AlexInVrundefined Offline
                  AlexInVr
                  replied to FaZe Flick on last edited by
                  #8

                  FaZe Flick I don't compile them because there is no need to, the game will compile it at runtime

                  1 Reply Last reply
                  0
                  • zrMstrezundefined Offline
                    zrMstrezundefined Offline
                    zrMstrez
                    wrote on last edited by
                    #9
                    This post is deleted!
                    AlexInVrundefined 1 Reply Last reply
                    0
                    • AlexInVrundefined Offline
                      AlexInVrundefined Offline
                      AlexInVr
                      replied to zrMstrez on last edited by
                      #10

                      zrMstrez it is possible but unfortunately not the goal of this, and I would see no use of it personally so I will not make it, sorry to disapoint

                      1 Reply Last reply
                      0
                      • AlexInVrundefined Offline
                        AlexInVrundefined Offline
                        AlexInVr
                        wrote on last edited by
                        #11

                        **UPDATE: 2/9/2024 **

                        • Fixed round timer
                        • Added Electric trap timer (Experimental, seems to be working, but could glitch out if using multiple traps at once, needs more testing). It will show up in yellow after you use an electric trap for the first time.
                        • Fixed timers positions for 1080P
                        Cxrrupt2undefined 1 Reply Last reply
                        0
                        • Cxrrupt2undefined Offline
                          Cxrrupt2undefined Offline
                          Cxrrupt2
                          replied to AlexInVr on last edited by
                          #12

                          AlexInVr Thanks for coming a year and a half later to update your mod, really cool additions too so thanks man.

                          AlexInVrundefined 1 Reply Last reply
                          0
                          • AlexInVrundefined Offline
                            AlexInVrundefined Offline
                            AlexInVr
                            replied to Cxrrupt2 on last edited by
                            #13

                            Cxrrupt2 You're welcome man, I'm not super active these days due to some personal reasons, but I still try and update my stuff when I can. Appreciate the support ❤

                            1 Reply Last reply
                            0

                            • Login

                            • Don't have an account? Register

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