Jump to content

How to script inject weapon attachments


Recommended Posts

Hey gang.

 

I'm a bit of an amateur tinkerer with the Creation Kit. Some time ago I made a simple plugin to add scaling damage modifiers to each vanilla weapon in the game. The omods work fine and boost weapon damage appropriately... when they show up.

 

It would seem that other weapon mods on the Nexus (and even the Creation Club skin system to some extent) and even possibly AWKCR interfere with my plugin. As such, most weapons now no longer show a damage modifier attachment option at a weapon workbench.

 

I figure that the most logical solution to make my damage omods play nice with other mods is to inject them via a script, such as using a_blind_man's injection toolset.

 

I am not very experienced with this sort of thing and have no idea where to even start. I've compiled all my damage modifiers into appropriate modcols for each weapon type, and then compiled all of those into a master "weapon_damage" modcol.

 

How would I go about having my damage modifiers work in tandem with other mods?

 

Thank you much for your time!

Link to comment
Share on other sites

There are no script functions for Object Mods, so there's no way to inject them by script. But I think there's no reason to do that, you only need to avoid modifying vanilla records because if two mods change the same record only the changes of the mod that is latest in the plugins order will prevail.

 

So what I would suggest is duplicating the vanilla records that you modified, remove the vanilla entries (omods) of your duplicated modcols and leave only your custom ones. The "Target Object Mod Association Keywords" will associate your mods with the weapon.

Link to comment
Share on other sites

Thanks for some of the feedback. The strange thing is, I was under the impression that I did not modify any vanilla records. I have not added my damage modifiers to any formlists or leveled lists, and only wanted them to be available to me, the player.

 

Never mind me.... I did say amateur! The only vanilla records I've modified whatsoever are the vanilla weapons themselves. I added a new attachment point "ap_gun_damagemodifier".

 

I don't know where to go from there, though, in resolving the overlap.

Edited by Vigilant Warden
Link to comment
Share on other sites

I have been thinking this over for a good while now. I think I've come upon a solution that I will try to implement in Creation Kit. I'll leave the weapons themselves completely unaltered and instead attempt to attach the damage modifiers to the receivers instead.

 

I will come back and edit this post with the results regardless if it works or not.

 

EDIT: Works like a charm! Attaching all my omods to the receiver parent slot has completely avoided pretty much every conflict. Woohoo!

Edited by Vigilant Warden
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...