Jump to content

Container/Scripting question


py6upouq

Recommended Posts

Mujuiro, look at this. Still doesn't works, can u tell what's wrong with that? And if you know - plz write exact code which will work

Scriptname sssContainerScript01 extends ObjectReference  

ObjectReference Property akIdealItem Auto  
ObjectReference Property akNewItem Auto
ObjectReference Property akContainerIn Auto 
ObjectReference Property akContainerOut Auto

Event OnItemAdded(Form akBaseItem, Int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
       Int givenItem = akBaseItem.GetFormID()
       Int rightItem = akIdealItem.GetFormID()
       If akSourceContainer == Game.GetPlayer() && givenItem == rightItem              
Int yourItemCount = akContainerIn.GetItemCount(akBaseItem)
                      akContainerIn.RemoveItem(akBaseItem, yourItemCount)
                      akContainerOut.AddItem(akNewItem, yourItemCount)
       endIf
endEvent

Edited by py6upouq
Link to comment
Share on other sites

What do you mean by it still doesn't work? Does it compile? Did you set up your properties? What steps in the script complete successfully? Also, is your akContainerIn the container the script is attached to? If so, just use Self.
Link to comment
Share on other sites

What do you mean by it still doesn't work? Does it compile? Did you set up your properties? What steps in the script complete successfully? Also, is your akContainerIn the container the script is attached to? If so, just use Self.

Yea, presented code compiles successfully but nothing happens when I place item(s) in container. I tried debug messages - nothing, script doesn't activates. Also I've tried to attach script on akContainerIn and other objects - nothing! Can you just make needed adjustments?

Link to comment
Share on other sites

What do you mean by it still doesn't work? Does it compile? Did you set up your properties? What steps in the script complete successfully? Also, is your akContainerIn the container the script is attached to? If so, just use Self.

Yea, presented code compiles successfully but nothing happens when I place item(s) in container. I tried debug messages - nothing, script doesn't activates. Also I've tried to attach script on akContainerIn and other objects - nothing! Can you just make needed adjustments?

Without more information from you on how you set everything up, I wouldn't even know where to adjust. :P It's like writing "my car won't start, can you fix it" (and without me seeing your car, knowing if you have gas in the tank, whether you have your car keys, etc.). Why don't you start by providing the following information, and include screen captures if possible:

 

  1. The container that you've attached the script to
  2. The properties you've set up on that container
  3. The exact script you've attached to the container, including your debug lines
  4. Your debug trace log output

Link to comment
Share on other sites

  • Recently Browsing   0 members

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