CFGFactory will be ceasing all operations on 13.03.2026. That will be the final date of this site. Thank you.

Navigation

Promodcod4 Help me

ROBERRRT

Member

How to add music in killcam?


Posted on 08.03.2017 / 18:19

REPLIES

JEENNN:]

Member

#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
#include maps\mp\gametypes\endroundmusic;

finalKillcamWaiter()
{
if ( !level.inFinalKillcam )
return;

while (level.inFinalKillcam)
wait(0.05);
}

postRoundFinalKillcam()
{
level notify( "play_final_killcam" );
song = (1+randomInt(17));
level thread playSoundOnAllPlayers( "endround" + song );
maps\mp\gametypes\_globallogic_utils::resetOutcomeForAllPlayers();
finalKillcamWaiter();
}

startFinalKillcam(
attackerNum,
targetNum,
killcamentityindex,
sWeapon,
deathTime,
deathTimeOffset,
offsetTime,
attacker,
victim
)
{
if(attackerNum < 0)
return;
recordKillcamSettings( attackerNum, targetNum, sWeapon, deathTime, deathTimeOffset, offsetTime, attacker, killcamentityindex, victim );
startLastKillcam();
}

startLastKillcam()
{
if ( level.inFinalKillcam )
return;

if ( !isDefined(level.lastKillCam) )
return;

level.inFinalKillcam = true;
level waittill ( "play_final_killcam" );

players = level.players;
for ( index = 0; index < players.size; index++ )
{
player = players[index];
player closeMenu();
player closeInGameMenu();
player thread finalKillcam();
}

wait( 0.1 );

while ( areAnyPlayersWatchingTheKillcam() )
wait( 0.05 );

level.inFinalKillcam = false;
}


areAnyPlayersWatchingTheKillcam()
{
players = level.players;
for ( index = 0; index < players.size; index++ )
{
player = players[index];
if ( isDefined( player.killcam ) )
return true;
}

return false;
}

waitKillcamTime()
{
self endon("disconnect");
self endon("end_finalkillcam");

wait(self.killcamlength - 0.07);
self notify("end_finalkillcam");
}

waitFinalKillcamSlowdown( startTime )
{
self endon("disconnect");
self endon("end_finalkillcam");
secondsUntilDeath = ( ( level.lastKillCam.deathTime - startTime ) / 1000 );
deathTime = getTime() + secondsUntilDeath * 1000;
waitBeforeDeath = 2;
wait( max(0, (secondsUntilDeath - waitBeforeDeath) ) );
setTimeScale( 1, int( deathTime - 500 ));
wait( waitBeforeDeath );
setTimeScale(1,getTime());
}
setTimeScale(to,time)
{
difference = (abs(getTime() - time)/1000);
timescale = getDvarFloat("timescale");
if(difference != 0)
{
for(i = timescale*20; i >= to*20; i -= 1 )
{
wait ((int(difference)/int(getDvarFloat("timescale")*20))/20);
setDvar("timescale",i/20);
}
}
else
setDvar("timescale",to);
}
endKillcam()
{
if(isDefined(self.fkc_timer))
self.fkc_timer.alpha = 0;

if(isDefined(self.killertext))
self.killertext.alpha = 0;

self.killcam = undefined;

//self maps\mp\gametypes\_globallogic::spawnSpectator();
}

checkForAbruptKillcamEnd()
{
self endon("disconnect");
self endon("end_finalkillcam");

while(1)
{
if ( self.archivetime = 0 )
self thread setKillCamEntity( level.lastKillCam.entityindex, 0 - killcamstarttime - 100 );
self.killcamtargetentity = level.lastKillCam.targetentityindex;
self.archivetime = killcamoffset;
self.killcamlength = killcamlength;
self.psoffsettime = level.lastKillCam.offsettime;

self allowSpectateTeam("allies", true);
self allowSpectateTeam("axis", true);
self allowSpectateTeam("freelook", false);
self allowSpectateTeam("none", false);

wait 0.05;

if ( self.archivetime maxtime)
camtime = maxtime;
if (camtime < .05)
camtime = .05;
}

return camtime;
}

