Jump to content

SetBipedPath command on a currently equipped item?


giggityninja

Recommended Posts

I have a helmet which I want to script to have its visor lower when the wearer enters combat, and vise versa for leaving combat.

So one mesh for closed visor and one mesh for open visor, have it switch between the two depending on the scenario. Simple right?

 

BUT I have to manually unequip and re-equip the helmet for the changes to take place.

 

I can have the script automatically re-equip the helm, but either way you get the sound and a message saying "Steel Sallet has been equipped on you" which I think is very annoying to happen every time you enter or leave combat. Is there a way to:

 

A: somehow update the helmet to the current mesh it's supposed to be using without unequipping and re-equipping at all?

OR

B: have the script automatically unequip and re-equip the helm, but disable the message somehow?

float timer
short isopen
ref wearer


begin gamemode


set wearer to GetContainer
if timer >= 0 ;so it doesn't instantly switch when entering combat (realistic delay)
  set timer to timer - getsecondspassed
else
  if wearer.isincombat == 0 && isopen == 0
    ;message "Helmet Open"
    set isopen to 1
    SetMaleBipedPath "Meshes\armor\Steel\SteelSallet.nif" SteelSallet
    SetModelPath "Meshes\armor\Steel\SteelSallet.nif" SteelSallet
    wearer.unequipitem SteelSallet
    wearer.equipitem SteelSallet
  elseif wearer.isincombat == 1 && isopen == 1
    set isopen to 0
    ;message "Helmet Closed"
    SetMaleBipedPath "Meshes\armor\Steel\SteelSalletClosed.nif" SteelSallet
    SetModelPath "Meshes\armor\Steel\SteelSalletClosed.nif" SteelSallet
    wearer.unequipitem SteelSallet
    wearer.equipitem SteelSallet
  endif
  set timer to timer + 5 + ( getrandompercent / 10 )
endif


end

 

Link to comment
Share on other sites

Actually there's both.

 

You can try instead of unequip and equip calling "wearer.Update3D" to trigger the visual switch, but be aware the function comes with its own drawbacks you will soon start to notice when you use it for a while. Nothing game breaking, but could very well be deal-breaking to you in the end.

 

Or just use the functions EquipItemSilent and UnequipItemSilent, which won't make any sounds or message spam.

Link to comment
Share on other sites

Awesome, thanks! The equipitemsilent is what I went with and it works great on the player, but I noticed that something causes the script to have no effect for NPCs, who just use the base model no matter what. Tried stripping down all other variables in the script. What is wrong here?

Edited by giggityninja
Link to comment
Share on other sites

  • Recently Browsing   0 members

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