Jump to content

huggibee

Members
  • Posts

    16
  • Joined

  • Last visited

Posts posted by huggibee

  1. After tinkering further, I'm able to get the script to fire, and after the first 8hrs, the clean linens are removed and the dirty linens are added -- great! . . . except, after the addition of new clean linens added via a custom crafting station, the script no longer fires. How can I fix this?

     

     

    Scriptname Laundryswap extends ReferenceAlias

    MiscObject Property CL Auto ; clean linens
    MiscObject Property DL Auto ; dirty linens
    Bool isDirty = false
    Actor PlayerRef

    Event OnInit()
    AddInventoryEventFilter(CL) ; add filter for clean item
    AddInventoryEventFilter(DL) ; add filter for dirty item
    PlayerRef = Self.GetReference() as Actor ; cast the object reference that this alias points to as an actor and store it.
    ; if this give compile issues, just change to Game.GetPlayer()
    RegisterForSingleUpdateGameTime(8) ; register for an update in 8 game hours
    ; place a copy of starting linen item in the player alias inventory section
    ; thus when quest is started, the player automatically gets the first item and thus we register for the update here
    EndEvent

    Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
    If akBaseItem as MiscObject == DL ; is the added item dirty linens
    PlayerRef.RemoveItem(CL) ; remove the clean item
    isDirty = true ; indicate that current linen are dirty
    RegisterForSingleUpdateGameTime(8) ; register for an update in 8 game hours
    EndIf
    EndEvent

    Event OnUpdateGameTime() ; timer is up
    If isDirty == false ; are current linens clean
    PlayerRef.AddItem(DL) ; add the dirty linen
    EndIf
    RegisterForSingleUpdateGameTime(8) ; register for an update in 8 game hours
    EndEvent

     

  2. I was using reference alias -- and I placed a copy of the starting linens in the player inventory, but never received them upon game start. So maybe it's an issue of not getting the quest to run even though it's set to run on game start?

     

    Edit: Attempted the script given, but nothing seems to happen. I think it must be an issue with getting the quest to run in the first place. :/

     

    Edit02: So I found the issue with getting the script to run -- one of my ref alias refused to fill and thus delayed the quest. Thank you for your help!

  3. Uff -- I hate to bring this back, but I've been having some major issues with the script up to the point where it no longer works and I can't remember how I got it to work before. At some point the script repetitively added the CLs and DLs over and over regardless of conditions I set, or simply just stopped working. Is there another way around this, or perhaps another script that might work?

  4. Hello! So, I'm VERY new to scripting but am trying my best to learn and create as I go. I'm currently trying to create an activator that adds and removes certain items from the player inventory. Here is what I have, but it isn't working at all. Would anyone be willing to give me a hint as to what it might be or how to make this script better?

     

     

    Scriptname LaundryBrush extends ObjectReference

    Event OnActivate(ObjectReference akActionRef)

    if PlayerRef.GetItemCount(DL) > 0 ; player is carrying enough laundry
    if PlayerRef.GetItemCount(Soap) > 0 ; player is carrying enough soap
    PlayerRef.RemoveItem(DL, 1) ; remove the dirty laundry
    PlayerRef.RemoveItem(Soap, 1) ; remove the soap
    PlayerRef.AddItem(CL, 1) ; add the clean laundry

    elseif _anomad_LB_MSG ; there's a message available so show it
    _anomad_LB_MSG.Show()

    endif
    endif
    endevent


    MiscObject Property CL Auto
    MiscObject Property DL Auto
    MiscObject Property Soap Auto
    Actor Property PlayerRef Auto
    Message Property _anomad_LB_MSG Auto

     

  5. Hello all -- thanks so much for all your help! thus far I've been trying for the life of me these past few days in my free time to get Ishara's lovely script to work, but I just can't. It compiles just fine, and the properties line up. I apply the script to both the clean and dirty linens, and management quest is set to run at the start of the game -- but no dice. I'm not quite sure what it is I'm doing wrong? Any suggestions?

  6. Ah! Thank you so much! Thanks for really putting things into place for me! I can't wait to test it out -- I really appreciate it!

     

    Edit: With the swap script, the compiler seems to have an issue with 11,46 ( ElseIf !akNewContainer || akNewContainer != Actor ; removed to the void, dropped to the ground or put into a container) The error is Actor is not a variable.

  7. It did! Thanks so much for your help thus far and replies! -- but it seems I've run into an issue compiling the script. Would you be willing to help me sort it? Here's the tweaked script and the errors the CK spits at me. I'm not quite sure how to resolve the errors, and google has been little help.

     

     

     

    Scriptname _A_LinensUpdate extends objectreference
    Event yourevent()
    If Actor.IsEquipped(WashedLinens)
    RegisterForUpdate(10)
    EndIf
    EndEvent
    Event OnUpdate()
    If Actor.IsEquipped(WashedLinens)
    Actor.RemoveItem(WashedLinens)
    Actor.AddItem(UnwashedLinens)
    Actor.EquipItem(UnwashedLinens)
    UnregisterForUpdate()
    EndIf
    EndEvent
    MiscObject Property UnwashedLinens Auto
    MiscObject Property WashedLinens Auto

     

     

    Starting 1 compile threads for 1 files...
    Compiling "_A_LinensUpdate"...
    C:\Users\McGui\OneDrive\Documents\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\_A_LinensUpdate.psc(5,14): cannot call the member function IsEquipped alone or on a type, must call it on a variable
    C:\Users\McGui\OneDrive\Documents\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\_A_LinensUpdate.psc(13,13): cannot call the member function IsEquipped alone or on a type, must call it on a variable
    C:\Users\McGui\OneDrive\Documents\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\_A_LinensUpdate.psc(14,16): cannot call the member function RemoveItem alone or on a type, must call it on a variable
    C:\Users\McGui\OneDrive\Documents\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\_A_LinensUpdate.psc(15,16): cannot call the member function AddItem alone or on a type, must call it on a variable
    C:\Users\McGui\OneDrive\Documents\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\_A_LinensUpdate.psc(16,16): cannot call the member function EquipItem alone or on a type, must call it on a variable
    No output generated for _A_LinensUpdate, compilation failed.
  8. Hello! I'm looking for a bit of help with creating a script that would remove a misc object from an inventory after set amount of time and replace it with another misc object. I'm also looking to have this script apply to NPC inventories as well if it's possible, not just the player's. I've been working on a small mod for myself and have everything sorted except for this darned script, but as much as I try, I'm just not experienced enough to write it up myself. If it helps, the misc objects I'm referring to are washed and unwashed linens, and after about 8 in game hours, I'd like the washed linens to "become" unwashed.

     

    If anyone would be willing to help me out with this, I'd be really grateful! Thanks! :happy:

×
×
  • Create New...