is there a way to detect if a player is wearin boots or shoe

Post » Sun May 29, 2011 3:19 am

Hey there,

I need/looking for a script which can be placed on a door. Essentially the script checks ( when they click on the door) to see if the player is wearing any boots/shoes before they enter the building. If they are i want it to refuse them entry to the room. If they arent then they are allowed in.

Something like "player clicks on door" - If the palyer is wearing footwear: messagebox: The sacred temple requires you to remove all footwear before entering"



is this possible?
User avatar
marina
 
Posts: 3401
Joined: Tue Mar 13, 2007 10:02 pm

Post » Sat May 28, 2011 4:20 pm

GetArmorType, armorPart_enum (returns short, -1 to 2)

If ( Player->GetArmorType, 0 == 2 )
;Player wears a heavy helmet

These functions are called on an Actor to gather information regarding what the Actor has
equipped. GetWeaponType returns the weapon type (see Table 1.1) of the Actor’s current
weapon. GetArmorType returns the armor weight (see Table 1.3) of the Actor’s currently
equipped armor part. The armor parts are coded by the numbers listed below (see Table 1.2).
HasItemEquipped returns 1 if the Actor has the given item currently equipped and 0 if it does
not.

Note: If an NPC has a bow but no arrows and fights using hand-to-hand (no other weapons),
GetWeaponType 9 will still return true and HasItemEquipped will return true for the bow.

    Helmet 0
    Cuirass 1
    Left Pauldron 2
    Right Pauldron 3
    Greaves 4
    Boots 5
    Left Gauntlet 6
    Right Gauntlet 7
    Shield 8
    Left Bracer 9
    Right Bracer 10


As for shoes.. I don't think there's a way to detect worn clothing without the specific ID.
User avatar
Umpyre Records
 
Posts: 3436
Joined: Tue Nov 13, 2007 4:19 pm

Post » Sat May 28, 2011 11:48 am

I'd try something a little different but more manageable, like a guard/priest saying "sorry ^pcrace, you must enter the temple without boots or shoes. Let me help you", then force unequip, for instance
player->additem "dummy shoes"player->equip "dummy shoes"player->removeitem "dummy shoes"

User avatar
Killah Bee
 
Posts: 3484
Joined: Sat Oct 06, 2007 12:23 pm

Post » Sat May 28, 2011 2:50 pm

Ahh, that's a good idea. Force the unknown boots/clothes off. But, I think it should be a dialogue option ("Take off shoes" or "Don't take off shoes") instead of having an NPC take your shoe off for you. Hahaha. Either that or have a script on the door that does what abot described (add/equip/remove) without prompt, displaying a messagebox that tells you that you took off your shoes if you had them on. Besides, adding and removing the items in dialogue will show "dummy shoes added to inventory" and "dummy shoes removed from inventory" in the dialogue window.
User avatar
Carlos Rojas
 
Posts: 3391
Joined: Thu Aug 16, 2007 11:19 am

Post » Sun May 29, 2011 2:41 am

I'd try something a little different but more manageable, like a guard/priest saying "sorry ^pcrace, you must enter the temple without boots or shoes. Let me help you", then force unequip, for instance
player->additem "dummy shoes"player->equip "dummy shoes"player->removeitem "dummy shoes"



Ahh, that's a good idea. Force the unknown boots/clothes off. But, I think it should be a dialogue option ("Take off shoes" or "Don't take off shoes") instead of having an NPC take your shoe off for you. Hahaha. Either that or have a script on the door that does what abot described (add/equip/remove) without prompt, displaying a messagebox that tells you that you took off your shoes if you had them on. Besides, adding and removing the items in dialogue will show "dummy shoes added to inventory" and "dummy shoes removed from inventory" in the dialogue window.


thats a good idea. but i have no idea how to havea door activate after a messagebox.

Basically i need a script that when the door is activated it has a message box: "before you can enter here you must remove your footwear" "remove footwear" "dont remove footwear"

if they select dont remove footwear then they arent allowed in. If they select remove footwear then the dummy shoes that abot suggested would be placedo n pc, then removed ect.... then the door activates and they enter the room.

make sense?
User avatar
lauren cleaves
 
Posts: 3307
Joined: Tue Aug 15, 2006 8:35 am

Post » Sat May 28, 2011 11:15 pm

Begin check_shoesshort stateshort buttonif ( state == 0 )	if ( onActivate == 1 )		set state to 1	endifelseif ( state == 1 )	messageBox, "Before you can enter, you must remove any footwear.", "Remove footwear", "Don't remove footwear"	set state to 2elseif ( state == 2 )	set button to GetButtonPressed		if ( button == 0 )	;Remove footwear		player->additem, "dummy_shoes", 1		player->equip, "dummy_shoes", 1		player->removeitem, "dummy_shoes", 1			messageBox, "You've removed any footwear you were wearing."		set state to 3		return	elseif ( button == 1 )	;Don't remove footwear		set state to 0		set button to 0	endifelseif ( state == 3 )	Activate	set state to 0	set button to 0endifEnd check_shoes

User avatar
El Goose
 
Posts: 3368
Joined: Sun Dec 02, 2007 12:02 am

Post » Sat May 28, 2011 12:07 pm

awesome thanks, i will try it out :)
User avatar
Nick Jase Mason
 
Posts: 3432
Joined: Sun Jul 29, 2007 1:23 am


Return to III - Morrowind