Universal Item Display Script (Weapons, Shields, Potions etc

Post » Wed Jun 26, 2013 6:01 pm

I have tested this setup under the following conditions:

3x Container (Using a marker model). Display type = 3
Ownership of each container = Player; PlayerFaction; and NONE
1x Flawless diamond (Player owner), 1x Gold Diamond Ring (Non-player/faction owner), 1x Gold Sapphire Ring (no owner)
1x Cell. Location has keywords LocTypeDwelling/House/PlayerHouse and is the only cell of that "Location"
3x Test runs. Each iteration of the test the cell ownership was cycled through Player &--#62; PlayerFaction &--#62; None
Each container was tested with all 3 items, always testing the NONE owner first

Results:

The ownership of the container does not seem to affect the owner flag of the object (I am confident it might should one container "belong" to an NPC/non-playerfaction).

The kicker seems to be the Cell Ownership as follows:
Player: Stolen Flag on all 3 items
PlayerFaction: Stolen Flag on all 3 items
NONE: Appropriate Stolen Flags
User avatar
James Shaw
 
Posts: 3399
Joined: Sun Jul 08, 2007 11:23 pm

Post » Wed Jun 26, 2013 5:05 pm

Anyone who struggles with Papyrus or is having difficulty implementing some Universal Item Display might be interested in http://www.gamesas.com/topic/1432162-req-soulgem-rackdisplay-case/.

The discussion details adding a new display type (item category) and runs through setting everything up with some tips and tricks here and there. IMHO the extra reading material can only be to the benefit of anyone having difficulty.
User avatar
Roddy
 
Posts: 3564
Joined: Fri Jun 15, 2007 11:50 pm

Post » Wed Jun 26, 2013 11:06 am

Thank you a million times for this tutorial! It works like a charm.
Have a question though. Since I'm not a bewandered Scripter I'd rather not edit anything on my my own before consulting with all you brilliant minds.

Basicly I want to make the Weapon Display for certain Items. E.g the display won't accept any other Item than the certain one. For instance "Wuuthrad" which either bugs on every other Weapon Rack, if it even works.
I get that there should be some value or formlist I have to edit, but which one in particular?
I'm at a loss, but hopefully there's someone here with a solution!

Cheers!
User avatar
how solid
 
Posts: 3434
Joined: Mon Apr 23, 2007 5:27 am

Post » Wed Jun 26, 2013 7:05 am

Did you see this post?
That was for getting soul gems into the a universal item display set-up. You should be able to make it work for Wuuthrad. You could use keywords (if it has a unique keyword), a single entry formlist, or a straight weapon property.
User avatar
sas
 
Posts: 3435
Joined: Thu Aug 03, 2006 8:40 am

Post » Wed Jun 26, 2013 2:19 pm

@Antares

Cheers! That Really helped out. Must have missed that post somehow. By adding a new Display Category based on a formlist, and Wuuthrad being the only enry in that list it worked.
Don't know if there's any simpler way to do it but this worked fine!
User avatar
Lory Da Costa
 
Posts: 3463
Joined: Fri Dec 15, 2006 12:30 pm

Post » Wed Jun 26, 2013 10:37 am

Crashes after pasting the script and clicking OK. Would anyone know why?
User avatar
Erin S
 
Posts: 3416
Joined: Sat Jul 29, 2006 2:06 pm

Post » Wed Jun 26, 2013 4:06 pm

Nevermind, it was just unclear instructions for someone new to creation kit.
User avatar
BEl J
 
Posts: 3397
Joined: Tue Feb 13, 2007 8:12 am

Post » Wed Jun 26, 2013 6:50 am

I tried doing this with a helmet to no avail.
It works with a cloth hat, but with SKSE loaded it doesn't seem to recognise "armorhelmet".

Spoiler
Scriptname VraedHelmetDisplay extends ObjectReference
Bool Property Blocked = False Auto Hidden
Message Property MessageWarning Auto
Message Property MessageCount Auto
Keyword Property ArmorShield Auto
Keyword Property WeapTypeDagger Auto
Keyword Property WeapTypeSword Auto
Keyword Property WeapTypeGreatSword Auto
Keyword Property ArmorHelmet Auto
Keyword Property ClothingRing Auto
Keyword Property ClothingHead Auto
FormList Property GemList Auto
FormList Property ClawList Auto
Int Property PlacedItem = 0 Auto Hidden
Int Property DisplayType = 1 Auto
; 1 = Weapon rack, 2 = Dagger case, 3 = Jewel display, 4 = Shield plaque, 5 = ClothingHead, 6 = ArmorHelmet, 7 = COA weapon
ObjectReference ItemRef
Form ItemBase

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
Actor PlayerRef = Game.GetPlayer()
If (akSourceContainer == PlayerRef)
If (AllowedItems(akBaseItem))
If (aiItemCount == 1) && (PlacedItem == 0)
PlacedItem += aiItemCount
ItemBase = akBaseItem
ItemRef = akItemReference
RegisterForSingleUpdate(0.1)
Else
MessageCount.Show()
PlacedItem += aiItemCount
RemoveItem(akBaseItem, aiItemCount, False, PlayerRef)
EndIf
Else
MessageWarning.Show()
PlacedItem += aiItemCount
RemoveItem(akBaseItem, aiItemCount, False, PlayerRef)
EndIf
Else
RemoveItem(akBaseItem, aiItemCount, False, akSourceContainer)
EndIf
EndEvent
Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
If (akDestContainer == Game.GetPlayer())
UnregisterForUpdate()
EndIf
PlacedItem -= aiItemCount
EndEvent

Event OnUpdate()
MountCurrentItem(ItemBase, ItemRef)
EndEvent

Function MountCurrentItem(Form akBaseItem, ObjectReference akItemReference)
ObjectReference MountedItem
Int i = 0
If (akItemReference)
DropObject(akBaseItem)
MountedItem = akItemReference
Else
MountedItem = DropObject(akBaseItem)
EndIf
If (MountedItem != None)
Blocked = True
While(!MountedItem.Is3DLoaded()) && (i &--#60; 10)
Utility.Wait(0.1)
i += 1
EndWhile
MountedItem.SetMotionType(Motion_Keyframed, False)
MountedItem.TranslateToRef(Self, 2000.0, 0.0)
Utility.Wait(1)
Blocked = False
ItemRef = None
EndIf
EndFunction
Bool Function AllowedItems(Form akBaseItem)
If (DisplayType == 1)
Return (akBaseItem as Weapon)
ElseIf (DisplayType == 2)
Return (akBaseItem.HasKeyword(WeapTypeDagger))
ElseIf (DisplayType == 3)
Return ((akBaseItem.HasKeyword(ClothingRing)) || (GemList.HasForm(akBaseItem)))
ElseIf (DisplayType == 4)
Return (akBaseItem.HasKeyword(ArmorShield))
ElseIf (DisplayType == 5)
Return ((akBaseItem.HasKeyword(ClothingHead)))
ElseIf (DisplayType == 6)
Return ((akBaseItem.HasKeyword(ArmorHelmet)))
ElseIf (DisplayType == 7)
Return ((akBaseItem.HasKeyword(WeapTypeSword)) || (akBaseItem.HasKeyword(WeapTypeGreatSword)))
EndIf
EndFunction


Is it not part of akbaseitem?
This is pretty messy because I'm trying to learn stuff and get it work first.
User avatar
helen buchan
 
Posts: 3464
Joined: Wed Sep 13, 2006 7:17 am

Post » Wed Jun 26, 2013 8:11 pm

Thanks for the great script! Using it with glee The tutorial you put up is easy to follow even for someone without scripting experience. However I ran into an issue. Now, I followed the tutorial step by step and everything works. The only thing I differed on was adding the line in the script by the guy who ran into the stolen tag issue as I ran into that issue myself.

What I am finding is that I can access the activator even if there is a weapon on the display rack. ie in container within the trigger. Any ideas or did I do something wrong?

User avatar
Lauren Graves
 
Posts: 3343
Joined: Fri Aug 04, 2006 6:03 pm

Previous

Return to V - Skyrim