Mannequin as Mannequin

Post » Sat Nov 17, 2012 11:24 am

I can create mannequins OK with the playerhousemannequin, xrefmarker, and trigger prim.

How would I load them up with items as a merchant's store mannequin?


Do I Linkref the clothing item(s) to the trigger prim or to the mannequin (as activator parent)?

Thanks!
User avatar
Lisha Boo
 
Posts: 3378
Joined: Fri Aug 18, 2006 2:56 pm

Post » Sat Nov 17, 2012 10:55 am

if you don't want the mannequin to be interactive, and just as a store display to show off armor, create a new mannequin actor and put the armor as an outfit.

then attach the following script to the actor:

Event OnCellAttach()	 EnableAI(False)	 MoveTo(GetLinkedRef())EndEvent


when placing the mannequin, drop it down with an xmarkerheader the same as usual, but do not give it a trigger activator. link the xmarker to the mannequin (really dont need to link vice versa, actually it's better not to)
User avatar
Nathan Hunter
 
Posts: 3464
Joined: Sun Apr 29, 2007 9:58 am

Post » Sat Nov 17, 2012 11:46 am

What if I want it interactive, but want it initially wearing armour / outfits?
(Thanks, AD - I will file your solution away for possible use in another store where I don't want them interactive, but in this case I do want interactive, just initially clothed) )
User avatar
Chloe :)
 
Posts: 3386
Joined: Tue Jun 13, 2006 10:00 am

Post » Sat Nov 17, 2012 8:08 am

if you want it interactive with an initial outfit, you can set up a regular mannequin and use a modified script that adds an additional function in the OnInit block that will add the specified armor parts to the mannequin's inventory. (if your mod is already released or it allows the user installing a 3rd party mannequin script, you may need to retrofit this mannequin externally or use a boolean-guarded condition in the cell load event to give the armor to the mannequin only once).

once the mannequin is loaded, it will run its equipcurrentarmor() function as usual, and outfit itself with the given armor.

are you using the default vanilla script for your mannequins or is it already a custom script?


i can help you write the extra function if you want


Note: the player interacting with the mannequin would be able to steal the entire outfit with no recourse. if you want a display mannequin that is pre-outfitted and have the player still have to pay for the outfit when it is removed, you may be able to use ShowBarterMenu instead of OpenInventory so that the player has to pay for the armor when they remove it

if this is the case, it would be better to give the mannequin it's own merchant container that respawns, and have the contents of the container transfer back to the mannequin when the items regenerate
User avatar
how solid
 
Posts: 3434
Joined: Mon Apr 23, 2007 5:27 am

Post » Sat Nov 17, 2012 12:47 pm

AD: Your note aspect is what I am shooting for! Have the mannequin outfitted, and the player would need to pay via showbartermenu. Thanks for the direction!
User avatar
Gwen
 
Posts: 3367
Joined: Sun Apr 01, 2007 3:34 am

Post » Sat Nov 17, 2012 7:34 pm

let me know if showbartermenu works without any dialogue quest attached to it (i'm assuming it probably would). i think i am going to need this when i revamp my black tower armory. im not sure where the money goes though (maybe the gold gets transferred into the mannequins inventory). if anything, you can always brute-force script it so that you registerforsingleupdate immediately after the showbartermenu, then in the OnUpdate block, you can strip the mannequin of all its gold and send it into the real merchant NPC's conatiner (if there is one), so that it's as if you paid the shopkeeper instead of the mannequin (so that when you barter with the real shopkeeper, his gold will have increased from your sale)
User avatar
Gaelle Courant
 
Posts: 3465
Joined: Fri Apr 06, 2007 11:06 pm

Post » Sat Nov 17, 2012 3:18 pm

AD:
Is showbartermenu a vanilla script that I add to the mannequin object?
User avatar
Leilene Nessel
 
Posts: 3428
Joined: Sun Apr 15, 2007 2:11 am

Post » Sat Nov 17, 2012 7:26 am

it's an actor function. http://www.creationkit.com/ShowBarterMenu_-_Actor

create a duplicate mannequin, and a duplicate mannequin script. then add the showbartermenu() in place of openinventory()


i just thought of something though. i don't know if the game will allow you to barter items that are currently worn. if that is the case, you will have to script the transaction manually


edit: i just tested this, and yeah, the mannequin wont sell the clothes off his back
User avatar
CxvIII
 
Posts: 3329
Joined: Wed Sep 06, 2006 10:35 pm

Post » Sat Nov 17, 2012 2:57 pm

ok, so adding the line UnequipAll() directly before the showbartermenu will do the trick. the mannequin will sell all of his clothes.


the script is going to need to be a little tricky. like if the player backs out of the menu without buying anything, you need to re-sync the armor. also once the player buys an armor piece from the mannequin, they have the ability to sell them junk, which can become problematic in the context of the vanilla mannequin script if used as a base.

if you want this to work exactly like a merchant store mannequin display. the script needs to be written from scratch, and i suggest giving the mannequin his own merchant container, or share the contents with an existing merchant container, so that the bartering is seamless between the merchant and the mannequin (from an immersion point of view, buying the clothed from the mannequin is as if buying from the store merchant itself, rather than the mannequin is a separate "merchant"). the vanilla mannequin script wont cut it.

since i am going to need this in the very near future anyway, i can write a new script and post it here
User avatar
Dalia
 
Posts: 3488
Joined: Mon Oct 23, 2006 12:29 pm

Post » Sat Nov 17, 2012 7:04 am

here is the script i wrote for the bartering mannequin:

Spoiler

Scriptname DCVR_BPR_MannequinBarterScript extends Actor ObjectReference Property MerchantChest  AutoMiscObject Property Gold001  AutoFormList Property DisplayOutfit  AutoEvent OnCellAttach()   RegisterForSingleUpdate(0.1)EndEventEvent OnActivate(ObjectReference akActionRef)   UnequipAll()   ShowBarterMenu()   RegisterForSingleUpdate(0.1)EndEventEvent OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)   If (akSourceContainer == Game.GetPlayer()) && (akBaseItem != Gold001)     RemoveItem(akBaseItem, aiItemCount, True, MerchantChest)   EndIfEndEventEvent OnUpdate()   EnableAI(True)   MoveTo(GetLinkedRef())   EnableAI(False)   EquipCurrentArmor()   RemoveItem(Gold001, GetItemCount(Gold001), True, MerchantChest)EndEventFunction EquipCurrentArmor()   Int i = 0   Int n = DisplayOutfit.GetSize()   While (i < n)     EquipItem(DisplayOutfit.GetAt(i))     i += 1   EndWhileEndFunction

setup:

1. make a duplicate mannequin NPC that is only for store displays
2. attach the above script to the store mannequin
3. fill the properties
- MerchantChest points to your store's merchant chest
- for the formlist DisplayOutfit, create a new formlist and drag/drop the armor into it the same way you would for an outfit. don't put any weapons or other non-armors into this list. point the property to your new formlist

* Note, if you want to use multiple mannequins all with different starting outfits, do not fill this property on the actor base. create separate formlist outfits, and fill the properties on each reference after you place them into the cell

4. (optional) duplicate the mannequinactivator trigger box thing, rename it something like Store Display, and fill in the text override to Browse. this makes it so that when the player mouses over this mannequin, instead of "Activate Mannequin" it will say "Browse Store Display"

5. link everything up the same way you would a normal mannequin


how it all wortks:

when you enter the cell, the mannequin will outfit itself with all of the items specified in the formlist. when you activate the mannequin, it will open up its own barter menu. unfortunately since the mannequin is not a legit merchant, it wont have any starting gold. but once you start trading with it, it will have gold for that session only.

if the player purchases the armor off the mannequin, the gold stays in the bartering menu for the length it is open, the player can sell other crap back to the mannequin, but it will be immediately sent to the real merchant container. after the player is finished, the mannequin will re-outfit itself with a new set of the armor. all of the transacted gold will return to the original merchant container.
User avatar
Miguel
 
Posts: 3364
Joined: Sat Jul 14, 2007 9:32 am

Post » Sat Nov 17, 2012 8:08 am

WOW, AD! Awesome work.
I will try this out in my mod ( but it won't be test ready for a week - still have clutter and navmesh to do).
I really appreciate this.
I think the linked merchant is exactly what I was looking for.

This should be added to the wiki as a resource to other modders - and you deserve credit and kudos for developing it!!


In fact - I recommend that you publish this on Nexus as a modder's resource mod - with everything set up - so modders can just copy and use in their store mods!! The idea is that good!
User avatar
Judy Lynch
 
Posts: 3504
Joined: Fri Oct 20, 2006 8:31 am

Post » Sat Nov 17, 2012 6:20 pm

Just out of curiousity, is it even possible to make realistic, life like mannequins with the CK? In FNV, you created an NPC and race to do it. But I think the vanilla mannequins look like caca, and a life like one would be much sweeter.
User avatar
Stacy Hope
 
Posts: 3391
Joined: Thu Jun 22, 2006 6:23 am

Post » Sat Nov 17, 2012 6:28 pm

I think I have seen many Nexus Mods that use NPC looking mannequins. I personally prefer the wooden textured ones, though; the frozen, often biologically correct mannequins made from NPCs just freak me out. I mean, they look like frozen NPCs to me... YMMV.
User avatar
naomi
 
Posts: 3400
Joined: Tue Jul 11, 2006 2:58 pm

Post » Sat Nov 17, 2012 11:52 am

for additional immersion sake, conditions could be applied to the OnCellAttach event to check if the store merchant is even awake (it would be weird to buy clothes from a mannequin while the merchant is sleeping)

something like checking for the merchants current ai package should be adequate enough

another solution would be to set up the mannequin as a legit vendor with his own vendor container in addition to the merchants container. and the mannequin's hours of operation would be the same as the merchant's (just makes it easier to control in the script wihout having to reference extra properties)
and to kill 2 birds with 1 stone:
the mannequin's vendor container will be empty, but an extra line in the script will transfer the merchant's gold to and from the mannequins container so that it has the proper amount of starting gold.

if i have time i will modify the script and post a new thread as a tutorial how to set everything up, and also how to adapt this to weapon racks. (posting it as a step by step tut would be better than a modder's resource, since this system is not something you can simply copy+paste into your mod.)


@balok - you can simply make a NPC (or copy an existing one) and add the mannequin script to it. then place that in the cell and link it up the same way you would any manneuin. if you want to do something more complex in real-time you can use ref alias (for an example you can check out my Amethyst Hollows mod, i include all the source code)
User avatar
Stefanny Cardona
 
Posts: 3352
Joined: Tue Dec 19, 2006 8:08 pm

Post » Sat Nov 17, 2012 9:21 pm

AD:
Would leveled items work in the formlist DisplayOutfit?
User avatar
Nick Pryce
 
Posts: 3386
Joined: Sat Jul 14, 2007 8:36 pm

Post » Sat Nov 17, 2012 2:20 pm

Or, I guess if the shop is closed and locked because of the AI package that might work, too!
User avatar
Lou
 
Posts: 3518
Joined: Wed Aug 23, 2006 6:56 pm

Post » Sat Nov 17, 2012 7:31 am

i would not recommend using level lists in formlists. even it the formlist takes, it might possibly screw up the EquipArmor loop in the script. if you must use randomized items from a level list, it would be safer to script an AddForm into the formlist using the random items from the level list.
User avatar
Kristian Perez
 
Posts: 3365
Joined: Thu Aug 23, 2007 3:03 am

Post » Sat Nov 17, 2012 11:26 am

A number of friends were asking, so I put up a simple mannequin mod a little while back that provides skinned mannequins, both male and female models. You can only run one at at time. No complex scripts included other than SLuckyD's script fix because it is helpful with a large number of mannequins in the cell. I tried one of the other mods a while back and it froze all of my mannequins as females. I guess forever. Go figure. :smile:

It is on Nexus and Steam as sixy Mannequins. Okay, blantant sales tactic. The response has been pretty favorable. The only bug so far is that entering Hjerim before purchasing the upgrades results in a crash. Just thought I would mention it since Balok asked.

I created the NPCs for them using AD's NPC resource mod, which is an excellent tool by the way. Especially helpful if you want to create a number of unique NPCs. Much better than using the settings in the CK.

Shalani, you can turn on AI for them so they look live rather than frozen. I prefer the living kind to the frozen kind. The wooden ones give me the creeps. They look like they are trapped in there.
User avatar
jennie xhx
 
Posts: 3429
Joined: Wed Jun 21, 2006 10:28 am

Post » Sat Nov 17, 2012 4:38 pm

I am frikken amazed this works so well, AD!!
You are a GENIUS!

O set it up as you said. The script compiled
Set the trigger and renamed as required.
Removed the vanilla mannequin script.

Only Issues/ behavior:
You do have to leave the interior and comeback (cell load) for the items to equip, as designed, not an issue.
When you browse, the items disappear from the mannequin temporarily while the browse window is up. (minor)
When you buy, a warning window pops up that states "You can only place Armor on the Mannequin." OK removes the warning w/o issue. (minor)
You buy and the item appears in your inventory and gold is deducted.
You can sell anything, but the warning about placing armor appears. Only the original kit appears on the mannequin. When gold from that transaction is up, no more sales.
The prices seem REALLY good. No merchant mark-up observed.
As you buy, the item disappears from the mannequin. If you buy all the items, the mannequin immediately reequips ALL the items. (possibly change to only equip on cell reload?)
Depending on how you position the marker and activator, a "talk to Store Display" will appear instead of the "Browse Display." (possibly just a set up problem)
I have a female mannequin mod (another author) active - obviously the mannequin reverts to male when you rename it (would like to keep the female mannequins, but probably out of scope).
Maintained 60+ FPS throughout - no impact on performance.
Created several drag and drop form lists and different mannequins can use them!

Thanks again, so much! The nits are very minor - I can publish my mod as is, and enhance later. None of the issues are game breakers.
User avatar
Mason Nevitt
 
Posts: 3346
Joined: Fri May 11, 2007 8:49 pm

Post » Sat Nov 17, 2012 12:18 pm

did you recycle a vanilla mannequin? because the message pop ups sounds like save game residue from having switched scripts. my script uses no message pop ups, so that part is coming from cached vanilla script in your save game. (or somehow both scripts are running simultaneously)

i strongly recommend using a brand new actor instead of modifying vanilla mannequin (because otherwise all mannequins in the game will be merchants)

the "talk to" comes from having named the mannequin actor. it should not have a name at all. only the activator (also should duplicate and not use the original) should be named Store Display.

you can use any NPC for the mannequin base (just make sure it is not a vanilla one), so you can have several different kinds and all races for your store displays
User avatar
Davorah Katz
 
Posts: 3468
Joined: Fri Dec 22, 2006 12:57 pm

Post » Sat Nov 17, 2012 5:24 pm

I did create a new form when I renamed and modified an existing set up of a mannequin actor and activator trigger.
They are only used two places in the game (both in my store).
I took the name off of the mannequin actor. No more talk to option - THANKS!!
My player home mannequins are still appearing and functioning as normal.

The only kind of glitchy looking minor issue is that items on the display disappear when the browse menu is up.

I would use another NPC form for the Mannequins, but to me it is more lore friendly to have the wooden look.
Is there a way to pick a female body or other races, but have the wooden skin?
User avatar
saxon
 
Posts: 3376
Joined: Wed Sep 19, 2007 2:45 am

Post » Sat Nov 17, 2012 6:19 pm

the clothes disappearing while browsing is necessary or else the mannequin wont sell you clothes that it is wearing. you might be able to modify the script to duplicate its inventory just before the barter menu goes up, but this is risky and probably more trouble than its worth (needs a bunch of conditions to make sure it doesnt keep duplicating more items when you open the menu each time).

as far as a female wooden mannequin, you would need to create a new head and edit the manakin race to accept female parts (this will result in a vanilla edit so keep that in mind)
User avatar
A Boy called Marilyn
 
Posts: 3391
Joined: Sat May 26, 2007 7:17 am

Post » Sat Nov 17, 2012 8:13 pm

I am getting ready to publish this version of my mod.
Since the non-vanilla script is applied to items will it automatically be uploaded with the .esp, or do I have to do additional work to make sure users can get the whole mod.
This is the only non-vanilla item I am using. No Mesh / texture files.
User avatar
Steve Bates
 
Posts: 3447
Joined: Sun Aug 26, 2007 2:51 pm

Post » Sat Nov 17, 2012 10:21 am

at the very least you will need to pack the pex file in order for the script to run for your users
User avatar
Laurenn Doylee
 
Posts: 3427
Joined: Sun Dec 03, 2006 11:48 am

Post » Sat Nov 17, 2012 6:02 am

Thanks, Amethyst Deceiver!
I'll start learning archive.exe :)
User avatar
Nicola
 
Posts: 3365
Joined: Wed Jul 19, 2006 7:57 am

Next

Return to V - Skyrim