Jump to content

Script help


Recommended Posts

What is the purpose of the "GoldVault" variable?

Here are two suggestions for debug statements:

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
    If akBaseItem == gold001
		Debug.notification( "Added count = " + count + " items = " + aiItemCount)
        count += aiItemCount
        DisplayPiles(count)
    EndIf
Endevent

Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
    If akBaseItem == gold001
		Debug.messageBox( "Removed count = " + count + " items = " + aiItemCount)
        count -= aiItemCount
        DisplayPiles(count)
    EndIf
Endevent

You could also use Debug.trace, if you know where to find the papyrus logs...

Link to comment
Share on other sites

  On 3/23/2024 at 5:01 PM, xkkmEl said:

What is the purpose of the "GoldVault" variable?

Here are two suggestions for debug statements:

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
    If akBaseItem == gold001
		Debug.notification( "Added count = " + count + " items = " + aiItemCount)
        count += aiItemCount
        DisplayPiles(count)
    EndIf
Endevent

Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
    If akBaseItem == gold001
		Debug.messageBox( "Removed count = " + count + " items = " + aiItemCount)
        count -= aiItemCount
        DisplayPiles(count)
    EndIf
Endevent

You could also use Debug.trace, if you know where to find the papyrus logs...

Expand  

just saw something that was off when i used the debug. I got a message saying: Added gold  *amount added*=0=*amount added*

Edited by wilwhitt56
Link to comment
Share on other sites

  On 3/23/2024 at 4:21 PM, IsharaMeradin said:

Add some debug statements to see how far things are going in the script.

Expand  

I figured out whats wrong with your script. It's working, but in the wrong way. Rather than add to the pile, it's going through each object reference like a step, rather then an addition to the pile. I add 10000 gold, it only shows Vaultloot3. jump to 100k, it only shows Vaultloot6.

Link to comment
Share on other sites

@IsharaMeradinAre you there?

  Reveal hidden contents

 

Edited by wilwhitt56
Link to comment
Share on other sites

I was at work tonight.  So no, I was not 'here'.

So... this boils down to not knowing the full intention.

In most scenarios, one would want to disable anything not associated with the current thing.  That is how this is set up.  It sounds as if you are relying on all the previous "piles" still being present.  If that is the case, remove every instance of the myActive variable that I had added.  The script would then enable any "pile" that is lesser than the value and disable any "pile" that is greater.

Link to comment
Share on other sites

  On 3/24/2024 at 2:48 AM, IsharaMeradin said:

I was at work tonight.  So no, I was not 'here'.

So... this boils down to not knowing the full intention.

In most scenarios, one would want to disable anything not associated with the current thing.  That is how this is set up.  It sounds as if you are relying on all the previous "piles" still being present.  If that is the case, remove every instance of the myActive variable that I had added.  The script would then enable any "pile" that is lesser than the value and disable any "pile" that is greater.

Expand  

Yup, that did it. Thanks for all the help Ishara.

The full Script, in case someone wants to use it:

  Reveal hidden contents

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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