Jump to content

Recommended Posts

Ok. I have created a number of custom NPCs and I would like to assign them to various workshop-related objects within the settlement. So how does one do that within the Ck. I would assume you have to link them to that object or make that object theirs via ownership; but there seems to be something else needed as I have tried both approaches and neither seemed to work.

 

Appreciate your insight.

Edited by pepperman35
Link to comment
Share on other sites

Your actors should have WorkshopNPCScript attached.

 

If you look at WorkshopNPCScript and find "Event OnCommandModeGiveCommand" you will see the script call to assign an actor to resource, which is in the WorkshopObjectScript.

 

To force that in an external script use:

 

(ResourceObject as WorkshopObjectScript).ActivatedByWorkshopActor(ThisActor as WorkshopNPCScript)

 

You need to check the logic in WorkshopObjectScript.ActivatedByWorkshopActor to ensure your context meets the condition tests, or write you own handler without the tests.

Link to comment
Share on other sites

Only because I have recently added some new Workshop Ownership Utilities functions that you may be interested in using in your own testing:

 

(13) Map mark unassigned settlers and resources at the local workshop.

 

(18) Detect issues with local workshop resources (assignment/production)

Link to comment
Share on other sites

I have created a number of custom NPCs and I would like to assign them to various workshop-related objects within the settlement.

Add WorkshopNPCScript. Set first three entries true to get a regular settler, who is comandable and can move and provide. Autofill WorkshopParent entry. Don't forget this! Check if WorkshopParent ist set!!!

I would assume you have to link them to that object.

Link Actor to Workbench, Keyword WorkshopItemKeyword, Link Actor to his workplace e.g. a plant, Keyword WorkshopLinkWork.

Link to comment
Share on other sites

  • 6 months later...

I'm trying to find or create an auto equip armor script, like the script place on the baton and 10MM pistol on the opening Vault 111 section of the game:

Scriptname WeapAutoEquip extends ObjectReference
;Weapon property WeaponToEquip auto const
GlobalVariable property WeaponHasAutoEquipped auto const
int Property FavoriteSlot = -1 auto const
Form WeaponToEquip
Event OnInit()
WeaponToEquip = self.GetBaseObject()
EndEvent
;when the player picks up the weapon, automatically equip the weapon and favorite it
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
;Debug.Trace("**************" + self + "changed container!")
if akNewContainer == Game.GetPlayer()
if WeaponHasAutoEquipped.GetValue() == 0
;set the global so the autoequip only happens the first time
WeaponHasAutoEquipped.SetValue(1)
;autoequipping
Game.GetPlayer().EquipItem(WeaponToEquip)
;favoriting
Game.GetPlayer().MarkItemAsFavorite(WeaponToEquip, FavoriteSlot)
;wait a second to allow the weapon to assemble in the hand before drawing it
Utility.wait(0.5)
Game.GetPlayer().DrawWeapon()
endif
endif
EndEvent

 

I have attempted copying the scripts from the 10mm , altering them and applying them to a modified Vault 111 Jumpsuit with slightly improved resistances, but so far, failing.

 

I've only begun working with the creation kit and just feeling my way around. I'm basically only looking to pickup the armor and put it on without to having the Pipboy, or resorting to showinventory, getting the armor id and then player.equipitem <id>.

 

Any advice would be helpful.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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