Redefining Mainline Definitions
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Redefining Mainline Definitions
Hello (again )
I am now wondering if their is a way to redefine mainline definitions for all mainline units? For example if i would like every unit's {AMLA_DEFAULT} to be changed when my add-on is installed how would this be done? Similarly if i want to modify the {WEAPON_SPECIAL_MAGICAL} definition, is their a way to override the current definitions when my add-on is installed, or override the definitions if a modification is choosen?
Thank you very much for answering all my questions!
I am now wondering if their is a way to redefine mainline definitions for all mainline units? For example if i would like every unit's {AMLA_DEFAULT} to be changed when my add-on is installed how would this be done? Similarly if i want to modify the {WEAPON_SPECIAL_MAGICAL} definition, is their a way to override the current definitions when my add-on is installed, or override the definitions if a modification is choosen?
Thank you very much for answering all my questions!
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: Redefining Mainline Definitions
Runtime cannot affect preprocessing.The_Gnat wrote:or override the definitions if a modification is choosen?
Re: Redefining Mainline Definitions
Thank you, yes i realize that. Is their, however, a way to override the definitions on startup if a add-on is installed.Ravana wrote:Runtime cannot affect preprocessing.The_Gnat wrote:or override the definitions if a modification is choosen?
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: Redefining Mainline Definitions
Thanks for responding, yes i did not really expect to be able to override processor commands like these but was hoping
If anyone has any suggestions of hack ways to do this they would be appreciated!
If anyone has any suggestions of hack ways to do this they would be appreciated!
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
- Lord-Knightmare
- Discord Moderator
- Posts: 2359
- Joined: May 24th, 2010, 5:26 pm
- Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
- Contact:
Re: Redefining Mainline Definitions
I think someone already did something like that in their UMC. Forgot the name though...
EDIT: this is my 1000th post
Code: Select all
#ifdef AMLA_DEFAULT
#undef AMLA_DEFAULT
#endif
# Your new one
#define AMLA_DEFAULT
# Insert whatever code you want here in [advancement] tags
#enddef
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Re: Redefining Mainline Definitions
This only works for units that are loaded after your addon, core should be before.
- Lord-Knightmare
- Discord Moderator
- Posts: 2359
- Joined: May 24th, 2010, 5:26 pm
- Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
- Contact:
Re: Redefining Mainline Definitions
This only works for units that are loaded after your addon, core should be before.
True, but he can make it work for core too by...well, making copies of ALL the existing mainline units (with new ID's)...
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Re: Redefining Mainline Definitions
I think it sounds like a good idea if an add-on 'keeps to itself' and doesn't mess with core or other add-ons.Lord-Knightmare wrote:making copies of ALL the existing mainline units (with new ID's)...
Spoiler:
I have a cunning plan.
Re: Redefining Mainline Definitions
Thanks for all the feedback!
I don't know how the actual game wesnoth was coded but maybe a feature could be added so that before loading all the definitions on the startup the game checks for any add-ons that have an override characteristic, if it finds them then it loads them instead. This would be helpful to a lot of add-ons but it's probably not at all possible.
I would rather not duplicate all the wesnoth units.True, but he can make it work for core too by...well, making copies of ALL the existing mainline units (with new ID's)...
Yes and that doesn't really help me.This only works for units that are loaded after your addon, core should be before.
Yeah, i would like my add-on only to mess around with stuff if a [modification] is selected which means anything i do needs to be after the game starts. Which means that i will probably be forced to use an [event] that modifies peoples AMLA.I think it sounds like a good idea if an add-on 'keeps to itself' and doesn't mess with core or other add-ons.
I don't know how the actual game wesnoth was coded but maybe a feature could be added so that before loading all the definitions on the startup the game checks for any add-ons that have an override characteristic, if it finds them then it loads them instead. This would be helpful to a lot of add-ons but it's probably not at all possible.
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.