Accessed Nones in Weapon's RenderTexture

Discussions about Coding and Scripting
Post Reply
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Accessed Nones in Weapon's RenderTexture

Post by Barbie »

I noticed some ScriptWarnings on client side, if I connect to a server and the initial given weapon is PulseGun or Minigun2:
ScriptWarning: PulseGun TestmapV1(SB).PulseGun0 (Function Botpack.PulseGun.RenderTexture:0055) Accessed None
These warnings appear only for a short time.
If you want to reproduce it: Set up a server with Game=Botpack.DeathMatchPlus and Mutator=Botpack.PulseArena, connect with a client, start match, terminate client and have a look at its log file.

Both weapons (beside UT_FlakCannon and UT_Eightball, which don't produce such warnings) use RenderTexture() to display the amount of ammo on the weapon, and some debugging has showed that Weapon's variable AmmoType is None for some ticks on the client. AmmoType is set in Wepon.GiveAmmo() what is called in GameInfo.AddDefaultInventory() for example. My guess is that the replication of the variable AmmoType takes some time what causes these 10-20 lines of above ScriptWarnings?
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: Accessed Nones in Weapon's RenderTexture

Post by PrinceOfFunky »

Maybe it's a problem similar to this one:
https://www.ut99.org/viewtopic.php?f=15&t=11735#p91099
"Your stuff is known to be buggy and unfinished/not properly tested"
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Accessed Nones in Weapon's RenderTexture

Post by sektor2111 »

It's not a "Maybe", is a crap - client has weapon but it doesn't have Ammo yet, code is not sanitized so client will deal with Null content - this bug is there since... the beginning.
And this stupidity made me to change these weapons in my custom games and... reaching at new issues, in some Levels Replacements are not executed properly being nullified. Then... it's client side, for server seems an easy task to fix problems but... null ammo rendered, a warshell crapping postrender in deletion process, calling null states in weapon specific to TournamentWeapon, oh well, these are hard to solve if client doesn't have XCGE - and majority doesn't have it - it's probably trouble maker for some of them...
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Accessed Nones in Weapon's RenderTexture

Post by sektor2111 »

Bump @Barbie

I think I know a very cheap solution at these RenderTexture issues. Solution is based on theory "Give It What Wants".

By using complex or less complex coding you can do a Server-Side Actor-Mutator. What it does ?
Perhaps checking Level in PostbeginPlay if it do includes <PulseGun> <minigun2> farts. If yes, enable some feature <bNeedTweak = True> checked in ModifyPlayer. Then each PlayerPawn or TournamentPlayer (Bot is probably not a need in checks because it's not "client"), will load PAmmo and miniammo using... Skaarj method because we have a native bIsPlayer. Using a sanity check, we mind if something is destroying cute ammo. Spawn It/RespawnTime=0.0/Touch(Player) - end of garbage. Later, when player loads Weapon probably he has already specific "ammotype" to render on that fart texture. It might be advisable to not FAST SWITCH weapons in this case...

I hope this solution is more simple than creating whatever useless Voodoo Magic tools.
Post Reply