Page 1 of 1

Accessed Nones in Weapon's RenderTexture

Posted: Wed May 03, 2017 1:38 am
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?

Re: Accessed Nones in Weapon's RenderTexture

Posted: Wed May 03, 2017 4:13 am
by PrinceOfFunky
Maybe it's a problem similar to this one:
https://www.ut99.org/viewtopic.php?f=15&t=11735#p91099

Re: Accessed Nones in Weapon's RenderTexture

Posted: Wed May 03, 2017 6:30 am
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...

Re: Accessed Nones in Weapon's RenderTexture

Posted: Sun May 07, 2017 2:04 pm
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.