Jump to content

Help wanted: Add Attach Parent Slot via script.


stonefisher

Recommended Posts

I wish to be able to add an attach parent slot to any weapon via script, While you can add a mod association keyword using addkeyword, I have been unable to add the slot even though it is technically a keyword by using addkeyword.

 

I know my script works as I have added the attach parent slot in the creation kit to a weapon, spawned it into my inv and then used the script to process all the weapons in my inv. Only the weapon with the attach point already added is getting a weapon mod installed. This shows me the only line of the script that isnt working is the line to try and add an attach parent slot.

 

 

Any ideas on things I could try?

Link to comment
Share on other sites

Wild guesses are fine.

 

The part of the script that dousnt work is the add keyword part:

 

 

 

ObjectReference property ataah_ContainerStorage auto
Keyword property ap_test_ataah auto
ObjectMod Property mod_Legendary_Weapon_PlasmaBullets_ataah Auto const
Event onInit()
AddInventoryEventFilter(none)
Endevent
Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
ObjectReference weapontomod = self.DropFirstObject()
weapontomod.AddKeyword(ap_test_ataah)
weapontomod.AttachMod(mod_Legendary_Weapon_PlasmaBullets_ataah)
ataah_ContainerStorage.additem(weapontomod)
Endevent

 

 

 

The problem seems that even though the creation kit handles it more or less like a keyword, an attach parent slot is not a keyword as far as the game is concerned as far as I can tell.

Link to comment
Share on other sites

It is weird I cant seem to add a mod association keyword to a weapon with a script either and that is shown under keywords on the weapon in the creation kit. :/

 

Does anyone know if that is possible or if there are any mods that have done this? Currently I am not sure you can add a keyword to a weapon.

Link to comment
Share on other sites

You can definitely add keywords to weapons no problem. I'm just not sure about actual attach parents / slots, because those -I think- are only able to be embedded into the actual NIF files for the weapons.

 

Edit: The issue could also be that, in your script, you should to check to see that your dropped weapon Objectreference is actually available and has its 3D loaded before you try adding keywords to it, otherwise it will fail.

Edited by Reneer
Link to comment
Share on other sites

Thats odd, i made it add the mod association keyword using the same script as I used above and no new mod slots appeared.

 

I added it to the weapon in creation kit and it appeared.

 

 

The mods I am adding have no 3d model, they are a bit like the legendary mods in that regard except I have added mod association keywprds and recipes so they can be swapped at a workbench.

Link to comment
Share on other sites

You cannot add an attach parent to an object unless it is via a mod that is being attached. Just adding the keyword doesn't work that way. It has to be assigned as an attach parent type not a general keyword. The only way to add extra slots to the object is to modify the record in the plugin at design time.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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