How do I give the mannequin items ownership?

Post » Sat May 28, 2011 3:37 am

So I have http://img405.imageshack.us/img405/2185/18215582.jpg and the player can easily go up to the mannequin, click on it, and take everything that it has, including moving the mannequin. There is a guard in the same room and he doesn't attack if I take the items because they have no ownership. When I remove this script entirely from the mannequin, it's lying on the floor dead. So how can I script it so that if you take something from the inventory, the guard is alerted? And I want to get rid of the Move the Mannequin question too. But I'm not sure if that question is questionstate 0, 10 or 20.

In other words, imagine yourself at a real armor shop and they have mannequins suited with armor on display. If you try and move the mannequin or take what's on it, the guy at the cash register is gonna be like hey what do you think you're doing? leave that alone, etc....

Begin PE_f_e_mannequin_script   short button     short NoHit   short questionState   SkipAnim      if ( menumode == 1 )      return   endif   if ( onactivate == 0 )      if ( questionState == 0 )         return      endif   endif   if ( questionState == 0 )      MessageBox, "Armor Mannequin", "Move the Manneqiun", "Add or Remove Armor"      set questionState to 1   endif   if ( questionState == 1 )      set button to GetButtonPressed      if ( button == 0 )         set questionState to 10      elseif ( button == 1 )         set questionState to 0         Activate      endif   endif   if ( questionState == 10 )      MessageBox "Did you remove everything from the mannequin?", "Yes", "No"      set questionState to 20   endif   if ( questionState == 20 )      set button to GetButtonPressed      if ( button == 0 )         set questionState to 0         Disable         player->addItem, "PE_mannequin_f_elf_item", 1         playSound "Item Misc Up"      elseif ( button == 1 )         set questionState to 0         Activate      endif   endifEnd

User avatar
Julia Schwalbe
 
Posts: 3557
Joined: Wed Apr 11, 2007 3:02 pm

Post » Sat May 28, 2011 6:09 am

Assuming that those Mannequins are actually NPC's, you could very very simply just set their Alarm to 90 or 100 or something. That way when you take something of theirs, they should alert a guard.

This is just the off-the-top-of-my-head response from skimming the question, and might be forgetting something important.
Edit: and means that you wont need to fiddle with the script at all :D

Give this a try and get back to us/me.
User avatar
Karen anwyn Green
 
Posts: 3448
Joined: Thu Jun 15, 2006 4:26 pm

Post » Sat May 28, 2011 1:44 am

Hmmm... mannequins usually are "dead" meaning 0 health. Since you can loot a corpse, most mannequins won't be able to alert a guard, eh?

[Edit] An afterthought... If all you want to do is keep the player from stealing the armor, just put the following code on the mannequin right at the first of the script:

If ( OnActivate == 1 )       ReturnendIf


Then the player (including you in-game) can't do anything with the mannequin's inventory at all. Or pick up the mannequin.
User avatar
Adrian Powers
 
Posts: 3368
Joined: Fri Oct 26, 2007 4:44 pm

Post » Sat May 28, 2011 4:28 am

I gave the female mannequin 95 Alarm and nothing happened when I took her armor. http://img143.imageshack.us/img143/8034/85472925.jpg is her information. I was thinking maybe if you click on the mannequins, that could alarm the guard. If there is no way around it, then the alternative would be to not give the Player the ability to open the mannequin's inventory nor be able to move them. Kinda like DisableGreeting type of command.
User avatar
Ria dell
 
Posts: 3430
Joined: Sun Jun 25, 2006 4:03 pm

Post » Sat May 28, 2011 3:23 am

I guess I added my edit at the same time you posted... :)

The mannequin's script probably already has an OnActivate, but it should work if you just change it. If you're just using this mannequin from the CS and you don't want the player to be able to access it in-game, the original script doesn't matter much.
User avatar
Tiff Clark
 
Posts: 3297
Joined: Wed Aug 09, 2006 2:23 am

Post » Fri May 27, 2011 7:53 pm

hehe, that works just fine. Now the Player can't move the mannequin or take anything. Thanks!
User avatar
Mimi BC
 
Posts: 3282
Joined: Sat Oct 07, 2006 10:30 pm

Post » Sat May 28, 2011 4:22 am

ah yes. forgot most mannequins are "dead".

problemo solved
User avatar
Lizbeth Ruiz
 
Posts: 3358
Joined: Fri Aug 24, 2007 1:35 pm


Return to III - Morrowind