[ZM] [RELEASE] First Box patch + timer + movement speed patch NACHT DER UNTOTEN

Topic created ยท 7 Posts ยท 162 Views
  • 3 out of 4 maps completed, I will release a patch soon for Der Riese

    Timer, basckpeed and strafe speed

    first box up until 20, (flamethrower and raygun)

    Installation:

    • Create a folder named nazi_zombie_prototype in
    %localappdata%/Plutonium/Storage/t4/raw/scripts/sp
    
    • 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_weapons::treasure_chest_ChooseRandomWeapon, ::custom_treasure_chest_ChooseRandomWeapon);
    	 replacefunc(maps\_zombiemode_weapons::treasure_chest_weapon_spawn, ::custom_treasure_chest_weapon_spawn);
    	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 - -700; 
    	hud.y = hud.y + 35; 
    	hud.alpha = 1;
    	time_text = string(GetTime() / 1000);
    	flag_wait("all_players_spawned");
    	while (1){
    		hud setTimerUp(1);
    		hud setTimer(time_text);
    	}
    	
    }
    
    
    custom_treasure_chest_ChooseRandomWeapon( player )
    {
    	if (level.round_number <= 20){
    		if (!(player HasWeapon("m2_flamethrower_zombie"))){
    			return "m2_flamethrower_zombie";
    		}
    
    		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( player HasWeapon( keys[i] ) )
    		{
    			continue;
    		}
    
    		//chrisP - make sure the chest doesn't give the player a bouncing betty
    		if(keys[i] == "mine_bouncing_betty")
    		{
    			continue;
    		}
    
    		filtered[filtered.size] = keys[i];
    	}
    
    	// Filter out the limited weapons
    	if( IsDefined( level.limited_weapons ) )
    	{
    		keys2 = GetArrayKeys( level.limited_weapons );
    		players = get_players();
    		for( q = 0; q < keys2.size; q++ )
    		{
    			count = 0;
    			for( i = 0; i < players.size; i++ )
    			{
    				if( players[i] HasWeapon( keys2[q] ) )
    				{
    					count++;
    				}
    
    				// check for last stand weapons that might not be on the player at the time
    				if (players[i] maps\_laststand::player_is_in_laststand())
    				{
    					for( m = 0; m < players[i].weaponInventory.size; m++ )
    					{
    						if (players[i].weaponInventory[m] == keys2[q])
    						{
    							count++;
    						}
    					}
    				}
    			}
    
    			if( count == level.limited_weapons[keys2[q]] )
    			{
    				filtered = array_remove( filtered, keys2[q] );
    			}
    		}
    	}
    
    	return filtered[RandomInt( filtered.size )];
    }
    
    custom_treasure_chest_weapon_spawn( chest, player )
    {
    	assert(IsDefined(player));
    	// spawn the model
    	model = spawn( "script_model", self.origin ); 
    	model.angles = self.angles +( 0, 90, 0 );
    
    	floatHeight = 40;
    
    	//move it up
    	model moveto( model.origin +( 0, 0, floatHeight ), 3, 2, 0.9 ); 
    
    	// rotation would go here
    
    	// make with the mario kart
    	modelname = undefined; 
    	rand = undefined; 
    	for( i = 0; i < 40; i++ )
    	{
    
    		if( i < 20 )
    		{
    			wait( 0.05 ); 
    		}
    		else if( i < 30 )
    		{
    			wait( 0.1 ); 
    		}
    		else if( i < 35 )
    		{
    			wait( 0.2 ); 
    		}
    		else if( i < 38 )
    		{
    			wait( 0.3 ); 
    		}
    
    		rand = custom_treasure_chest_ChooseRandomWeapon( player );
    		modelname = GetWeaponModel( rand );
    		model setmodel( modelname ); 
    
    
    	}
    
    	self.weapon_string = rand; // here's where the org get it's weapon type for the give function
    
    	// random change of getting the joker that moves the box
    	rand = Randomint(100);
    
    
    	//increase the chance of joker appearing from 0-100 based on amount of the time chest has been opened.
    	if(level.script != "nazi_zombie_prototype" && getdvar("magic_chest_movable") == "1")
    	{
    
    		if(level.chest_accessed < 5)
    		{		
    			chance_of_joker = 0;
    		}
    		else
    		{
    			chance_of_joker = level.chest_accessed + 3;
    		}
    
    		if (rand <= chance_of_joker)
    		{
    			model SetModel("zombie_teddybear");
    		//	model rotateto(level.chests[level.chest_index].angles, 0.01);
    			//wait(1);
    			model.angles = level.chests[level.chest_index].angles;		
    			wait 1;
    			flag_set("moving_chest_now");
    			level.chest_accessed = 0;
    
    			player maps\_zombiemode_score::add_to_player_score( 950 );
    
    		}
    
    	}
    
    	self notify( "randomization_done" );
    
    	if (flag("moving_chest_now"))
    	{
    		wait .5;	// we need a wait here before this notify
    		level notify("weapon_fly_away_start");
    		wait 2;
    		model MoveZ(500, 4, 3);
    		model waittill("movedone");
    		model delete();
    		self notify( "box_moving" );
    		level notify("weapon_fly_away_end");
    	}
    	else
    	{
    
    		model thread timer_til_despawn(floatHeight);
    		self waittill( "weapon_grabbed" );
    
    		if( !chest.timedOut )
    		{
    			model Delete();
    		}
    
    
    	}
    }
    
    
    
    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();
    	}
    }
    
    
    onPlayerSpawned()
    {
    	self endon( "disconnect" ); 
    
    	for( ;; )
    	{
    		
    		level waittill( "connected", player ); 
    		self thread game_timer();
    		self SetClientDvars( 
    			"player_backSpeedScale", "1", 
    			"player_strafeSpeedScale", "1");
    
    		
    		wait 3;
    
    		self IPrintLnBold("First box by ^1twitch.tv/^2AlexInVR");
    	}
    	level waittill( "connected", player ); 
    	
    }
    
    
  • @AlexInVr Would there be a way to have just the timer and move speed fix, I cant seem to find those standalone.

  • @MrConfetti For sure,

    #include maps\_utility;
    #include common_scripts\utility;
    #include maps\_zombiemode_utility;
    
    //First Box by twitch.tv/AlexInVR
    
    init()
    {
    	thread OnPlayerConnect();
       
    }
    
    OnPlayerConnect()
    {
    	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 - -700; 
    	hud.y = hud.y + 35; 
    	hud.alpha = 1;
    	time_text = string(GetTime() / 1000);
    	flag_wait("all_players_spawned");
    	while (1){
    		hud setTimerUp(1);
    		hud setTimer(time_text);
    	}
    	
    }
    
    OnPlayerSpawned()
    {
    	self endon( "disconnect" ); 
    
    	for( ;; )
    	{
    		
    		level waittill( "connected", player ); 
    		self thread game_timer();
    		self SetClientDvars( 
    			"player_backSpeedScale", "1", 
    			"player_strafeSpeedScale", "1");
    
    		
    		wait 3;
    
    		self IPrintLnBold("Timer and speed patch by ^1twitch.tv/^2AlexInVR");
    	}
    	level waittill( "connected", player ); 
    	
    }   
    
  • @AlexInVr Thanks so much, godspeed to you

  • @MrConfetti Welcome my friend ! ๐Ÿ™‚

  • que es lo que hace este mod?

  • @chuyito9154 I'm sorry bro I don't speak spanish, using google translate your comment asks what does this mod do, without offense, I wrote everything in the title and the description of the post my guy, idk what to tell you more ๐Ÿ˜•

Log in to reply