Engine.Killed - Removing some Accessed None

Discussions about Coding and Scripting
Post Reply
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Engine.Killed - Removing some Accessed None

Post by sektor2111 »

We can see some times nice maps with dumb setup (guessing based) which however can be fixed. Let's see what's going on.
[attachment=0]Bad_Zone.JPG[/attachment]

Heading to some results:
Console wrote: ScriptWarning: CTFGame CTF-300k-w00tious.CTFGame1 (Function Engine.GameInfo.Killed:00DD) Accessed None
ScriptWarning: CTFGame CTF-300k-w00tious.CTFGame1 (Function Engine.GameInfo.Killed:00E5) Accessed None
ScriptWarning: CTFGame CTF-300k-w00tious.CTFGame1 (Function Engine.GameInfo.Killed:010B) Accessed None
ScriptWarning: CTFGame CTF-300k-w00tious.CTFGame1 (Function Engine.GameInfo.Killed:0113) Accessed None
For no reason and nothing special we have some trash coming.
Let's see. Engine when is about SpecialDamage is expecting some Killer having a super duper Weapon. Actually I don't know if any of you could see a zone firing weapon against a player and being Pawn in the same time... :loool:
So we have to remove these maps ? Perhaps not really. We go for a timed delayed action - leave engine to breath in Postbegins and a bit later we call a single time some function from a tweaker or such:

Code: Select all

function CheckZones()
{
	local ZoneInfo Z;

	foreach AllActors (class 'ZoneInfo',Z)
	{
		if (Z.DamageType == 'SpecialDamage')
		{
			Z.DamageType = 'Fell';
			Z.DamageString = "DumbSetupType";
		}
	}
}
Now I must write this into my game-types...
Attachments
Bad_Zone.JPG
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Engine.Killed - Removing some Accessed None

Post by Barbie »

I think you are on a wrong track: GameInfo.Killed() does simply not check if the killers weapon is None but accesses Killer.Weapon.ItemName:

Code: Select all

