[Python] How to reload a custom script?

Making or wanting help making your own asset? Check in here
Post Reply
sertek
Posts: 1
Joined: 2019-11-10 12:09

[Python] How to reload a custom script?

Post by sertek »

Hello,

I'm working on some local python scripts and I would like to know if there is any way to reload a script without having to restart my game every time because it's really painful :-(
AlonTavor
PR:BF2 Developer
Posts: 2991
Joined: 2009-08-10 18:58

Re: [Python] How to reload a custom script?

Post by AlonTavor »

Reload works
https://www.geeksforgeeks.org/reloading-modules-python/

Obviously, any events registered will still use the old functions. You'll need to unregister them and then register them again.
Post Reply

Return to “PR:BF2 Community Modding”