Universal Item Display Script (Weapons, Shields, Potions etc

Post » Wed Jun 26, 2013 8:49 pm

yeah, not only linked refs, but also targeted refs in ai packages, run on reference in condition functions, enable parents, activate parents, etc

luckily though, the majority of the time when you assign one of these it usually is already a persistent ref (like an xmarker), but the link refs, activate parents, and package targets are something to watch out for.



IME getclosestref works fine and always gets the right target 100% of the time if you use a base object query in which it has no choice to select otherwise. in the case with the bookshelf dummies, i made 30+ separate dummy base objects and have the container in proximity so that it can only select the marker in the shelf and not the shelf next to it. if you set your search leash just small enough (preview the target range by using test radius in the ref editor's 3d data tab) the math calculation is fairly quick, but overall using findref would obviously be slower inside a lengthy while loop than calling a persistent reference directly.

its not an ideal or efficient method and its ugly, but the way i see it, you will have to tell papyrus to crunch math on each item no matter what, if you are going to avoid using persistent refs. any system that doesnt call refs directly will always run slower and i would rather have a slightly slower running script momentarily per-single-activation than have multiple persistent refs lasting forever (even if the individual price of those persistent refs is really miniscule), especially when you consider how many bookshelves you plan on using and the number of persistent refs in total as a result
User avatar
Alycia Leann grace
 
Posts: 3539
Joined: Tue Jun 26, 2007 10:07 pm

Post » Wed Jun 26, 2013 2:54 pm

scratch that idea about the dummy markers doubling as auto-populate books from level lists. apparently when you use a level item to spawn a book, it replaces the marker with the spawned book (that makes sense now that i think about it). oh well
User avatar
Kirsty Collins
 
Posts: 3441
Joined: Tue Sep 19, 2006 11:54 pm

Post » Wed Jun 26, 2013 1:54 pm

Hi, nice script (and tutorial) for displaying the items. Is it possible to modify the script, so I can use it to display helmets ?
Greets, mde.
User avatar
Anthony Rand
 
Posts: 3439
Joined: Wed May 09, 2007 5:02 am

Post » Wed Jun 26, 2013 2:34 pm

Thank you for this tutorial. I never cared for the interface for the vanilla weapon racks. Your method makes much more sense and works well. /smile.png' class='bbc_emoticon' alt=':smile:' />

Here are a couple of screen-shots of a weapon rack I created based on your tutorial:

https://docs.google.com/open?id=0BwKduMvdF3HeVjFScXVNcjZ4c2c
https://docs.google.com/open?id=0BwKduMvdF3HeQ3k4OEtNaWxNdUU

At first I made the trigger the same size as the dummy sword container. But then I found that some of the wider weapons would overlap an adjacent trigger and cause problems. I noticed in your tutorial that the trigger can be smaller so I found that by making the trigger smaller it avoided this issue.

I used the actual visible weapon rack pieces for the activators.
User avatar
Jacob Phillips
 
Posts: 3430
Joined: Tue Aug 14, 2007 9:46 am

Post » Wed Jun 26, 2013 1:03 pm

you can edit the AllowedItems function to add another condition (or replacing one of the ones you don't need) that queries an ArmorHelmet keyword




nice job. please note, i updated the original script posted on the first post of this thread, because the old version doesnt account for certain weapons that will "fall off" of weapon racks (this also happens on vanilla racks). the new script prevents this, otherwise everything else is basically the same code.
User avatar
Lance Vannortwick
 
Posts: 3479
Joined: Thu Sep 27, 2007 5:30 pm

Post » Wed Jun 26, 2013 3:05 pm

Thanks for the info, it works /smile.png' class='bbc_emoticon' alt=':)' />
User avatar
Euan
 
Posts: 3376
Joined: Mon May 14, 2007 3:34 pm

Post » Wed Jun 26, 2013 9:47 am

Hey, I absolutely love this idea and ive been putting together a weapon display using these scripts. My activator was the flawless emerald mesh, so of course when i first tested it ingame they were all on the floor but the script still worked, for the most part. I edited the emerald mesh so it wouldnt have any havok animation, so that works now but ive got 2 problems that have to do with your scripts.

When i tested it the first time it worked, but all the weapon displays i made were still keyed into the first one i made, so all the activators would place the weapon where the first weapon display was set up. So I created several different displays (8, one for each weapon type) and pointed the script properties to the different containers and trigger boxes. However now, even though the activator seems to be working, it doesnt bring up the container to place the weapons.
I am not terribly clever at scripting so I apologize if this isnt worded very clearly, but I was hoping you might be able to help me sort it out.

EDIT:
So I was taking another look at the tutorial and what I had set up and I saw that you need to select the container and trigger under script properties in the reference window, while I had done it in the base window. so I fixed that by clearing the values in the base window and redoing it from the reference window. However it still wont work ingame, it says activate weapon display but nothing happens when I do.

EDIT2:
Ok so i scrapped everything id placed and set up and redid it all from scratch and it works now, perfectly in fact. I decided against deleting my whole post in case the knowledge that wiping the slate clean and starting over was a problem solver for me could be helpful to others too.
cheers again for a great script!
User avatar
Jon O
 
Posts: 3270
Joined: Wed Nov 28, 2007 9:48 pm

Post » Wed Jun 26, 2013 12:24 pm

Hello Amethyst. I gave your container script a try, for my dragon claw storage, but cant seem to get past step number 17. I'm new to scripting as well, and cant locate the line of code that I need to replace with my container script. You talking about: (ItemChestas DCVR_AH_ItemDisplayScript) ? I'm so very lost, lol. I've been on this for a week, now.
This is what I'm working with: I have shrunken dragon skulls for the activator, and a copy of an ebony dragon claw set as a marker, with the container script in it. (that first script of your loaded fine)
Its when I tried copy and pasting your second script, into the skull, it fails and I have no idea where to look for "Yourcontainerscript" is, to replace with my container script name. I know I'm doing some epic noob mistake, or just overthinking. Any help is massively appreciated.
User avatar
No Name
 
Posts: 3456
Joined: Mon Dec 03, 2007 2:30 am

Post » Wed Jun 26, 2013 3:46 pm

sorry, it was a typo. fixed

basically "YourContainerScript" is refering to the first script you created in the tutorial (the larger one). replace "YourContainerScript" with the full name of your container script name.

for example my script is named "DCVR_AH_ItemDisplayScript", so instead of
((ItemChest as YourContainerScript).Blocked == False))


mine would read
((ItemChest as DCVR_AH_ItemDisplayScript).Blocked == False))


