PDA

View Full Version : Killcam works almost xd



Loveboy
13th July 2013, 17:18
Hi Guys, i have a last killcam tried , but that works almost, if lastkillcam will open, then it show not how he killed the last, that shows what he did the last 7 seconds xD, but i want to know how he killed and not what he did last 7 seconds. here my modify tdm.gsc:



Callback_PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration)
{
........
//somewhere down...

level.lastkillcam = [];
level.lastkillcam["attackernum"] = attackerNum;
level.lastkillcam["delay"] = delay;
level.lastkillcam["psOffsetTime"] = psOffsetTime;
}




endMap()
{
game["state"] = "intermission";
level notify("intermission");

// Randall -->
if (isDefined(level.lastkillcam))
{
players = getEntArray("player", "classname");
for (i = 0; i < players.size; i++)
{
players[i] thread maps\mp\gametypes\_killcam::killcam(level.lastkill cam["attackernum"], level.lastkillcam["delay"], level.lastkillcam["psOffsetTime"]);
}
}
// <--

wait 30;

.........
// Default settings


Somebody know how to fix that?

Btw i don't modify the _killcam.gsc :)

Thank you for every help and every reply!

Loveboy
14th July 2013, 12:05
EDIT: Here problem of video: http://de.xfire.com/video/6066af/

NemanjA
14th July 2013, 12:33
I don't know does the killcam can make a time point when the player is killed.

Loveboy
18th July 2013, 21:03
Hi Guys, i had made a Last Killcam, which not works perfectly.
As first i defined the killcam:



Callback_PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration)
{
...
self.switching_teams = undefined;
self.joining_team = undefined;
self.leaving_team = undefined;

body = self cloneplayer(deathAnimDuration);
thread maps\mp\gametypes\_deathicons::addDeathicon(body, self.clientid, self.pers["team"], 5);

delay = 2; // Delay the player becoming a spectator till after he's done dying
wait delay; // ?? Also required for Callback_PlayerKilled to complete before respawn/killcam can execute

if(doKillcam && level.killcam)
self maps\mp\gametypes\_killcam::killcam(attackerNum, delay, psOffsetTime, true);

// Define Killcam
level.lastkillcam = [];
level.lastkillcam["attackernum"] = attackerNum;
level.lastkillcam["delay"] = delay;
level.lastkillcam["psOffsetTime"] = psOffsetTime;
// <--

self thread respawn();
}


So then i did if the scorelimit was reached, then it will call a other thread, not level thread endMap(); .



checkScoreLimit()
{
waittillframeend;

if(level.scorelimit <= 0)
return;

if(getTeamScore("allies") < level.scorelimit && getTeamScore("axis") < level.scorelimit)
return;

if(level.mapended)
return;
level.mapended = true;

level thread beforeEnd(); // Here was level thread endMap();
}


So now will called the beforeEnd() thread. Here i mad a mini pause and will inform the team, who has win and los.



beforeEnd()
{

game["state"] = "intermission";
level notify("intermission");

alliedscore = getTeamScore("allies");
axisscore = getTeamScore("axis");

level playSound("end");

players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
if(alliedscore == axisscore)
{
players[i] freezeControls(true);
players[i] thread createD();
wait 0.4;
players[i] thread createR();
wait 0.4;
players[i] thread createA();
wait 0.4;
players[i] thread createW2();
}
else if(alliedscore < axisscore) //axis won
{
if(players[i].pers["team"] == "axis")
{
players[i] freezeControls(true);
players[i] thread createW();
wait 0.4;
players[i] thread createI();
wait 0.4;
players[i] thread createN();
}
else if(players[i].pers["team"] == "allies")
{
players[i] freezeControls(true);
players[i] thread createL();
wait 0.4;
players[i] thread createO();
wait 0.4;
players[i] thread createS();
wait 0.4;
players[i] thread createE();
}
else //spectator
{
players[i] iprintlnbold("The Team Axis won!");
players[i] freezeControls(true);
}
}
else if(alliedscore > axisscore) //allies won
{
if(players[i].pers["team"] == "axis")
{
players[i] freezeControls(true);
players[i] thread createL();
wait 0.4;
players[i] thread createO();
wait 0.4;
players[i] thread createS();
wait 0.4;
players[i] thread createE();
}
else if(players[i].pers["team"] == "allies")
{
players[i] freezeControls(true);
players[i] thread createW();
wait 0.4;
players[i] thread createI();
wait 0.4;
players[i] thread createN();
}
else //spectator
{
players[i] iprintlnbold("The Team Allies won!");
players[i] freezeControls(true);
}
}
}
wait(4);
thread lastkc(); //Last Killcam <--
}


So if you see the script, then you will see Win, or Lose or Draw. You will be frozed. After the froze, 4 secounds later, it will call the lastkc() thread.



lastkc()
{
wait 0.1;
if (isDefined(level.lastkillcam))
{
players = getEntArray("player", "classname");
for (i = 0; i < players.size; i++)
{
wait 2;
players[i].kc_skiptext setText(&"");
players[i].kc_title setText(&"Last Killcam");
players[i] thread maps\mp\gametypes\_killcam::killcam(level.lastkill cam["attackernum"], level.lastkillcam["delay"], level.lastkillcam["psOffsetTime"]);
}
wait 10;
level thread endMap();
}
else

wait 10;
level thread endMap();

}


Its almost finished. There is a bug in lastkc() , that will show what he did the last 7 secounds, but there should come how he killed him.

So it will show, the last 7 secounds what he did, before the lastkc() was called.

But it should show HOW he killed him (how normal killcams).

The Killcam is already to showing all.

If someone know what to do, please reply and thank you!!

kung foo man
19th July 2013, 00:30
Merged same question here

IzNoGoD
19th July 2013, 01:30
Dude, there is an easy fix for this.
Its the offsettime or smthing.

Make your own calculations using gettime() when a playe rhas been killed, then you'll be fine...