jooonior / tf2-loadouts-script

Loadout specific settings and a resup bind that knows which loadout you're on.
31 stars 2 forks source link

feat: rewrite to be less complex #14

Closed vidhanio closed 1 month ago

vidhanio commented 1 month ago

this does not affect #13, but it makes the entire script much simpler.

jooonior commented 1 month ago

I had something similar to this when I was experimenting with how to fix the script after the Summer 2024 update. The issue with this approach is that you're executing the save file with every class change. This becomes a problem if they ever get so large that executing them noticeably lags the game — not something you want to happen when you're in a server trying to quickly change class.

The current version executes the save files only on startup, where the potential lag is less of a problem since you're not in a server yet. The compex logic around the loadouts.CLASS.X aliases is for tracking the active loadout on each class without having to execute the save files.

vidhanio commented 1 month ago

ahh, makes sense. seems like you already cooked up another rewrite which looks really good, also seems to cut down on the amount of writes a bit. closing :)