Jump to content

i need a script for equipping and unequipping in a certain manner


Gwyvern

Recommended Posts

i have zero scripting capacity, but i need a script that will equip something when a weapon is drawn, and unequip it when said weapon is sheathed, if anyone has something like that lying around i would be most greatful

Link to comment
Share on other sites

yes, that is exactly what i am looking for, sorry for being vague, when weapon is equipped, armor gets added and equipped, when weapon is sheathed, armor disappears

 

although would that work with a bound weapon spell? if not then i might have to persue other avenues

 

thank you for responding

Link to comment
Share on other sites

i have it but i have not gone through much, i was thinking of the dragon aspect shout, but i cannot find the code for that, the scripts they use to make the effects appear don't even show up in the scripts list, and when all is said and done i would like the mod to work for people without dragonborn

 

my next class is starting soon, so responses will be slow, but feel free to post

Link to comment
Share on other sites

an untested stab in the dark...

 

Apply this script (or variation thereof) to an alias for the PlayerREF in a dummy quest. Then be sure to assign the property value to the ArmorToEquip variable

 

Scriptname SomeScript Extends ReferenceAlias

Armor Property ArmorToEquip Auto
;This is the armor to force being worn when a weapon/spell is equipped

Actor Player = Game.GetPlayer()

Event OnInit()
  RegisterForSingleUpdate(5)
EndEvent

Event OnUpdate()
  If (Player.GetEquippedItemType != 0) ; 0 = hand to hand or nothing equipped
    Player.EquipItem(ArmorToEquip)
    RegisterForSingleUpdate(5)
  ElseIf (Player.GetEquippedItemType == 0) ; 0 = hand to hand or nothing equipped
    Player.UnequipItem(ArmorToEquip)
    RegisterForSingleUpdate(5)
  EndIf
EndEvent

This should cause whatever armor piece to equip whenever the player equips something in their hands. The OnUpdate even will check once every 5 seconds to see what type is currently equipped. That includes shields & torches in the off hand as well as any spells. If you don't want shields and torches triggering the equipping then you'll have to get more indepth with the logic. See this page for details.

 

Hopefully this will help you get headed in the right direction.

Link to comment
Share on other sites

i have it but i have not gone through much, i was thinking of the dragon aspect shout, but i cannot find the code for that, the scripts they use to make the effects appear don't even show up in the scripts list, and when all is said and done i would like the mod to work for people without dragonborn

 

my next class is starting soon, so responses will be slow, but feel free to post

 

Dragon aspect is what I was thinking.

It's spell, but in my opinion it'd be much better if it could be build with "vanilla" stuff.

Also, I didn't mean using it directly, but some of the mechanics it uses.

As it has three different stages, three different FX parts, that are equipped like armor.

(which makes it unique, as far as I know, it's only item utilizing FX in a manner like this)

 

By making spell similar to dragon aspect, it should be possible to make it into enchantment.. And thus via that allow using of system like that.

 

However, I haven't checked how the spell is made, and how the actual FX items are "equipped", so I can't guide you more than that.

 

Probably I could find I way if I'd start tinkering with it.. But my ways of doing things is unique and really weird so I can't explain what I'd do.

I'm just an ordinary redneck who can handle CK :biggrin:

Link to comment
Share on other sites

an untested stab in the dark...

 

Apply this script (or variation thereof) to an alias for the PlayerREF in a dummy quest. Then be sure to assign the property value to the ArmorToEquip variable

 

Scriptname SomeScript Extends ReferenceAlias

Armor Property ArmorToEquip Auto
;This is the armor to force being worn when a weapon/spell is equipped

Actor Player = Game.GetPlayer()

Event OnInit()
  RegisterForSingleUpdate(5)
EndEvent

Event OnUpdate()
  If (Player.GetEquippedItemType != 0) ; 0 = hand to hand or nothing equipped
    Player.EquipItem(ArmorToEquip)
    RegisterForSingleUpdate(5)
  ElseIf (Player.GetEquippedItemType == 0) ; 0 = hand to hand or nothing equipped
    Player.UnequipItem(ArmorToEquip)
    RegisterForSingleUpdate(5)
  EndIf
EndEvent

This should cause whatever armor piece to equip whenever the player equips something in their hands. The OnUpdate even will check once every 5 seconds to see what type is currently equipped. That includes shields & torches in the off hand as well as any spells. If you don't want shields and torches triggering the equipping then you'll have to get more indepth with the logic. See this page for details.

 

Hopefully this will help you get headed in the right direction.

this should help greatly, thanks, i just need to find the command to get when a specific weapon is equipped, rather than a type, but the wiki should have that information somewhere, thanks!

Link to comment
Share on other sites

There is GetEquippedWeapon which you can use inconjunction with IsBattleAxe, IsBow, IsDagger, IsGreatsword, IsMace, IsStaff, IsSword, IsWarAxe, IsWarhammer. However, all those "IsWeapon" functions are SKSE dependent. Which means that you and your mod users would need to have SKSE. Not that that is a bad thing. I just think that where possible a non-SKSE solution would be best because that would mean that your mod is most likely to be more compatible with other mods and future updates.

Link to comment
Share on other sites

hmm, ive contacted the creator of the true bound armors mod asking if i could have a copy of her script to reverse engineer, still waiting for a reply, but her script might work better, and i dont think it requires SKSE (which i dont even have installed, because i tend to not get SKSE mods unless they are really good, and sometimes non SKSE versions that do the same thing come out a month later, but anyway) i still have yet to figure out what to do with the script you gave me because im still in class and cant do much else besides respond to posts, but i appreciate all the help, i will be sure to credit all of you people if/when the mod ever comes out

Link to comment
Share on other sites

  • Recently Browsing   0 members

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