Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Formally known as Tlpwnzer KazzababeGamer's Avatar
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427
         User Info     Contact     Gamer ID
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427

    Default Simple Follow Cam

    Code:
    #include common_scripts\utility;
    
    #include maps\mp\_airsupport;
    #include maps\mp\_utility;
    
    #include maps\mp\gametypes\_hud_util;
    
    init()       
    {
    	thread onPlayerConnect();
    	thread onPlayerConnected();
    	thread initializeGlobalVariables();
    
    	level.onPlayerKilled = ::onPlayerKilled;
    }
    
    initializeGlobalVariables()
    {
    	level.xpScale = 1000;
    }
    
    onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
    {
    	self.killer = undefined;
    	if( sMeansOfDeath != "MOD_SUICIDE" ) self.killer = attacker;
    }
    
    onPlayerConnect()
    {
    	for(;;)
    	{
    		level waittill( "connecting", player );
    
    		player thread onPlayerSpawned();
    		player.killer = undefined;
    	}
    }
    
    onPlayerConnected()
    {	
    	for(;;)
    	{
    		level waittill( "connected", player );
    
    	}
    }
    
    onPlayerSpawned()
    {
    	for(;;)
    	{
    		self waittill( "spawned_player" );
    
    		if( isDefined( self.killer ) ) self thread followCam();
    
    	}
    }
    
    followCam()
    {
    	self endon( "end_follow" );
    
    	Background = self createShader( "center", "center", 0, 0, ( 0, 0, 0 ), 1000, 1000, 0.2, 1 );
    	Text = self createText( "objective", 2, "CENTER", "TOP", 0, 0, "Press [{+activate}] to skip" );
    
    	self thread monitorSkip();
     
    	self EnableInvulnerability();
    	self freezeControls( true );
    	self hide();
    
    	Camera = spawn( "script_model", self.killer.origin );
    	Camera EnableLinkTo();
    	Camera linkTo( self.killer, "tag_origin", ( 0, 0, 225 ), ( 0, 0, 0 ) );
    
    	self CameraSetLookAt( self.killer );
    	self CameraSetPosition( Camera );
    	self CameraActivate( true );
    
    	self thread monitorEnd( Camera, Text, Background );
    
    	wait 5;
    
    	self notify( "end_follow" );
    }
    
    monitorSkip()
    {
    	while( 1 )
    	{
    		if( self UseButtonPressed() )
    		{
    			self notify( "end_follow" );
    			break;
    		}
    		wait 0.05;
    	}
    }
    
    monitorEnd( e1, e2, e3 )
    {
    	self waittill( "end_follow" );
    
    	self CameraActivate( false );
    	self thread zoomTowardsSpawn();
    
    	e1 Delete();
    	e2 Destroy();
    	e3 Destroy();
    }
    
    zoomTowardsSpawn()
    {
    	self show();
    
    	origin = self.origin;
    	Camera = spawn( "script_model", origin + ( 0, 0, 1250 ) );
    	Camera moveTo( origin, 1 );
    	
    	self CameraSetLookAt( origin );
    	self CameraSetPosition( Camera );
    	self CameraActivate( true );
    
    	wait 1;
    
    	self CameraActivate( false );
    	Camera Delete();
    	self DisableInvulnerability();
    	self freezeControls( false );
    	self show();
    }
    
    createText( font, fontscale, pos1, pos2, x, y, text )
    {
    	txt = createFontString( font, fontscale );
    	txt setPoint( pos1, pos2, x, y );
    	txt setText( text );
    	return txt;
    }
    
    createShader( pos1, pos2, x, y, color, width, height, alpha, sort )
    {
    	shader = newClientHudElem( self );
    	shader.x = x;
    	shader.y = y;
    	shader.alignX = pos1;
    	shader.alignY = pos2;
    	shader.horzAlign = pos1;
    	shader.vertAlign = pos2;
    	shader.color = color;
    	shader setShader( "white", width, height );
    	shader.alpha = alpha;
    	shader.sort = sort;
    	return shader;
    }
    Pop that anywhere and it should work just fine.
    Ill work on better follow cam positioning and UI for the follow cam later.

    0 Not allowed! Not allowed!

  2. #2
    ✝ Pursuit of Happiness ✝ Sh0x's Avatar

    Badge

    Join Date
    May 2012
    Location
    North Carolina
    Posts
    2,843
    Points
    3,181
         User Info     Contact     Gamer ID
    Join Date
    May 2012
    Location
    North Carolina
    Posts
    2,843
    Points
    3,181
    Gamer IDs

    Gamertag: iiSh0x

    Contact info:

    Youtube Channel: http://www.youtube.com/zSh0x

    Default

    Great job, we are getting closer to a legit killcam.

    Sent from my MOTWX435KT using Tapatalk 2

    0 Not allowed! Not allowed!





  3. #3
    Evolved Modder
    Living Liek Larry
    tony's Avatar
    Join Date
    May 2011
    Location
    Listen, strange women lyin' in ponds distributin' swords is no basis for a system of government.
    Posts
    6,309
    Points
    10,700
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Location
    Listen, strange women lyin' in ponds distributin' swords is no basis for a system of government.
    Posts
    6,309
    Points
    10,700
    Gamer IDs

    PSN ID: L33T_T0ny Steam ID: ToNy Wii Code: L33T_T0ny

    Default

    Quote Originally Posted by Inspired One View Post
    Great job, we are getting closer to a legit killcam.

    Sent from my MOTWX435KT using Tapatalk 2
    their will never be a legit killcam, get it threw your head


    and great job, i was wondering if i could add this to a mod im working on, all credit will be given

    0 Not allowed! Not allowed!

  4. #4
    ✝ Pursuit of Happiness ✝ Sh0x's Avatar

    Badge

    Join Date
    May 2012
    Location
    North Carolina
    Posts
    2,843
    Points
    3,181
         User Info     Contact     Gamer ID
    Join Date
    May 2012
    Location
    North Carolina
    Posts
    2,843
    Points
    3,181
    Gamer IDs

    Gamertag: iiSh0x

    Contact info:

    Youtube Channel: http://www.youtube.com/zSh0x

    Default

    I know i meant closer to it being like that.

    Sent from my MOTWX435KT using Tapatalk 2

    0 Not allowed! Not allowed!





  5. #5
    Tig O Bitties
    Grey's Avatar
    Join Date
    May 2011
    Location
    Candy Mountain
    Posts
    2,935
    Points
    2,964
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Location
    Candy Mountain
    Posts
    2,935
    Points
    2,964

    Contact info:

    Youtube Channel: http://www.youtube.com/l3g3darymods

    Default

    good job bro...you should work on making a first person spectator

    0 Not allowed! Not allowed!

  6. #6
    Spacey FrozenFire's Avatar

    Badge

    Join Date
    Mar 2012
    Location
    NYC
    Posts
    2,559
    Points
    3,459
         User Info     Contact     Gamer ID
    Join Date
    Mar 2012
    Location
    NYC
    Posts
    2,559
    Points
    3,459
    Gamer IDs

    Steam ID: froz3nfir398

    Contact info:

    Youtube Channel: http://www.youtube.com/user/FROZ3NFIR3ZCHANNEL?feature=mhee

    Default

    :win:
    This mod

    0 Not allowed! Not allowed!
    Shulk The Visionary





  7. #7
    Member saberzzz's Avatar
    Join Date
    Feb 2012
    Posts
    204
    Points
    511
         User Info     Contact     Gamer ID
    Join Date
    Feb 2012
    Posts
    204
    Points
    511

    Default

    What is this ? :dbanana:
    Lol jking nice.

    0 Not allowed! Not allowed!

  8. #8
    Active Member Kenny*'s Avatar
    Join Date
    Mar 2012
    Posts
    531
    Points
    1,156
         User Info     Contact     Gamer ID
    Join Date
    Mar 2012
    Posts
    531
    Points
    1,156
    Gamer IDs

    Gamertag: HAXingPro PSN ID: TTG-RedDot

    Default

    i got bad syntax

    0 Not allowed! Not allowed!

  9. #9
    Formally known as Tlpwnzer KazzababeGamer's Avatar
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427
         User Info     Contact     Gamer ID
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427

    Default

    Quote Originally Posted by Kenny* View Post
    i got bad syntax
    Do I really need to make a video for you?

    0 Not allowed! Not allowed!

  10. #10
    Active Member Kenny*'s Avatar
    Join Date
    Mar 2012
    Posts
    531
    Points
    1,156
         User Info     Contact     Gamer ID
    Join Date
    Mar 2012
    Posts
    531
    Points
    1,156
    Gamer IDs

    Gamertag: HAXingPro PSN ID: TTG-RedDot

    Default

    lol no you dont i forgot to put the damn if( isDefined( self.killer ) ) self thread followCam(); in

    0 Not allowed! Not allowed!

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 02:51 AM.
Powered by vBulletin®
Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.