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

Plutonium

Mr_Miksundefined

Mr_Miks

@Mr_Miks
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • [Support] On-Screen Player Health Information. GSC Code
    Mr_Miksundefined Mr_Miks

    JezuzLizard Thanks alot for the feedback! I really appreciate it!

    For those interested:

    Initialization:

    on_player_spawned()
    {
    	self endon("disconnect");
    	self endon("bled_out");
    
    	while( true )
    	{
    		self waittill("spawned_player");
    		
    		
    		if( !isdefined(self.myHealthTextHud) )
    		{
    			x = 0;
    			y = -20;
    			value = self.health;
    			self.myHealthTextHud = create_health_hud( x, y, value );	
    			// self.myHealthTextHud = newclientHudElem( self );	
    		}
    		
    		self thread printHealth();
    	}
    }
    

    Update loop:

    printHealth()
    {
    	self endon( "bled_out" );
    	self endon( "disconnect" );
    
    	while( true )
    	{
    		wait(1.5);
    		self.myHealthTextHud SetValue( self.health );
    
    	}
    }
    

    And HUD creation:

    // This is a modified version of:
    //common_zombie\maps\_zombiemode_score.gsc:584:	hud = self create_highlight_hud( x, y, value ); 
    create_health_hud( x, y, value )
    {
    	font_size = 1.8; 
    
    	hud = create_simple_hud( self ); //common_zombie_patch\maps\_zombiemode_utility.gsc:111
    	
    	level.hudelem_count++; 
    
    	hud.foreground = true; 
    	hud.sort = 0.5; 
    	hud.x = x; 
    	hud.y = y; 
    	hud.fontScale = font_size; 
    	
    	hud.alignX = "center"; 
    	hud.alignY = "middle"; 
    	hud.horzAlign = "center";
    	hud.vertAlign = "bottom";
    
    	hud.color = ( 0.9, 0.9, 0.0 );
    	
    	hud.alpha = 1;
    	hud.color = ( 1.0, 0.0, 0.0 );
    
    	//	hud.glowColor = ( 0.3, 0.6, 0.3 );
    	//	hud.glowAlpha = 1; 
    	
    	hud.hidewheninmenu = true; 
    	hud.hidewheninmenu = false; 
    	
    	hud.label = "HEALTH: ";
    
    	hud SetValue( value ); 
    
    	return hud; 	
    }
    
    BO2 Modding Support & Discussion

  • [Support] On-Screen Player Health Information. GSC Code
    Mr_Miksundefined Mr_Miks

    Kalitos Hi, I know it's an old and probably solved topic, but in my case I was moding for BO1 zombies and found the same problem with a code very much like yours.

    But this:

    createFontString("Objective" , 1.7);
    

    Doesn't work for me (·__·) ...

    My work around, tested for BO1 zombies (T6):

    on_player_spawned()
    {
    	self endon("disconnect");
    	self endon("death");
    	
    	while( true )
    	{
    		self waittill("spawned_player");
    		
    		
    		if( !isdefined(self.myHealthTextHud) )
    		{
    			self.myHealthTextHud = newclientHudElem( self );	
    		}
    		
    
    		self.myHealthTextHud.alignX = "center";
    		self.myHealthTextHud.alignY = "middle";
    		self.myHealthTextHud.horzAlign = "center";
    		self.myHealthTextHud.vertAlign = "bottom";
    		self.myHealthTextHud.y = -20;
    		self.myHealthTextHud.x = 0;
    
    		self.myHealthTextHud.foreground = true;
    		self.myHealthTextHud.font = "default";
    		self.myHealthTextHud.fontScale = 1.8;
    		self.myHealthTextHud.alpha = 1;
    		self.myHealthTextHud.color = ( 1.0, 0.0, 0.0 );
    		self.myHealthTextHud setText( "HEALTH: "+self.health );
    		
    		self thread printHealth();
    	}
    }
    
    printHealth()
    {
    	self endon( "death" );
    	self endon( "disconnect" );
    
    	while( true )
    	{
    		wait(1.5);
    		self.myHealthTextHud setText( "HEALTH :"+self.health );
    
    	}
    }
    
    
    BO2 Modding Support & Discussion
  • 1 / 1
  • Login

  • Don't have an account? Register

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