Jump to content
ℹ️ Intermittent Download History issues ×

Question about OBSE: Unarmed


forli

Recommended Posts

I'm creating a little mod to:

 

- Hide the Health/Magicka/Fatigue bars when thay are at max.

 

- Hide the weapon and magic icon: they are visible only when: in combat, with weapon out or when casting a spell. When no one of these conditions exist, after 5 seconds the script hide them.

 

- Hide the durability bar (from DarNified UI) when you are unarmed or when your weapon has max health (Normally 100%, with 75+ armorer skill 125%)

 

- Create a new HUD bar to show the current charge of the enchanted weapon (Only visible if you have equipped one)

 

 

The problem is:

I want to hide the durability and charge bar when the Player is unarmed (Hand to hand style in other words), but I don't know how:

Basically, i need to know if the player is unarmed. Can somebody help me?

Link to comment
Share on other sites

I have no knowledge of OBSE scripting, but here is a command reference. It appears that you have access to functions such as:

 

GetEquipmentSlot - returns the equipment slot of the object

IsWeapon - returns whether the object is a weapon

 

That must give you some ideas.

Link to comment
Share on other sites

GetEquipmentSlot ==> "Hand to Hand" isn't an object, it hasn't any ID, so also "IsWeapon" became useless

 

IsWeaponOut ==> returns if the "reference" has sheated or unsheated his weapon (or fists), i don't think it returns if the player is using the fists.

Link to comment
Share on other sites

GetEquipmentSlot ==> "Hand to Hand" isn't an object, it hasn't any ID, so also "IsWeapon" became useless

 

IsWeaponOut ==> returns if the "reference" has sheated or unsheated his weapon (or fists), i don't think it returns if the player is using the fists.

 

From the reference:

Equippable

Types with this quality can be equipped by a character.

Values:

Slot - short the equipment slot of the object

Functions:

GetEquipmentSlot - returns the equipment slot of the object

slot:short reference.GetEquipmentSlot objectID:ref

EquipMe - when called on an object in an actor's inventory, attempts to equip the object on the actor and runs the object's OnEquip script block if applicable.

(nothing) ref.EquipMe

 

From slot:short link:

Equipment Slot IDs

4: hand

...

Return values only

 

It appears if you have to detect whether the actor is holding a weapon in the hand slot.

Link to comment
Share on other sites

Trust me IsWeaponOut returns true if you use hand to hand.

I'm already using this function in the script. It return 1 if i'm ready to fight, also with a weapon (not only fists) and return 0 in any other case (also with weapon equipped but sheated).

I need the function to detect if the player has no weapon equipped.

 

 

@Hickory

Please, can you make write 2-3 line of script to show me your idea?

Link to comment
Share on other sites

@Hickory

Please, can you make write 2-3 line of script to show me your idea?

 

Ok, like I said, I'm not a scripter, even less with OBSE, so these are musings.

 

As I understand things the short ID for weapon is 16 and (GOV) weapon type is 103, so:

 

ref weapon

set weapon to player.GetEquippedObject 16

 

Will return 0 if no weapon equipped

 

 

If you wanted to check what type of weapon is equipped:

 

short type

begin OnEquip

set type to GetObjectValue 103

end

 

 

Type codes for weapons (103):

0: Blade1H

1: Blade2H

2: Blunt1H

3: Blunt2H

4: Staff

5: Bow

 

Does this ignite the spark?

Link to comment
Share on other sites

Thanks, it works!

 

This is what I've done

 

ref weapEquip

Set weapEquip to GetEquippedObject 16

 

If weapEquip == 0 ; no reference = no weapon equipped (This is what i've missed)

- - - - -

else

- - - - -

endif

 

KUDOS!

Link to comment
Share on other sites

Thanks, it works!

 

This is what I've done

 

ref weapEquip

Set weapEquip to GetEquippedObject 16

 

If weapEquip == 0 ; no reference = no weapon equipped (This is what i've missed)

- - - - -

else

- - - - -

endif

 

KUDOS!

 

Sweet! Maybe I should delve into scripting more.

:D

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...