Jump to content

Add gold to chest on timed schedule


QaxeIsKaze

Recommended Posts

Hello. I am trying to add a script to a chest that will add x amount of gold to the chest on a schedule. I have a quest, have a chest, and I thought I had a script...but the script isn't working for me. I've added the script below to my chest alias, but when I go to edit "Properties" it wants me to add an Object reference...I have no idea what to use for that Object Ref.. I tried clicking on the chest to make IT the object, even though it seemed redundant since the chest is already my alias. Anyway, that didn't work and I don't seem to be allowed to "Auto-fill" either.

 

Also, in my quest stages tab, I've added this to the complete quest stage:

alias_TributeChest.RegisterForUpdateGameTime(24)

 

I'm stumped by how to fill that object reference. Any idea how to make this work? Here is the script:

 

 

ScriptName ChestQuestAliasScript extends ReferenceAlias

ObjectReference Property gold001 auto

Event OnUpdateGameTime()

If GetOwningQuest().GetStage() == 20
self.GetRef().AddItem(gold001, 300)
EndIf

EndEvent

Link to comment
Share on other sites

Thank you.

I tried "MiscItem" however CK wouldn't allow me to save the script, so I changed it to "MiscObject" and then I could save and use auto-fill. That part worked.

 

But the quest /script is still not adding gold to the chest. What should happen is that at my quest's stage 90, the quest ends. After 24 hours gold should appear in the chest. I waited 24 and then 48 game hours, but still nothing happens. Here is the current script:

Scriptname IcicleValleyTributeBoxScript extends ReferenceAlias
MiscObject Property gold001 auto
Event OnUpdateGameTime()
If GetOwningQuest().GetStage() == 90
self.GetRef().AddItem(gold001, 500)
EndIf
EndEvent

Link to comment
Share on other sites

I could be wrong, but I think when a quest "ends" it's no longer running, thus none of its scripts are running, thus the update event would never fire. You might need to extend out to another quest stage, and then set the (new) end quest stage in the update event.

Link to comment
Share on other sites

Thanks for checking back.

 

Lots of things happen in my final stage, cleaning up dead bodies, faction/relationship stuff. So things do fire off, but like you said, maybe a time update wouldn't. So I moved my time update to another, earlier stage but it doesn't load up the coins like it should yet. I'm missing something somewhere.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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