Fully Extended CvCustomEventManager v1
By Impaler, based on the original by dsplaisted
Inspired by dsplaisted's fine idea from this thread:
I have extended it to cover all events, creating an ideal blank slate for Mod makers.
All the Onevent functions of the normal Event Manager have been wraped, Mods calls can be inserted before or after any event is handled. If absolutly nessary The normal call can be skiped entirely, but this should be done only if a MOD needs to interupt the normal sequence of events that execute in the call to the parent. The replacment call will need to replicate all the funtion of the original. Any such MODs will ofcorse be incompatable with each other so try to stick to plain old insertion.
This will serve as a template for Mod makers to use and Mod users to mix various Mods without knowing any real Python. Most mods should require only a single import, a single call and possibly a define.
Place the Python folder in CustomAssets and then add any additional Python files needed for the Mod (XML merging is a whole different story). Place calls for the Mod under the Event that the Mod maker specifies. If you are good with Python this can be deduced even if the Mod maker hasn't been very clear about it. You can Comment out imports and calls to deactivate the Mod rather then remove the file (this also makes it easy to reactivate). If an update for the mod is made you can usualy just overwrite the old Python file to update.
Mod makers should focus on making their Mods as modular and plugable as possible, encoding all the mods
logic in a seperate file/s that gets imported and called rathern then inserting code (even if it is in nice coment blocks) into the EventManager. This will make it nearly impossible to accidently define a function twice, mix up their order or misspell them durring merging.
It is my hope that Moders will begin to use this template for easier plugability, it can also serve as a tool to make Moding easier, in subsequent versions I would like to greatly expand the commenting on each event to the level of helpfull documentation and tips about when/how each event operates. Anyone who has above average insight on this should feel free to post the next version, well just keep adding untill its fully documented.
By Impaler, based on the original by dsplaisted
Inspired by dsplaisted's fine idea from this thread:
I have extended it to cover all events, creating an ideal blank slate for Mod makers.
All the Onevent functions of the normal Event Manager have been wraped, Mods calls can be inserted before or after any event is handled. If absolutly nessary The normal call can be skiped entirely, but this should be done only if a MOD needs to interupt the normal sequence of events that execute in the call to the parent. The replacment call will need to replicate all the funtion of the original. Any such MODs will ofcorse be incompatable with each other so try to stick to plain old insertion.
This will serve as a template for Mod makers to use and Mod users to mix various Mods without knowing any real Python. Most mods should require only a single import, a single call and possibly a define.
Place the Python folder in CustomAssets and then add any additional Python files needed for the Mod (XML merging is a whole different story). Place calls for the Mod under the Event that the Mod maker specifies. If you are good with Python this can be deduced even if the Mod maker hasn't been very clear about it. You can Comment out imports and calls to deactivate the Mod rather then remove the file (this also makes it easy to reactivate). If an update for the mod is made you can usualy just overwrite the old Python file to update.
Mod makers should focus on making their Mods as modular and plugable as possible, encoding all the mods
logic in a seperate file/s that gets imported and called rathern then inserting code (even if it is in nice coment blocks) into the EventManager. This will make it nearly impossible to accidently define a function twice, mix up their order or misspell them durring merging.
It is my hope that Moders will begin to use this template for easier plugability, it can also serve as a tool to make Moding easier, in subsequent versions I would like to greatly expand the commenting on each event to the level of helpfull documentation and tips about when/how each event operates. Anyone who has above average insight on this should feel free to post the next version, well just keep adding untill its fully documented.
Comment