calcPostDelay()
{
postdelay = 0;

// time after player death that killcam continues for
if (getDvar( "scr_killcam_posttime") == "")
postdelay = 2;

else
{
postdelay = getDvarFloat( "scr_killcam_posttime");
if (postdelay < 0.05)
postdelay = 0.05;
}

return postdelay;
}
addKillcamKiller(attacker,victim)
{
self.villain = createFontString( "default", level.lowerTextFontSize );
self.villain setPoint( "CENTER", "BOTTOM", -500, -110 );
self.villain.alignX = "right";
self.villain.archived = false;
self.villain setPlayerNameString( attacker );
self.villain.alpha = 1;
self.villain.glowalpha = 1;
self.villain.glowColor = level.randomcolour;
self.villain moveOverTime( 4 );
self.villain.x = -20;

self.versus = createFontString( "default", level.lowerTextFontSize );
self.versus.alpha = 0;
self.versus setPoint( "CENTER", "BOTTOM", 0, -110 );
self.versus.archived = false;
self.versus setText( "vs" );
self.versus.glowColor = level.randomcolour;
self.versus fadeOverTime( 4 );
self.versus.alpha = 1;

self.victim = createFontString( "default", level.lowerTextFontSize );
self.victim setPoint( "CENTER", "BOTTOM", 500, -110 );
self.victim.alignX = "left";
self.victim.archived = false;
self.victim setPlayerNameString( victim );
self.victim.glowalpha = 1;
self.victim.glowColor = level.randomcolour;
self.victim moveOverTime( 4 );
self.victim.x = 20;

if ( isDefined( self.carryIcon ) )
self.carryIcon destroy();
}
addKillcamTimer(camtime)
{
if (! isDefined(self.fkc_timer))
{
self.fkc_timer = createFontString("big", 2.0);
self.fkc_timer.archived = false;
self.fkc_timer.x = 0;
self.fkc_timer.alignX = "center";
self.fkc_timer.alignY = "middle";
self.fkc_timer.horzAlign = "center_safearea";
self.fkc_timer.vertAlign = "top";
self.fkc_timer.y = 50;
self.fkc_timer.sort = 1;
self.fkc_timer.font = "big";
self.fkc_timer.foreground = true;
self.fkc_timer.color = (0.85,0.85,0.85);
self.fkc_timer.hideWhenInMenu = true;
}
self.fkc_timer.y = 50;
self.fkc_timer.alpha = 1;
self.fkc_timer setTenthsTimer(camtime);
}
setKillCamEntity( killcamentityindex, delayms )
{
self endon("disconnect");
self endon("end_killcam");
self endon("spawned");

if ( delayms > 0 )
wait delayms / 1000;

self.killcamentity = killcamentityindex;
}


Posted on 09.03.2017 / 15:39

ROBERRRT

Member

It does not work


Posted on 09.03.2017 / 20:46

JEENNN:]

Member

It will not work without these functions
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
#include maps\mp\gametypes\endroundmusic;

Also you have to add the songs in the mod.ff
Regards!


Posted on 11.03.2017 / 15:46

ROBERRRT

Member

It does not work
I put endroundmusic.gsc and finalkillcam.gsc in
maps \ mp \ gametypes
I also add thread maps \ mp \ gametypes \ _endroundmusic :: init (); In globallogic.gsc
Then I add endroundmusic and finalkillcam in mod.csv


Posted on 14.03.2017 / 21:05

JEENNN:]

Member

You are doing my friend wrong
In the soundaliases / promod.csv add the songs endround1 until 25 or 20
In killcam is where you add these functions not in the globalogic
#include maps \ mp \ _utility;
#include maps \ mp \ gametypes \ _hud_util;
#include maps \ mp \ gametypes \ endroundmusic;
In the globalogic you can only make the finallkillcam work.
Sorry my english is not very good greetings


Posted on 15.03.2017 / 11:21

ROBERRRT

Member

Can you give me the raw promod only with music? It is very difficult for me this please


Posted on 15.03.2017 / 20:50

JEENNN:]

Member

Not,sorry :c


Posted on 17.03.2017 / 18:41

minjj

Member

I can share it, talk to me by private message


Posted on 17.03.2017 / 22:31

Post reply

ONLY USERS CAN POST REPLIES.