Author Topic: Toggling Mods with Packages  (Read 1286 times)

I understand the use of packages for modifying existing functions.

However, I've also notice that you can declare new functions within a package.

Is there any reason not to put the entire mod code inside a package and the activate/deactivate it in order to toggle on/off a mod?

As far as I can tell, it seems efficient and effective.

No, there's no reason not to.

There are some mods that are completely in packages for that reason.

I'm sure using packages in such a way makes some floating data that is probably harder on the game than usual. Otherwise, this would be common advise. Also, you can't toggle variables from existing.

I'm sure using packages in such a way makes some floating data that is probably harder on the game than usual.
To a noticeable extent? If not, it seems like this is a pretty good way to pull this sort of thing off.

Also, you can't toggle variables from existing.
Well no stuff. But, you can toggle the functions that use them.

To a noticeable extent? If not, it seems like this is a pretty good way to pull this sort of thing off.

Well no stuff. But, you can toggle the functions that use them.

Well, try it. Run your game normally and check how much RAM, CPU, etc. is being used. Then make one of your Add-Ons run this way and check, then deactivate it and check again. Tell us what the stats are.

And yep, just checking.

I always heard that it's a hit on performance, otherwise I'd do this.

activatePackage()
deactivatePackage?()

activatePackage()
deactivatePackage?()
That's not what he was asking for. He was asking if it was a good way to toggle a mod or not. Please read the thread next time before saying something like this.

That's not what he was asking for. He was asking if it was a good way to toggle a mod or not. Please read the thread next time before saying something like this.
it is a good way