Most screen logs are not shown

Discussions about Coding and Scripting
Post Reply
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Most screen logs are not shown

Post by PrinceOfFunky »

It's somewhat like the continue of this thread: https://www.ut99.org/viewtopic.php?f=15 ... +not+shown
I found out that if you override the Tick() function from GameInfo, even if you call back the superclass function, most logs will not be shown.
But now, the problem is another similar one, I'm using screen logs (BroadcastMessages). I placed them into a function:
Spoiler

Code: Select all

function Link()
{
	local GRInterpolationPoint GRIP;
	local int HighestPos;
	
	if (!bInitialized)
	{
		HighestPos = -1;
		
		Level.Game.BroadcastMessage("<GRInterpolationPoint> [Link] - Self:"@Self);
	
		bFlipFlop = RacePractice(Level.Game).bFlipFlop;
		
		foreach AllActors(class'GRInterpolationPoint', GRIP)
		{
			if ((GRIP != Self) && (GRIP.Position > HighestPos))
				HighestPos = GRIP.Position;
				
			Level.Game.BroadcastMessage("<GRInterpolationPoint> [Link] - SELF:"$Self@"OTHER_GRIP:"$GRIP@"OTHER_GRIP.Position:"$GRIP.Position); //Always on pos 0.
		}
		
		Level.Game.BroadcastMessage("<GRInterpolationPoint> [Link] - The function is continuing"); //This doesn't always appear.
		Level.Game.BroadcastMessage("<GRInterpolationPoint> [Link] - HighestPosition:"@HighestPos);
		if (HighestPos != -1)
		{
			//This is NOT the first GRIP.
			foreach AllActors(class'GRInterpolationPoint', GRIP)
			{
				Level.Game.BroadcastMessage((GRIP != Self)@(GRIP.Position == HighestPos)@(GRIP.Owner == Owner)@(GRIP.bFlipFlop == RacePractice(Level.Game).bFlipFlop));
				if ((GRIP != Self) && (GRIP.Position == HighestPos) && (GRIP.Owner == Owner) && (GRIP.bFlipFlop == RacePractice(Level.Game).bFlipFlop))
				{
					Position = (GRIP.Position + 1);
					Level.Game.BroadcastMessage("<GRInterpolationPoint> [Link] - Position:"@Position);
					Prev = GRIP;
					Level.Game.BroadcastMessage("<GRInterpolationPoint> [Link] - Prev:"@Prev);
					GRIP.Next = Self;
				}
			}
		}
	}
}
This class is spawned every second and when it's spawned, the above function is called. After being called, the variable bInitialized is set to true, but anyway, this "Link()" function is never called after the first time.
Now, If I get this message to work "Level.Game.BroadcastMessage("<GRInterpolationPoint> [Link] - Self:"@Self);", I will get this other message to work too "Level.Game.BroadcastMessage("<GRInterpolationPoint> [Link] - The function is continuing");".
But it doesn't happen. I only get the first message to work and the second one gets lazy.

Another proof of this weird behaviour is the function that spawns the above class. Indeed, I put some logs over there too:
Spoiler

Code: Select all

function SpawnGRIP(float PrevDistFrames)
{
	local GRInterpolationPoint GRIP;
	
	Level.Game.BroadcastMessage("<RacerThread> [SpawnGRIP] - SPAWNING");
			
	GRIP = Spawn(class'GRInterpolationPoint', racer);
	if (GRIP != None)
	{
		Level.Game.BroadcastMessage("<RacerThread> [SpawnGRIP] - SPAWNED:"@GRIP);
		Level.Game.BroadcastMessage("<RacerThread> [SpawnGRIP] - GRIP.Prev:"@GRIP.Prev);
		//GRIP.calcDistSeconds(PrevDistFrames);
		// The rate of an InterpolationPoint is made of frames.
		if (GRIP.Prev != None)
		{
			Level.Game.BroadcastMessage("<RacerThread> [SpawnGRIP] - NOT DESTROYING:"@GRIP);
			GRIP.Prev.RateModifier = PrevDistFrames / 100;
			GRIP.setLocation(racer.Location);
			GRIP.setRotation(racer.Rotation);
		}
		else
		{
			if (GRIP.Position != 0)
			{
				Level.Game.BroadcastMessage("<RacerThread> [SpawnGRIP] - DESTROYING:"@GRIP);
				GRIP.Destroy();
			}
		}
	}
	else
	{
		Level.Game.BroadcastMessage("<RacerThread> [SpawnGRIP] - GRIP is None");
	}
	
	Level.Game.BroadcastMessage("<RacerThread> [SpawnGRIP] - Function end");
}
What I get from this last function is only the first message "Level.Game.BroadcastMessage("<RacerThread> [SpawnGRIP] - SPAWNING");".

Here's a screenshoot:
Attachments
Logs19.02.2016.png
Logs19.02.2016.png (9.4 KiB) Viewed 927 times
"Your stuff is known to be buggy and unfinished/not properly tested"
User avatar
sektor2111
Godlike
Posts: 6412
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Most screen logs are not shown

Post by sektor2111 »

PrinceOfFunky wrote:... that if you override the Tick() function from GameInfo...
I'm not having have any Tick() in my GameInfo.uc, unless you are talking about another game... and I'm not calling Super.Tick() only if is a real need. Actors are tick-ed by default. Using a child class of another class you might wanna call tick for parent if that parent class has a code needed else it's just another loaded bit pointless.

Edit: The rest of spawning problems are similar with my little tiny A.I. tweak tool. In certain Level (Zone) actors (some types) are not spawning or are immediately in deletion process (missing relevance, some properties not accepted, or other reasons which I don't want to waste time with them). You broadcast if they have been spawned. If not, No Broadcast. Screen log has nothing rammed it shows the reality - they didn't spawn, or this Broadcast is limited so LOG is more relevant...
Post Reply