if ( (DamageType == 'SpecialDamage') && (SpecialDamageString != "") )
{
	BroadcastMessage( ParseKillMessage(
			Killer.PlayerReplicationInfo.PlayerName,
			Other.PlayerReplicationInfo.PlayerName,
			Killer.Weapon.ItemName,
			SpecialDamageString
			),
		false, 'DeathMessage');
I'm also just messing around with the process of taking damage and killed events and considering to rewrite GameInfo.Killed() completely.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Engine.Killed - Removing some Accessed None

Post by sektor2111 »

Barbie wrote:I think you are on a wrong track
Oh, really ? I cannot be so sure..
If you call Weapon you are already call "None". Actually "Killer" is "None" too - ZONE killed Pawn. Imagine that I've done some checks and it's faster to deal with a normal death condition that spying strings all the time in "Killed". Perhaps you don't understand the deal, you have posted the issue - then read it again and go figure... a Few moths ago I've written some Killed different for MH2 but I'm gonna remove that crap because solution is more simple.
If condition is completed then are called more things unexistent "Killer" and "Killer.Weapon" NONE of them is VALID here. By Screwing that stupid SpecialDamage problem is solved automated without writing stories in "Killed". As usual I go for simple tweaks (already tested). In this case we have "NONE" as Killer and original DM knows what to do for that case.
More detail:
- it's called Killer.PlayerReplicationInfo = NONE;
- it's called Killer (replication Based) as well = None;
- it's called Killer.Weapon = None;
- and again Killer as well (weapon based) = None.
To sumarize we have 4 Accessed Nones the same as in first post. :sleep:

I've uploaded that map into play-repository for playing it 20 times (I like that swjumpad after all).
Last edited by sektor2111 on Sat Jul 16, 2016 5:36 pm, edited 1 time in total.
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Engine.Killed - Removing some Accessed None

Post by Barbie »

sektor2111 wrote:More detail [of GameInfo.Killed()]
There you can see that Killer is not checked for None before accessing it. It's a problem of GameInfo.Killed(), not of map setup. Imagine a looping crunching mover - Killer should also be None there and should cause these Access Nones, too.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Engine.Killed - Removing some Accessed None

Post by sektor2111 »

Now you are on a wrong track. Mover.Instigator = Killer - read chapter mover. Else I don't recall about Movers with SpecialDamage (not yet) and special crap damage strings.

Why you just don't compile that tiny thing and see effects ? Is more simple to post a reply first ? And YES map is bad set - replace string as in Code VIA Editor and errors will go away. It's that hard to check ? Because I've checked this already and I'm not bullshiting - I repeat I have Seen this already and this is a new tweak. Map is wrong set, end of story. If you want I'll show how to configure a kill zone, no, wait, just check default kill zones...

For enlightning, RocketX which is a weapon held by a Player has a SpecialDamage and not zones.
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Engine.Killed - Removing some Accessed None

Post by MrLoathsome »

http://www.ecoop.tk/load/utspfix/1-1-0-42

Code: Select all

function Killed(pawn killer, pawn Other, name damageType)
{
	local int NextTaunt, i;
	local bool bAutoTaunt, bEndOverTime;
	local Pawn P, Best;

log(killer@Other@damageType);

	if ((Killer != None) && (Killer != Other) && (other.PlayerReplicationInfo != None) && (killer.PlayerReplicationInfo != None))
	{
		if (damageType == 'Decapitated')
		{
			if ((Level.Game.LocalLog != None) && (Other.PlayerReplicationInfo != None))
				Level.Game.LocalLog.LogSpecialEvent("headshot", Killer.PlayerReplicationInfo.PlayerID, Other.PlayerReplicationInfo.PlayerID);
			if ((Level.Game.WorldLog != None) && (Other.PlayerReplicationInfo != None))
				Level.Game.WorldLog.LogSpecialEvent("headshot", Killer.PlayerReplicationInfo.PlayerID, Other.PlayerReplicationInfo.PlayerID);
		}
	}
	if ((Killer != None) && (killer.PlayerReplicationInfo != None) && (damageType == 'Decapitated') && (!Other.bIsPlayer))
		Killer.ReceiveLocalizedMessage(class'DecapitationMessage');
	if (!bMonsterTeam || ((Killer != None) && (killer.PlayerReplicationInfo != None) && (Other.PlayerReplicationInfo != None)))
	{
		Super.Killed(killer, Other, damageType);
	}
	else
	{
		if ((Killer != None) && (killer.PlayerReplicationInfo == None) && (Killer != Other))
		{
			if (bMonsterTeam)
			{
				Dummy.PlayerReplicationInfo.PlayerName = Killer.GetHumanName();
				if ((Other.bIsPlayer) && (!Killer.IsA('StationaryPawn'))) ScoreKill(Dummy, Other);
			}
			Super(GameInfo).Killed(killer, Other, damageType);
			if ((!bFirstBlood) && (Other.PlayerReplicationInfo != None) && (!Self.IsA('TrainingDM')))
			{
				bFirstBlood = True; PlayerPawn(Other).ServerReStartPlayer();
				if (bMonsterTeam) BroadcastLocalizedMessage( class'FirstBloodMessage', 0, Dummy.PlayerReplicationInfo );
			}
			if (bMonsterTeam && bScoreSPvsSP && !Other.bIsPlayer && !Killer.IsA('StationaryPawn'))
			{
				Dummy.PlayerReplicationInfo.Score += 1; Dummy.PlayerReplicationInfo.Deaths += 1;
			}
			if (bMonsterTeam)
			{
				Dummy.PlayerReplicationInfo.PlayerName = "The Monster Team";
			}
		}
		else
		{
			Super(GameInfo).Killed(killer, Other, damageType);
		}

		if ( !bTeamGame )
		{
			if ( bOverTime )
			{
				bEndOverTime = true;
				//check for clear winner now
				// find individual winner
				for ( P=Level.PawnList; P!=None; P=P.nextPawn )
					if ( P.bIsPlayer && ((Best == None) || (P.PlayerReplicationInfo.Score > Best.PlayerReplicationInfo.Score)) )
						Best = P;

				// check for tie
				for ( P=Level.PawnList; P!=None; P=P.nextPawn )
					if ( P.bIsPlayer && (Best != P) && (P.PlayerReplicationInfo.Score == Best.PlayerReplicationInfo.Score) )
						bEndOverTime = false;

				if ( bEndOverTime )
				{
					if (bMonsterTeam) Dummy.PlayerReplicationInfo.PlayerName = "The Monster Team";
					if ( (FragLimit > 0) && (Best.PlayerReplicationInfo.Score >= FragLimit) )
						EndGame("fraglimit");
					else
						EndGame("timelimit");
				}
			}
			else if ( (FragLimit > 0) && (killer != None) && (killer.PlayerReplicationInfo != None)
				&& (killer.PlayerReplicationInfo.Score >= FragLimit) )
					{ EndGame("fraglimit"); }
			else if ((FragLimit > 0) && (killer != None) && (!killer.bIsPlayer) && (bMonsterTeam)
				&& (Dummy.PlayerReplicationInfo.Score >= FragLimit))
					{ Dummy.PlayerReplicationInfo.PlayerName = "The Monster Team"; EndGame("fraglimit"); }
		}

	}

	if ((bScoreDeathsBySP) && (Other.bIsPlayer) && (Killer != None) && (killer.PlayerReplicationInfo == None)) Other.PlayerReplicationInfo.Deaths += 1;
		if (bMonsterTeam && (Other.PlayerReplicationInfo == None))
		{
			if ( Dummy.Spree > 4 )
				EndSpree(Killer, Dummy); 
			Dummy.Spree = 0;
		}
		else
		{
			if ( Other.Spree > 4 )
				EndSpree(Killer, Other); 
			Other.Spree = 0;
		}

		if ((killer == None) || (Other == None) || ((Killer != None) && (Killer.IsA('StationaryPawn'))))
			return;

		if ( !bFirstBlood )
			if ((Killer.bIsPlayer && (Killer != Other)) || (!Killer.bIsPlayer && bMonsterTeam && (Killer != Other)))
				if (!Self.IsA('TrainingDM'))
				{
					bFirstBlood = True;
					if (!Killer.bIsPlayer && bMonsterTeam)
						BroadcastLocalizedMessage( class'FirstBloodMessage', 0, Dummy.PlayerReplicationInfo );
					else
						BroadcastLocalizedMessage( class'FirstBloodMessage', 0, Killer.PlayerReplicationInfo );
				}

		if ( BotConfig.bAdjustSkill && (killer.IsA('PlayerPawn') || Other.IsA('PlayerPawn')) )
		{
			if ( killer.IsA('Bot') )
				BotConfig.AdjustSkill(Bot(killer),true);
			if ( Other.IsA('Bot') )
				BotConfig.AdjustSkill(Bot(Other),false);
		}
		
		if (bMonsterTeam && (Killer.PlayerReplicationInfo == None) && (Killer != Other))
		{
			Dummy.Spree++;
			if ( Dummy.Spree > 4 )
				NotifySpree(Dummy, Dummy.Spree);
		}
		else
		if ( Other.bIsPlayer && (Killer != None) && Killer.bIsPlayer && (Killer != Other) 
			&& (!bTeamGame || (Other.PlayerReplicationInfo.Team != Killer.PlayerReplicationInfo.Team)) )
			{
				Killer.Spree++;
				if ( Killer.Spree > 4 )
				NotifySpree(Killer, Killer.Spree);
			} 

		bAutoTaunt = ((TournamentPlayer(Killer) != None) && TournamentPlayer(Killer).bAutoTaunt);
		if ( ((Bot(Killer) != None) || bAutoTaunt)
			&& (Killer != Other) && (DamageType != 'gibbed') && (Killer.Health > 0)
			&& (Level.TimeSeconds - LastTauntTime > 3) )
		{
			LastTauntTime = Level.TimeSeconds;
			NextTaunt = Rand(class<ChallengeVoicePack>(Killer.PlayerReplicationInfo.VoiceType).Default.NumTaunts);
			for ( i=0; i<4; i++ )
			{
				if ( NextTaunt == LastTaunt[i] )
					NextTaunt = Rand(class<ChallengeVoicePack>(Killer.PlayerReplicationInfo.VoiceType).Default.NumTaunts);
				if ( i > 0 )
					LastTaunt[i-1] = LastTaunt[i];
			}	
			LastTaunt[3] = NextTaunt;
	 		killer.SendGlobalMessage(None, 'AUTOTAUNT', NextTaunt, 5);
		}
		if ( bRatedGame )
			RateVs(Other, Killer);

}

Been quite a while since I wrote that stuff. Probably has all kinds of issues, but seems to be working fine so far after 4 years of testing.
Log files on my servers are very clean.
blarg
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Engine.Killed - Removing some Accessed None

Post by sektor2111 »

I had the same clean console until I was playing some cute map that had a sort of kill-zone with a stupid message "%O was electrified by %K" assigned to that zone + SpecialDamage (no shit - nothing special than another code to add)- it's fascinating how some people were guessing in their work because ZoneInfo is not Pawn. Then I've been looking at everything and I realized that engine wants WEAPON with a SpecialDamage not a ZONE triggering a no Killer related death.
Aside: If you check class TrapSpringer that thing is trying to fix problems from DM-Pressure - EPIC's Lulu - engine is not supposed for such deals. Usually a kill zone should have damage-type set "Fell" "Corroded", "Burned", etc and not that "SpecialDamage" because it really doesn't make any sense, it's nothing so special after all, no different effects or lights or anything, just a death by falling in wrong place.
If string is a normal damaging related one, nothing bad occurs. There are a lot of maps set correctly with 0 issues, this one is only goofing with engine so the fix is very simple: Screw crap out and done.
Codes which I have added in Killed are for monsters and they do work fine, now I'm not gonna waste time for zones and such super duper None things.

Then we have some occurence: DM-Pressure
Bot A is triggered by Bot B entered in Chamber. Bot B starts to be depresurized, during this time a monster kills Bot A which is taking a small pause. During pause, Bot B will die, triggered by Bot A which no longer has weapon (or by a player which has left). The console will probably looks similar - and that's all about trash kills.
My solution won't assign a kill indeed for killer activating chamber and neither other errors, moron dying in chamber is part of an automated kill and that's all.
Another chapter: Multiple kills into heavy combat - results in a lot of autotaunts which were annoying me as hell. As result I have removed those idiotic spammy things because... are not good for kids anyway and I don't need such useless codes.
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Engine.Killed - Removing some Accessed None

Post by MrLoathsome »

Good observations.

I had looked at that issue with the damagetype either being not implemented or implemented incorrectly by mappers, and there really
is no good way to catch and fix them all via mutator I don't think. Not easily anyway....
There are just too many way it can be done wrong by the mapper. :barf:

We just have to accept that there are some cases where there really is no practical way to eliminate all Accessed None errors.

Such as a situation where you fire at a monster, and it then fires back before your projectile kills it. When the monsters projectile kills you, the monster
is gone. Killer == None. This will always kick out an Accessed None error.

Re: Autotaunts. Isn't there some default setting for turning that on/off?
blarg
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Engine.Killed - Removing some Accessed None

Post by Barbie »

MrLoathsome wrote:Killer == None. This will always kick out an Accessed None error.
Just rewrite GameInfo.Killed() as I suggested above to get rid of that Accessed Nones.
MrLoathsome wrote:Re: Autotaunts. Isn't there some default setting for turning that on/off?
In DeathMatchPlus.Killed() I noticed this lines

Code: Select all

bAutoTaunt = ((TournamentPlayer(Killer) != None) && TournamentPlayer(Killer).bAutoTaunt);
if ( ((Bot(Killer) != None) || bAutoTaunt)
...
Perhaps you can set TournamentPlayer.bAutoTaunt=false on player login.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Engine.Killed - Removing some Accessed None

Post by sektor2111 »

For autotaunt removal I have simply removed that code and jumping over it and then calling GameInfo only in normal conditions else "GoTo BottomOfCode" (replacement for "return;" - which I'm not gonna use as I did before). So all "killed" functions used by me are way simple without any autotaunt :agree1: . Of course, I have added new things in exchange... Off topic...
MrLoathsome wrote: When the monsters projectile kills you, the monster
is gone. Killer == None. This will always kick out an Accessed None error.
Nope... All projectiles owned by monster are deleted at once with monster - actually I have a double guard - even for player and purpose is to NOT have a Null byte (attitude) developed because that crap might stuck game completely. As you can see I'm not interested to host Accessed Nones... and neither other Null things accessed.
Here I mention the condition for "Killer == None" - broadcast when monster was falling in crap - amazingly I don't see that broadcast at MonsterSpawn types (I have spoke about MonsterSpawn things already and know what I'm saying).
Last time when I was trying to rotate some effects in a "TakeDamage" I went to a server-quit with a gracefull exit not a crash - heh, old memories... These are just occurrences without much Accessed Nones but capable of halting a server... and very... silently.
Post Reply