Jump to content

Add remove object once player char uses furniture


Qrsr

Recommended Posts

I started to create a quest which adds a certain item when started... The quest was set to "Start Quest Enabled".

Now, i would like to have it fired once player char uses a certain furniture. By conditions, therefore i removed the Quest flags.

Im unsure how to proceed ... this is what i did:

  1. Tie the quest to a Story Manager Quest/Event Node - e.g. Crafting CraftItem [SMEN:]
  2. Create Enter quest (which is fired once player uses furniture)
  3. Create Exit quest (which is fired once player exits furniture)
  4. Added enter and exit quest to QuestNode [SMQN:]
  5. Set Enter quest to add them item
  6. Set Exit quest to remove the item
  7. Set Enter/Exit based on condition so these dont work against each other

For some reason it does not work ... My knowledge is minimal to this. Any help ? Thanks in advance!

Link to comment
Share on other sites

I would do something like this:

1) Create a handler Quest; check Starts Game Enabled.

2) Add a Quest Alias to it with the Conditions of the target Furniture. The Alias should be flagged as Optional.

2) Attach a quest script to this quest:

Scriptname YOURSCRIPTNAME extends Quest Const

Form Property theItemToAdd Auto Const		; don't forget to fill out these script properties in the editor
Form Property theItemToRemove Auto Const
ReferenceAlias Property FurnitureAlias Auto Const

Event OnQuestInit()
	Actor PlayerActor = Game.GetPlayer()
	RegisterForRemoteEvent(PlayerActor, "OnGetUp")
	RegisterForRemoteEvent(PlayerActor, "OnSit")
EndEvent

Event Actor.OnGetUp(Actor akSender, ObjectReference akFurniture)
	If FurnitureAlias.GetReference() == akFurniture
		akSender.AddItem(theItemToAdd)
	EndIf
EndEvent

Event Actor.OnSit(Actor akSender, ObjectReference akFurniture)
	If FurnitureAlias.GetReference() == akFurniture
		akSender.RemoveItem(theItemToRemove)
	EndIf
EndEvent

 

  • Like 1
Link to comment
Share on other sites

Thank you so much!

This cannot be possible without additional scripting? By using the default Story Manager Events plus condtions in any way?

Link to comment
Share on other sites

I don't think so but I haven't tried that. The Story Manager events are sent on various player actions but they can't be used to do anything beyond starting quests. Whether CraftItem works in Fallout 4 I don't know.

You may be able to add an item to player's inventory without a script with Quest >> Quest Alias >> Fill Type: Create Ref to Object >> Create In: PlayerAlias (assuming the quest has an alias that points to the player) but you'd still to have a script to detect OnGetUp and OnSit.

Link to comment
Share on other sites

20 hours ago, LarannKiar said:

You may be able to add an item to player's inventory without a script with Quest >> Quest Alias >> Fill Type: Create Ref to Object >> Create In: PlayerAlias (assuming the quest has an alias that points to the player) but you'd still to have a script to detect OnGetUp and OnSit.

Yes this works like a charm and im using it awhile back already, but its tricky to setup destruction spells ... for now CraftItem as Story Manager Event does not seem to work but my experience is minimal on this and i need to do more research.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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