[Help] Preloading on weapons

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

forrestmark9

FNG / Fresh Meat
Nov 29, 2011
1,110
40
0
I need help with the weapon preloading for Ballistic Weapons, so far it seems the system only changes the Mesh on the client this is bad as Ballistic Weapons needs the mesh on the server-side to not be none as it makes the server play the reload animations, due to it being none AnimEnded is never called by the server in which bIsServerReloading is not set to false

I need to find a way to only update the mesh on the server for the client owning the weapon and set it back to none when unloaded, I tried to work around this by creating static function that is on the server and is called by the client but this just causes the screen to go black when it's called
 
Last edited:

poosh

Grizzled Veteran
Jan 6, 2011
3,403
327
83
Do you extend KFGameType?
If you do, then you can override KFGameType.WeaponSpawned() and WeaponDestroyed().

If you don't then you can monitor KFGameType.InstancedWeaponClasses[] array on server side (e.g. in mutator's timer) and call PreloadAssets() of added weapons and UnloadAssets() of removed.
 

poosh

Grizzled Veteran
Jan 6, 2011
3,403
327
83
But wouldn't it be better to move AnimEnded() code into timer() on tick()?
 

forrestmark9

FNG / Fresh Meat
Nov 29, 2011
1,110
40
0
But wouldn't it be better to move AnimEnded() code into timer() on tick()?

AnimEnded code depends on the anim sequence name

Do you extend KFGameType?
If you do, then you can override KFGameType.WeaponSpawned() and WeaponDestroyed().

If you don't then you can monitor KFGameType.InstancedWeaponClasses[] array on server side (e.g. in mutator's timer) and call PreloadAssets() of added weapons and UnloadAssets() of removed.

Could you give me an example of the none extended one?