so you would just replace that part with the name of your script
User avatar
Nymph
 
Posts: 3487
Joined: Thu Sep 21, 2006 1:17 pm

Post » Wed Jun 26, 2013 1:08 pm

Okay, thank you! Script compiled and saved nicely! Next question I have, is about linking the container and trigger to the activator. With the activator script properties open, I clicked on Item chest property, clicked "Pick reference in render window" And doubleclicked on my dragon claw marker. Item trigger I doubleclicked on my trigger. Saved, and tried in-game. But no message comes up about claw storage, and cant activate it.

Should I then, go about linking them together through linked reference like vanilla weapon racks and bookshelves?
User avatar
Dark Mogul
 
Posts: 3438
Joined: Tue Feb 20, 2007 11:51 am

Post » Wed Jun 26, 2013 8:16 am

if you are sure you filled the properties correctly, and it still wont activate properly, it probably means you have a solid object obstructing your trigger bound. there should be nothing but the container/marker itself touching the internal volume of the trigger (and the container/marker should be collision-less)
User avatar
Allison Sizemore
 
Posts: 3492
Joined: Wed Jul 19, 2006 6:09 am

Post » Wed Jun 26, 2013 12:31 pm


AD, how many of the displays using your setup would we theoretically be safe to use in a single cell? Reason I ask, is I'm currently building a display room, and so far have about 20 spots I'd like to use for these display's. Also, does it matter whether they are 1 weapon, 2 weapon or 2 weapon and shield displays in terms of resources used? I'll probably have a combination of all 3 when it's all done.

Also, in terms of mannequins, I plan on making everything custom, with life-like NPC's instead of the ugly vanilla ones. Right now, I have at least 10 spots for them, but there's room for more, lol. So, with at least 10 mannequins, and 20 displays am I heading for trouble?
User avatar
Eibe Novy
 
Posts: 3510
Joined: Fri Apr 27, 2007 1:32 am

Post » Wed Jun 26, 2013 10:51 pm

using this setup, you can have as many as the memory on your video card will allow before slowing down. these weapon racks have no load call, so there is no script-based load interference. the only limitation is physical memory loading the textures/meshes for all the weapons.

i use a GTX 580 and it takes close to 100 weapon racks (give or take, depends on the interior) with vanilla weapons before i start to see a significant drop in performance (although i would never recommend having that many racks in a single cell).

for mannequins, my general rule of thumb is never to have more than 12 -20 (really depends on the script) simultaneous in a single cell. for example my mannequin script uses a 30-slot array for armor. if i load each mannequin with the maximum equippable items (takes up around 27-28 slots), i cap out at 12 before they start wandering on load. and thats in a cell that has absolutely no other load calls for any other items placed in it.


