Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow mods to change martial art styles / techniques / buffs #14838
Conversation
BevapDin
added some commits
Jan 13, 2016
This comment has been minimized.
This comment has been minimized.
|
Ah nice, thank you. Yeah, all I did for Arcana mod was add the weapons to the styles. I was also pondering whether any weapons in Medieval mod would fit in existing styles, so I assume this PR would allow for that option without conflicts, if I did so. o.o |
This comment has been minimized.
This comment has been minimized.
|
A side note to the process as a whole, 'core' mods should only allow the
'create' label.
|
This comment has been minimized.
This comment has been minimized.
|
Hmm. There are still uses for this even in official mods, as has already been demonstrated. |
This comment has been minimized.
This comment has been minimized.
Just to clarify this: I assume core mods means I don't understand the need for such a restriction. It may not even work in all circumstances, for example if a new item from a core mod needs to be added to a technique. This would require modifying an existing technique object. |
This comment has been minimized.
This comment has been minimized.
|
Huh. I was gonna say, what else could Kevin mean by core? I assumed he meant mods that come with the builds, which is supported by your statement that no mods use that mod type. And since competent use of the modify labels would allow for reduced potential for mod conflict, this sounds like a pointless restriction. |
This comment has been minimized.
This comment has been minimized.
|
Sorry, I should have said "core json". In other words things that aren't
mods.
|
This comment has been minimized.
This comment has been minimized.
|
Ah, that explains it. Sorry. ^^" |
BevapDin commentedJan 13, 2016
One can now edit those objects within a mod, for example adding/removing techniques, buffs, compatible weapons... It uses the
generic_factoryto store/load techniques, styles and buffs and uses theoptionalandmandatoryhelper functions when loading those objects.Example:
{ "type": "martial_art", "id": "style_boxing", "edit-mode": "modify", "name": "Advanced boxing", "remove:static_buffs": [ "boxing_static" ], "add:static_buffs": [ { "id" : "boxing_static_other", "name" : "Other Boxing", "more values" : "for ma_buff here..." } ], "add:techniques" : [ "PRECISE" ], "remove:techniques" : [ "tec_boxing_rapid", "tec_boxing_counter" ], "//": "override the weapon list with an empty one to erase them all", "weapons" : [] }This changes the vectors of
ma_buffinmartialartto be vectors ofma_buffids. Previously thema_buffobjects were loaded and stored in a global map and in themartialartobject (as copy). Now each buff is stored once in the global map. Styles may share the same buff, only one style needs to define the it, the others may only list its id.Currently buffs can only be loaded from within the martial art style, and not as a separate object. Considering that buffs are usually specify to the style anyway, this is probably not a big problem. However, editing buffs is a bit more complicated. One has to "edit" the containing style:
{ "type": "martial_art", "id": "...", "edit-mode": "modify", "name": "Advanced boxing", "//": "removing happens before adding and is here only to prevent adding the buff again", "remove:static_buffs": [ "boxing_static" ], "add:static_buffs": [ { "//" : "This edits the existing buff!", "id" : "boxing_static", "edit-mode": "modify", "name" : "Other Boxing buff", } ] }69fd23e should fix #14817 by adding an overload that does not require the default value and thereby gets rid of the
{}.@chaosvolt The Arcana mod contains some styles, I changed them to override the existing ones. I suspect they only do a few minor changed (add weapon?), if so, you could make them simpler:
{ "type" : "martial_art", "id" : "style_niten", "edit-mode" : "modify", "add:weapons" : [ "bloodscourge", "scourge_staff" ] }Similar works for the buffs ("add:static_buffs").