Help fixing WTFMod super auto

  • 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/

Demon_333

FNG / Fresh Meat
Hey, i need help please trying to get the super auto mode working that was from WTFMod.

I had help writing the new code trying to get it to work. It works perfect in solo, but online it doesn't. When you're in super auto mode, the ammo doesn't go down according to how fast it is firing.

It goes down as fast as normal auto. When using semi-auto and you hold down left click. It will drain the ammo down really quickly without any bullets coming out.

Here is WTFMod's original super auto code:

Main class:
Spoiler!


Fire class:
Spoiler!



Then here is the edited files i had help on:

Main class:
Spoiler!


Fire class:
Spoiler!


Help is greatly appreciated.
 

Marco

Active member
May 23, 2009
644
232
43
Finland
You missed the entire point of network replication.

In this case server isn't aware of fire mode changes, so server fire mode is desynced from client.

Also you can not access KFGameType from within FireMode code, unless you are sure it is a server executed code only, because Level.Game does not exist on client.
Fortunately you can check for ZED time with Level.TimeDilation change.

Also it's pointless to do double validation commando super auto firemode check (one in Weapon Toggle and one in FireMode SetAutoMode).

Also AutoMode variable can be used as "byte" to reduce memory usage.

Furthermore you should learn to use Switch/Case whenever possible, for the sake of being more readable code and to optimize how Engine handles multiple statements.

Spoiler!