Jump to content

Mark Item as quest item when equipped or all the time


6maniman303

Recommended Posts

Hello!

I would like to mark a helmet as quest item when equipped, but in Fallout 4 things are not as easy as in New Vegas for example. I know that I need to make a quest, make an alias, but I do not know a thing about quest and alias systems. Also the helmets are many, and they are spawned with a script. Why? Because I'm trying to update my True Hidden Helmets mod - right now normal, not hidden helmet is replaced at the moment of getting into player inventory with a hidden duplicate with same mods. But now for stability and other reasons I would like to replace the helmet when equipping it - but it makes other problems - what about dropping equipped helmet, or trading etc.? It would be the hidden one, not normal and we lose control about it. In New Vegas it was easy - mark hidden helmet as quest item. And that's why I need to learn how to set up proper, working quest and alias that would be refilled every time a hidden helmet is equipped (every hidden helmet has attached script so I could just place in OnEquipped event myAlias.ForceRefTo(self) but with my actual quest and alias it doesn't work).

Any help would be greatly appreciated!

Link to comment
Share on other sites

The quest is simple, New, unique Name like myQuestName, Check [ Start Game Enabled ]

 

[ Alias ] Tab new ReferenceAlias, Name myQuestItem check [ Optional ] check [ Quest Object ]

 

Attach this script to your base object forms;

Scriptname myQuestItemScript extends ObjectReference

ReferenceAlias Property Alias_myQuestItem Auto Const Mandatory 

Event OnEquipped(Actor akActor)
   Debug.Trace("myQuestItemScript.OnEquipped " + Self)
   If (akActor == Game.GetPlayer()
      Alias_myQuestItem.ForceRefTo(Self)
   EndIf
EndEvent

Event OnUnequipped(Actor akActor)
   Debug.Trace("myQuestItemScript.OnUnEquipped " + Self)
   If (akActor == Game.GetPlayer())
      Alias_myQuestItem.Clear()
   EndIf
EndEvent

If you have already done most of that and console [ sqv myQuestName ] and find its not running, betcha $10 you didnt check the Optional flag on the alias.

 

typed from memory on my iPad E&OE

Link to comment
Share on other sites

Did as told, and it's not that different from what I had, still not working :/ quest is running, script is mostly the same (I did not include "Mandatory" in property). My two biggest concerns are 1) should I add my quest to that strange thing called story manager? 2) What fill type should I check in the alias in ck? Specific? Create object? Find matching? And maybe I should also check "Allow reuse in quest" as it would be overwritten multiple times. The only source for info about this I found is skyrims creation kit site, but well... it's for skyrim and since skyrim looks like quite much changed. Still thanks! Will try to fiddle with it a little again.

Link to comment
Share on other sites

So if anyone has troubles like me I've found the problem and solution - you can't make an item an alias if it's in your inventory. So OnEquip event you have to take it out from inventory, put it somewhere in the world (easiest is to place it near player), make it alias with myAlias.ForceRefTo(Self) etc. put it back in player inventory, equip it. Clearing alias with .Clear() works without all this mambo jambo.

Link to comment
Share on other sites

That is because when a non unique/persistent object is put in inventory it looses its unique ObjectReference so cant be referred to.

 

If the object has one or more OMODS it becomes unique in inventory and its object reference persists so it can be forced to a reference.

 

Or adding the MustPersist keyword may help.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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