on my amethyst hollows mod, i have an extremely heavilly scripted interior with 12 simultaneous mannequins, 9 bookshelves and 50 item displays/weapon racks (i am counting 1 for every item placed, so a 5-weapon rack counts as 5, or a "coat-of-arms" shield rack counts as 3), fps performance is still fairly strong on medium/upper medium rigs, and rock solid 60 fps on higher end rigs. this would never be possible with vanilla scripts though. my bookshelves and weapon/item racks do not use up any cell load calls, so pretty much the only thing that runs in the cell load event are the mannequins (which are staggered using a delay-fuse to fire them off one at a time)

as long as you do not use the vanilla scripts, you can very comfortably have 10 mannequins and 20 weapon racks with plenty of overhead to spare. the vanilla mannequin script runs quite slow for only having a 10-slot armor system. it contains a ton of useless function calls in the load event. if you use a slot array and avoid the linked-ref setup (use object ref properties directly defined in the script instead) and delete all the unnecessary crap from the load event (and delegate the load functions in a registersingle/update) it will run MUCH faster and cleaner

if you are strictly using vanilla-only setup, i would never have more than 6 mannequins, 2-3 bookshelves, and less than 10 weapon racks. the mannequins use up the most resource, so cutting down on the mannys would allow for more of the other stuff. like for example how the vanilla player homes never have more than 2-3 mannequins, places like Proudspire can have more weapon racks and bookshelves without screwing up.

obviously there are a lot of mods that use much more than what i recommended above, and that may be fine, but IMO you are really pushing the limit and asking for trouble once you start factoring in all the other mods the user may be using (very high res armors and weapons etc, or other script-based stuff that may be attached to armor, magic effects, enchantments, weapons, or player alias)).
User avatar
DAVId MArtInez
 
Posts: 3410
Joined: Fri Aug 10, 2007 1:16 am

Post » Wed Jun 26, 2013 7:29 pm

Thanks AD, I have 2x GTX 470's and while I can bring them to their knees if I want to, it's hard to know how mid-range systems handle a lot of objects. So that's great to know about your setup. And, since you were so gracious to offer, I'll probably be trying to use your mannequin setup as well. I'm sure I'll pester you with plenty of questions before it's done, lol!

Thanks again!
User avatar
Tasha Clifford
 
Posts: 3295
Joined: Fri Jul 21, 2006 7:08 am

Post » Wed Jun 26, 2013 5:00 pm

my mannequin setup is actually already done (i published it in Amethyst Hollows). i included all the source for the scripts if you want to look through it
User avatar
Natasha Biss
 
Posts: 3491
Joined: Mon Jul 10, 2006 8:47 am

Post » Wed Jun 26, 2013 10:50 am

Howdy AD or anyone else, I'm finally getting around to setting up these COA display plaques, and have hit a snag. I've carefully followed your instructions, and I think I have everything as it's supposed to be, however, when I go to test, I cursor over the activator and click, but nothing happens.

I made all custom activators by pulling up the vanilla ones, renaming them and saving as a new form. I used the WeaponRackCOALeftACTIVATOR, WeaponRackCOAMidACTIVATOR, and WeaponRackCOARightACTIVATOR, and just substituted "Balok" for "WeaponRack". (I found it odd that the vanilla left one looked to be right and right looked to be left.)

I also created a custom static, using the vanilla WRPlaque01.nif as the model for the plaque.

I used the dummy greatsword and dummy shield models for the containers as you instructed. I placed my plaque and dummy containers and activators. Then to make the triggers, I simply clicked on my dummy containers and hit the trigger button to make the trigger. I then resized the triggers accordingly like you suggested.

I then added all the scripts, and filled what I think are the correct properties as follows:

Swords: Display Type 7, Message Count and Message Warning to my 2 messages, and WeapTypeGreatsword and WeapTypeSword to their respective keywords.

Shield: ArmorShield to ArmorShield keyword, Message Count & Warning to my 2 messages, and DisplayType to 4.

I also filled the properties on my activators to the trigger and container as you instructed. From all I can tell, this should be working like a mutha, but it's not.

Any idea why these activators aren't activating?

BTW, you've made an awesome tutorial for this. I'm secretly hoping you'll indulge yourself and give us one for mannequins!
User avatar
Sara Johanna Scenariste
 
Posts: 3381
Joined: Tue Mar 13, 2007 8:24 pm

Post » Wed Jun 26, 2013 9:38 am

make sure there is nothing obstructing the triggers. if there is an object touching the inside of the trigger box the activator will prevent itself from being interacted with (the script is written this way so that when the item is placed it temporarily blocks the activator). unfortunately if you have a static poking into the trigger, it will also trigger the script blocking
User avatar
Silvia Gil
 
