You know, this is a nice forum. I really like how it has a dedicated Papyrus section. Thank you for hosting it. I guess I'll make a dedicated post here since my newbishness is already getting yelled at Nexus.com for hitching on the back of another post.

I am making a quest mod and I want to reward a sneaky player that locks the Armory with a terminal, to make an upcoming room easier to fight. The Terminal toggles AssaultUpgrade from one to zero. For simplicity sake I just have the Global permanently set to one for now.

But even with the global set to a static 1 before the alias collection Initializes it still does not pick the first guy out of the five and give him an assault rifle. The script compiles fine. All the properties are properly set in the CK. I thought this of all things would be pretty straight forward. What gives?

Code: Select all

Scriptname RTS_GunnerUpgrade extends RefCollectionAlias

GlobalVariable Property AssaultUpgrade Auto

LeveledItem Property DLC04_LL_HandmadeGun_RandomTemplate_Rifle Auto

Event OnAliasInit()
  If(AssaultUpgrade.GetValue() == 1)
    Self.GetAt(1).AddItem(DLC04_LL_HandmadeGun_RandomTemplate_Rifle,1,True)
  EndIf
EndEvent
Trying adding a few Debugs to your script.

Code: Select all

Scriptname RTS_GunnerUpgrade extends RefCollectionAlias


Event OnInit()
   Debug.Notification("Script Initialized")
EndEvent

GlobalVariable Property AssaultUpgrade Auto

LeveledItem Property DLC04_LL_HandmadeGun_RandomTemplate_Rifle Auto

Event OnAliasInit()
   Debug.Notification("EnteredAliasInit")
  If(AssaultUpgrade.GetValue() == 1)
     Debug.Notification("Value was 1")
    Self.GetAt(1).AddItem(DLC04_LL_HandmadeGun_RandomTemplate_Rifle,1,True)
  EndIf
EndEvent


Should help you figure out where it's not being called properly.
Since this is a reference alias as well. You're trying to add an item to a Reference alias.
Ensure you enable your Papyrus log in your Fallout4.ini

Image

Get back with the Papyrus log based on your script and post it here, should help a ton to figure it out.

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 20 on Thu Sep 01, 2016 10:04 pm

Users browsing this forum: No registered users and 1 guest