Jump to content

Recommended Posts

Posted (edited)

Hi there! I know a lot of scripting and modding for Skyrim is kind of old but I love the game and still playing. Well, late in the game so to speak, i have decided to make myself a player home. So far so good! I've done alot and loving the way it looks and feels but the scripting.......I am having trouble. So as simple as my request is can you please help? I've done a lot of auto sorting scripts already which was a chore but it works!

 

I have an activator in front of some static items. Currently it is linked to a chest with a linkeddummyscript. What I want to do is Event OnActivate, remove all items in chest and give to player. I know what I want to do but I don't understand yet how to speak the language.

 

Another one: In my auto sorters I am using:

If akBaseItem.HasKeyword(VendorItemIngredient);MoveTo
RemoveItem(akBaseItem, aiItemCount, True, JL_Alchemy_Wardrobe)
debug.notification("Item Auto Sorted")
Thats great but what if I wanted to just speak about one item? Say an ingot? it would be MiscObject Property? How would I modify the script above to understand it? How would I incorporate a Form List into that?
Thanks so much!
Edited by Chris20201986
  • Replies 44
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Moving all items from a container to the player. There are multiple ways to do this and some are better than others. Some are fast but can cause stack dumps with too many items. Some are slow and can tie up processing for a few minutes but won't cause stack dumps. Here are a few simple examples. There are probably additional possibilities not listed.

 

  Reveal hidden contents

If you want to move one specific item, it may be best to have its own property. But if you have a formlist with that object already listed, you could use the index to get that item. But both require that you know ahead of time that you want to transfer that one specific item. Adapting the earlier examples to show how to move a single object from a container.
  Reveal hidden contents

 

 

It should be mentioned that stack dumps are when papyrus gets overloaded and dumps what is pending in order to continue. Often times it will appear harmless in game. However, there are times when a script not even running the event that caused the overload gets included in the dump. This is a problem when the script is supposed to advance a quest or update data used elsewhere.

 

 

Posted

Thanks so much for the response! I stumbled on your auto sorting script mod today and was all up in it. Thank you it is all helpful!

Posted (edited)

Nothing special here, I only want to show IsharaMeradins very nice code samples inside a script with different functions.

 

xyzSample_GiveItemsToPlayerScript

  Reveal hidden contents

 

Edited by ReDragon2013
Posted

OK. I am about to give up on this lol. So I used a "button activator" on my static items. I have a wardrobe underneath the shelf of said static items. I put this script on the activator:

 

Event OnActivate(objectReference akActivator)
If akActivator == Game.GetPlayer()
Self.RemoveAllItems(akActivator)
EndIf
EndEvent

 

And then linked the activator through the linked reference tab to the wardrobe. It doesnt work.

 

The idea is, when you look at the shelf with static items, you can take all ingredients, or you can look down and access the ingredients through the wardrobe to pick and choose what you want.

 

Was I supposed to add something to the script?

 

Thank you for putting up with my ignorance.

Posted

Always helps to know how a situation is setup so that code can be done appropriately.

 

You have a button that when pressed you want it to move stuff from the player to a container.

 

The script code will have to be modified slightly. Adapting what you last posted:

 

  Reveal hidden contents

 

Posted

Ok that seems easy enough. So:

 

ObjectReference Property JL_Ingredients_Wardrobe Auto

Event OnActivate(objectReference akActivator)
If akActivator == Game.GetPlayer()
JL_Ingredients_Wardrobe.RemoveAllItems(akActivator)
EndIf
EndEvent

Or do you mean to assign it via the attached references tab?
I am learning albeit slowly lol
Posted

Ok I just reread your reply and I cant believe I missed it:

 

You have a button that when pressed you want it to move stuff from the player to a container.

 

That isn't what I am going for and that's my fault!

 

I have a noble chest of drawers, with a noble chest shelf on top of that. The shelf has static items (ingredients) in a collision box. The chest of drawers has ingredients that get auto sorted in(already wrote the scripts for that). When the player walks up to the shelf of static items, there will be an activator or trigger for them to click. Upon activating trigger, all the ingredients from the chest of drawers will be removed and deposited into the player container (players inventory). If the player would rather grab a specific ingredient, they can just access them through the chest of drawers below the "Take all trigger" I am trying to make.

Posted

Okay, the script goes on the activator wrapping the static ingredients. There is no difference other than visuals between a button activator and a static wrapped by an activator.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...