Posts: 3433
Joined: Mon Nov 20, 2006 9:31 pm

Post » Wed Jun 26, 2013 8:33 am


Hmm, maybe that's it. I have the handles of my container swords and front part of the shield container inside their triggers. It looked like that's how you set yours up in the pic you posted, but with that transparent trigger it could be an illusion. I'll try that tonight.
User avatar
John Moore
 
Posts: 3294
Joined: Sun Jun 10, 2007 8:18 am

Post » Wed Jun 26, 2013 12:49 pm

Well, AD, I'll be damned if I can figure out why this isin't working. I tried moving the triggers, but that seems to contradict where you mentioned the triggers only need to be placed so they know it's being occupied. I guess you were thinking my static plaque was intruding into the trigger which was not what was happening. In fact, I completely removed the plaque, as it was only for looks anyway. I also tried removing the white triggers I made and placed new buttons instead. They won't work either. Would you be willing to take a look at my test plugin I made? If so, here's the link. Everything is prefixed with Balok. The cell is aaaBalokTestCell.

http://ypdesign.com/skyrim/files/BalokDisplayTest.7z
User avatar
Alkira rose Nankivell
 
Posts: 3417
Joined: Tue Feb 27, 2007 10:56 pm

Post » Wed Jun 26, 2013 9:16 pm

i looked at your setup, and everything is correct.

the problem, i discovered eventually, is caused by the GenKit wall statics. they must have very large collision because as soon as i deleted the walls it worked.

i also noticed your container does not have a visible name, you may need to give it a name in-game or the player may not be able to access it (even by script)
User avatar
Richard
 
Posts: 3371
Joined: Sat Oct 13, 2007 2:50 pm

Post » Wed Jun 26, 2013 6:46 am


I think I actually had them named to begin with if you're referring to a Reference Editor ID? I believe I removed that and re-filled the properties with the un-named form at some point trying to troubleshoot why I couldn't get this working.

Re: collision on the walls, if I hadn't been /swear.gif' class='bbc_emoticon' alt=':swear:' /> & /wallbash.gif' class='bbc_emoticon' alt=':wallbash:' /> for 2 nights in a row over this, that actually might be sort of funny. Oh well, at least we know what it is now, and that I actually did something right for a change. Thanks for all your help AD, I really appreciate it.
User avatar
Taylor Bakos
 
Posts: 3408
Joined: Mon Jan 15, 2007 12:05 am

Post » Wed Jun 26, 2013 4:54 pm


After /swear.gif' class='bbc_emoticon' alt=':swear:' /> for several days, this seems to be the reason my activators wouldn't activate. I gave them a name on the base object, and it seems to be activating now.
User avatar
Daniel Lozano
 
Posts: 3452
Joined: Fri Aug 24, 2007 7:42 am

Post » Wed Jun 26, 2013 1:24 pm

Will Keystone Keep be seeing this script?
How's that coming btw, we haven't heard from you in a bit. The quests are going swimmingly, we're really starting to make big progress. Shouldn't be more than a few months until release.
User avatar
Jamie Lee
 
Posts: 3415
Joined: Sun Jun 17, 2007 9:15 am

Post » Wed Jun 26, 2013 3:40 pm

Hello AD, I was looking to add some variety to these displays. I believe display type 1 is for any weapon, right?, and I have set one up like that using the sword dummy for the container. However, while swords look fine for this setup, any other weapons from axes to bows and staves are way off like you mentioned. Is there a one size fit's all way of setting up things so people can put whatever they want on the display like a different container maybe? The vanilla ones seem to do this fine and I was hoping this could be done the same.
User avatar
NAkeshIa BENNETT
 
Posts: 3519
Joined: Fri Jun 16, 2006 12:23 pm

Post » Wed Jun 26, 2013 5:33 pm

the vanilla racks use a node system that is defined in the nif itself i believe (each weapon type has its own node). since my script and display system is meant to be used with any static, it relies on the weapon's pivot point (usually where the hand grabs the weapon)

the way i lined up my weapon racks was i pulled a few 'example' weapons into the CK (one of each weapon type, preferably larger sized examples of each), i lined them all up with the same X,Y, Z coorinates and moved them all into place so that they all fit (you have to make a compromise with some of them). then i deleted all but one, and swapped the reference for my container dummy.


if you use a vanilla nif as your weapon rack you may be able to change the script. instead of Translate you use MoveToNode instead (IMO the moveToNode doesnt seem to be as reliable, as is the case with some of the vanilla weapon racks sometimes)
User avatar
Matt Fletcher
 
Posts: 3355
Joined: Mon Sep 24, 2007 3:48 am

PreviousNext

Return to V - Skyrim