Jump to content

Bound Weapons, Do not unsummon on sheath


wisnoskij

Recommended Posts

I am finding that while bound weapons are very nice Skyrim does not really take into account weapons that cannot be sheathed.

Have a cutscene that requires you to sheath a weapon right before combat, want to cast a spell while holding a double handed bound weapon. If you use bound weapons the game basically says FU, and if you are just barely able to cast the spell in the first place well then you really cannot afford to unsummon it.

I think bound weapons need to remain summoned when they are sheathed, I think this is basically a necessity to use them. And I am hoping it is easy to code a mod for this. I am somewhat skilled at modding, if someone even just wants to point me in the right direction for this particular change, or tell me why it would be basically impossible to do, I would appreciate it.

Link to comment
Share on other sites

Why don't you just not sheathe your sword, I mean its like what, 120 seconds. I'm sure you can resist sheathing your sword for 2 minutes, I played a conjurer once so I know how it feels to have to keep reconjuring your sword but hey, if you just don't sheathe it, you'll be fine.

Link to comment
Share on other sites

Why don't you just not sheathe your sword, I mean its like what, 120 seconds. I'm sure you can resist sheathing your sword for 2 minutes, I played a conjurer once so I know how it feels to have to keep reconjuring your sword but hey, if you just don't sheathe it, you'll be fine.

Because you need to sheath two handed weapon to cast a spell, or in some cutscenes. I am not asking because it is annoying to recast over and over agian, I am asking because casting it in the middle of a battle is the the difference between useless and useful/dead before I fire the first arrow and got three off before the enemy even closed on me.

Link to comment
Share on other sites

I see your point, but thats usually what you have atronachs and thralls for right? to distract your enemy while you recast your weapons.

 

Nonetheless, I did a little search and found this:

http://skyrim.nexusmods.com/mods/1348//?

 

All this does is give you a set of instructions for using the console to basically hack permanent versions of these weapons onto your person.

This means they will never disappear, regardless of sheathing or time.

 

But I think that if you do this, you will not be able to equip any other weapons unless you use the console to remove the bound weapons. (I'm not sure about this, I haven't tried it yet)

 

So I guess its NOT what you're looking for, but hey, that's all I could do since I have very limited CK skills.

Link to comment
Share on other sites

  • 5 months later...

I understand EXACTLY how wisnoskij feels.

 

The current bound weapon system really creates a hard time for people that want to use 2-handed boundweapons. (Like bound bow)

 

The spell is expensive and you can't cast anything else, because both of your hands are busy.

 

 

I've spent a long time search for mods that would allow us to sheave the bound weapon, but all I can find are "permanent bound weapons".

 

I also looked for mods that allowed to cast magic with the left hand while holding (and not shooting) the bow with the right hand.... but I haven't found that either.

Link to comment
Share on other sites

I'm not entirely sure about how you'd go about changing this. The actual flag that tells the game the weapon is a bound weapon is on the actual weapon itself, not in the spells that summon it. But if you uncheck that, the game crashes when you try to cast it. Even if you check Playable (which will uncheck Can't Drop) it will still crash.

 

One idea: edit the bound weapon spells to be scripts. On effect start, add a normal weapon identical to the bound weapon to the player and equip it. On effect end, remove the weapon. You may or may not be able to reequip the spell/weapon equipped before the bound weapon. But you can use some kind of favorites menu/hotkey system or the like to minimize the inconvenience here.

Link to comment
Share on other sites

Thank you for replying

 

 

The actual flag that tells the game the weapon is a bound weapon is on the actual weapon itself, not in the spells that summon it. But if you uncheck that, the game crashes when you try to cast it. Even if you check Playable (which will uncheck Can't Drop) it will still crash.

 

Oh! So that's one of the reasons no one posted this mod yet. Interesting.

 

One idea: edit the bound weapon spells to be scripts. On effect start, add a normal weapon identical to the bound weapon to the player and equip it. On effect end, remove the weapon. You may or may not be able to reequip the spell/weapon equipped before the bound weapon. But you can use some kind of favorites menu/hotkey system or the like to minimize the inconvenience here.

 

That's a really good idea. If I could do it, that would certainly be my top priority hahah.

 

Sadly I have no idea how to even begin to study how to create script mods.

Link to comment
Share on other sites

NOTE: This is LONG. I realize that. Don't be intimidated. If you don't want to read the whole thing, the ENTIRE middle section between the "-----" can safely be skipped (it tells my exact process for making this work and explains quite a bit along the way).

 

ANOTHER NOTE: If you decide to make a full mod out of this, please let me know. Two reasons. One, I'll be downloading and using it :) Two, if you don't, I will.

 

FINAL NOTE: If something needs clarified, feel free to tell me so. If you can't figure it out, then when I upload it to the Creation Kit website, someone else will probably also need it clarified.

 

 

 

If you decide to go this route, don't forget to check if the player has the weapon when you try to remove it. If the player has dropped it, it'll need disabled and deleted instead of removed. If they've put it in another container (including an NPC's inventory), it'll need removed from there instead of the player.

 

Or, if you don't like the idea of bound weapons leaving the player that made them, just check the weapon for OnContainerChanged and remove/disable it then. If you don't check those, then making them permanent would be as easy as dropping a bound bow until the spell has already expired and then picking it up again.

 

As for making a script mod, it's not as hard as you might think. Learning it from scratch isn't exactly a simple matter, though. If you're interested in learning, go the the Creation Kit's page on Scripting and do the tutorials. They're a bit straightforward (meaning it's difficult to see how to expand upon what they teach you because they're just "do this, now do this"), but they're still the best way to get started.

 

I've written a step by step guide on how to do this so, if you want, you can make it yourself from scratch. Lots of it is explaining what I'm doing and why. It's actually not nearly as difficult or long of a process as the length of this post makes it seem. If you just want the results, go near the bottom and look for "-------". You are by no means obliged to read this just because I wrote it. I intend to put it up on the creation kit website as an additional tutorial, so even if you decide not to use it, my time isn't wasted.

 

--------------------------------------------------------------------------------

 

I don't know how much you know about the CK, so don't take offense if this is overly simplistic for you.

 

As for this case, in the CK, open the tab 'Magic' and select 'Magic Effect'. In the box at the top, type in "bound" to filter only the magical effects with "bound" in their name. When creating a spell with a new effect or an altered effect, the effect itself needs done first. So open 'BoundBowFFSelf' by double-clicking or right-clicking>Edit. 'BoundBowFFSelf' is the effect the Bound Bow spell uses, which you can find out for the others by opening that spell in the 'Spell' tab.

 

With it open, looking at the bottom right in the 'Scripts' box, you can see it already has a script (one which the others won't have because>), the script adds arrows for use with the bow and removes them when the effect ends. First, looking in the top left, under "Assoc. Item 1" you can see it's set to "BoundWeaponBow". This is a list of all the weapons in the game. Above that, in the field called "Effect Archetype", you see it's set to "Bound Weapon". This tells the game what kind of spell this is. If we change that to "Script", then "Assoc. Item 1" is changed to "None" (and can't be anything else) which is fine.

 

Open the script that's attached, copy everything except the top line and close that. Don't change anything in here. If you do, exit without saving. Changing the scripts from the base game is a bad idea. It can cause issues, especially in the case of users uninstalling the mod or when another mod tries to use the script. Instead, once you've copied everything but top line, add a new script, and when it asks which one to add, double-click "[New Script]". Now we're making a new script from scratch; you can call it whatever you want as long as it's not already in use (no spaces, though; use underscores instead). It says it's going to extend an ActiveMagicEffect, extending something means it will run on something. It says it's going to run on an ActiveMagicEffect (because that's what we're using to make it), which is exactly right. The box below is for explaining what the script will do. You don't have to fill it in, but you can. Hit okay and that box will close. Wait a moment and the other one will, too.

 

Now right-click the new script>"Edit Source". Don't touch the top line, but in the next line, paste what we copied earlier. The note at the top says this feature was removed, but I'm not sure how. It's irrelevant. Delete that line. Delete "Ammo Property boundArrow Auto", too. Now, looking through the script, you'll see three lines that start with "EVENT". Below each, a few lines down, you'll see "endEVENT". After "EVENT", there's the event that will trigger that section of the script. In the first one, "OnEffectStart" does what it says. Each event starts with "On" and then says the event (it's sometimes misleading, but they're a good guide).This section of the script will run when the effect starts which will happen only once. The next section, onLoad, will start when the effect is loaded into memory, which may or may not happen multiple times (for a magic effect, I imagine it'll only be loaded when the spell is cast and when the player loads a game; for objects and cells and the like, it happens when the item or cell has been unloaded from memory and is then reloaded later). The last section, OnEffectFinish, will run when the effect is done and about to be removed from whatever it's on and will only happen once.

 

After an event you'll see (). If they're empty, then there is nothing the event tells you about the event itself. If there's something inside, then those are things the event will tell you about itself. OnLoad() is empty; we don't know anything about it except that it happened. OnEffectStart(Actor Target, Actor Caster) OnEffectFinish(Actor Target, Actor Caster) tell us the target of the effect and the caster (Actor just lets the script know that the thing it's talking about is an Actor and not an Object or Ammo).

 

Now to modify the script for our use, start by making a new 'property'.Properties are set at the top (usually) of the script. They're nothing more than special kind of variable. If the script was a person, then variables would be things the person knows, and properties would be the persons outfit. Only the script can see variables, but everyone can properties. They're made by typing the kind of variable it will be (meaning the kind of information it will store for us), in this case, it's going to store a weapon (the bound bow), so type "weapon". Next, we tell the script that this particular variable will be a property by typing "property". Next, we give the property a name (anything not already used by the script or a reserved word will work). Just like the script name, it can't have spaces. Finally, we add "Auto" after that. It's not strictly necessary, but for the most part, put it after every property you make. So now, a line near the top says "Weapon Property BoundWeapon Auto". If I named it "BoundWeaponBow", then because the actual bound bow is called "BoundWeaponBow", then when you actually try connecting it to the bow, the CK will do the work for you. If you give a property the same exact name as the thing it's going to store for us, then when you go to actually connect it to that item, you can click "Auto Fill" and the CK will find an item of the type you specified by that name and fill it in. But we're making the script so it can be used by any BoundWeapon spell, not just the bow. That's your first property done. It'll need set later to actually be connected to the right object, but that'll be later.

 

Now, we have the bow set, so we need to give the player the bow. Since we don't need to give the player arrows in this script, we can find where the script did that before and simply replace the old property with the new one. You give a container (which is the player's/NPC's inventory or a chest or something) items by typing "AddItem(the item we're adding, how many, whether or not the notification about the added item to be suppressed)" The commas there are important; the game uses them to know what is separated from what. Look for "AddItem" and you'll see where it added the arrows. Replace "boundArrow" with our property "BoundWeapon". We only want the player to be given one, so change 100 to 1. The player doesn't need the notification about it, so leave 'TRUE' alone.

 

This is run on "caster". You can tell that because it says caster.AddItem. When a function (which is what "AddItem" is) is preceded by a period, it means the function will affect whatever is before the period (in this case, the variable "caster"). Caster, by the way, was set in the event "OnEffectStart(Actor Target, Actor Caster)". When an event tells you something about itself, it stores that information in the variable in its parentheses. "Actor Caster" is literally the script making the variable "Caster". The event then sets the variable to the right thing.

 

Anyway, on the next line, you see "EquipItem". Here, we need to replace the arrows with the bow again. The first "true" tells the game the player can't remove the item. It means they can't unequip it. That's bad, since this is to allow the player to switch to spells, so change that to false. The second "true" suppresses any notifications just like with "AddItem".

 

The next event "OnLoad" is perfectly fine. What it does is: when the effect is loaded into memory, if the player doesn't actually have the effect on them, then it dispels the script from them. It's a safeguard against the game accidentally leaving it active forever. It's probably largely used in case an NPC casts the spell and the player leaves the area. The effect would be unloaded from memory because the player is no longer there. If the effect ended while the player was gone and then later went back to that NPC, they might still have the bow and arrows. This dispels them if that happens.

 

The next event "OnEffectFinish" removes the arrows. RemoveItem works the same way as AddItem, so the first section tells the game which item, the second one tells it how many, and the third part tells the game whether or not there should be notifications. The third part on this one is TRUE. We won't tell the player the bound item was removed. But that sounds fine, so do worry about that (you can change it if you want). The arrows need replaced by the weapon like we did on AddItem.

 

It might seem confusing, but inside the parentheses for RemoveItem, you see another function: GetItemCount. It just counts how many of a particular item are in a container. So the overall effect is this: "Remove some arrows from the caster. How many? Well, how many does the caster have? Yeah, remove that many." It'd be nice if we could just remove all automatically, but we can't, so that's how you do it. We don't need ALL bound bows removed, just one. So replace the GetItemCount function with 1. The function is this: "OnEffectStart(Actor Target, Actor Caster)" (everything between the first and second commas). Because of how we're checking the bows to see if they were dropped, we actually do need all bows removed. So, change the arrows property to our bow property.

 

Now, we need to make sure the player can't drop the item or give it away. !--This will not work. Reading it might make this more confusing. However, I'm leaving it in because it's actually the process I went through, and thus it's the real way I found how to do it. If you don't want to risk being more confused, skip this paragraph--!

We can do this by adding a new event. We can look on the page that I linked to for all the events we can use. They're at the bottom of the page. Anything that starts with "On" is an event. For this, we should find if an object has changed containers: OnContainerChanged. If you click on it, it'll open a page about that event, which includes the event with all the proper stuff in the parentheses we need where it says Syntax. That means the whole event is "Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)." But if we look at this, it doesn't tell us what the item was. It tells us where it came from and where it went, but not what it was. That means we need a different one. Go back and look around and you'll find OnItemRemoved. This also looks promising. But the syntax for this one lets us know it'll tell us what kind of object it was, how many were removed, where it came from, and where it went. But it won't actually tell us exactly which one it was (that means we can't get rid of it).

 

Looking around more reveals those are our best bets, but neither one will work. So we'll have to do it a different way. Another way we can do it is by adding a script to the Bound Weapon itself that tells it if it's not in the right person's inventory, then delete itself. As far as the first script goes, that means it's done. The script should be done now, so press ctrl-s to save (or click File>Save). At the bottom of the window you'll see "Save Succeeded" to let you know it saved. Otherwise there'll be a popup telling you there was a problem. If there is, make sure it matches this:

Scriptname X99_BoundWeaponScript extends activemagiceffect  

Weapon Property BoundWeapon  Auto  
MagicEffect Property BoundBowFFSelf  Auto  

EVENT OnEffectStart(Actor Target, Actor Caster)
	caster.additem(BoundWeapon,1,TRUE)
	caster.equipItem(BoundWeapon, TRUE, TRUE)
endEVENT

EVENT onLoad()
	if !(getCasterActor().hasMagicEffect(BoundBowFFSelf))
		dispel()
	endif
endEVENT

EVENT OnEffectFinish(Actor Target, Actor Caster)
	caster.removeitem(BoundWeapon,1,TRUE)
endEVENT

Aside from the script's name, they should match. Exit the window, and click properties. There'll be two properties listed. The first one, BoundBowFFSelf, can be auto-filled. Click it and select Auto-Fill. The second can't be because we have it a more generic name. Instead, select it>Edit Value. In the drop down menu, choose BoundWeaponBow. So, now both properties are set. They both will tell the script what exactly to reference when the property is called. OK, OK. Now, the spell should work fine.

 

The only problem will be if the player drops the bow or stashes it somewhere. To fix this, go to the Items tab>Weapon. It'll still be filtered by "bound", so open up BoundWeaponBow. Add a new script. In this new script, well add a new event. The event we'll need is OnContainerChanged. When it's run on an object, it'll let us know when the container leaves the container it was in. I don't know if it'll fire when the object is added to the player, but it'll definitely fire when it's removed from the player. It'll also tell us where it went. If it's in a new container, then we remove it. If it's on the ground, then the new container will be "NONE" (the creation kit page on this event tells us that), so we'll disable/delete it. Disable an item, then delete it instead of just deleting it because when you use "Delete()" on an object, it doesn't immediately delete it. It instead tells the game to delete it the next time it's not in use by anything. In case it ends up being used by something, we'll want it to be disabled so it disappears and the player/nocs can't interact with it before the game gets around to getting rid of it permanently. So, our goal: event: OnContainerChanged, Disable(), Delete().

 

So, after the last line, go down a couple more and add our new event there. On the page I linked to earlier, find the event we're going to use at the bottom of the page. Under "Syntax", you'll see the entire event including the variables we need in the parentheses: "Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)". At the end of every event, we need "EndEvent" to tell the game we're done with that event. So go down two lines and type that. In the empty line between them, we can put anything we want to do in that event. What we need to do is see if the new container is the caster. We can't do that without it being very complicated. What we CAN do is see if the new container has the magical effect that would have created this bow. We can do that the same way the "OnLoad()" event in the other script checked if the caster had the magic effect. Now, instead of caster, we'll use the new container. Otherwise, it's identical. So, copying from that script gives us "if !(getCasterActor().hasMagicEffect(BoundBowFFSelf))"

Replacing the caster with the new container gives us "if !(akNewContainer.HasMagicEffect(BoundBowFFSelf))". What this says is this: "if this new container doesn't have this magic effect." The "not" in that sentence, by the way, comes from the exclamation mark. Without, we would ask if it 'does' instead. Down a line, we'll put in what happens if it doesn't have the right magic effect. If it doesn't, we want to disable and delete. So, on a new line for each, type "Disable()" "Delete()". Down another line, close the if with "EndIf" just like we did for the event.
Now, we're using the magic effect "BoundBowFFSelf", but the game won't know what that means (it's dumb and needs us to point it at -exactly- what we mean, not just the name). That means we need a property. Our property will be "MagicEffect Property BoundBowFFSelf Auto". Put it near the top on its own line. Save this and we'll get an error (I want you to see this so you know what to do). At the bottom of the script window, there's now a section that tells us about the error. On the longest line, the end of that line reads: "HasMagicEffect is not a function or does not exist". Now, "HasMagicEffect" IS a function. What's actually wrong is that it's not a function that can be used on an ObjectReference (which is what the new container is). The new container MIGHT be an actor, but not necessarily, but "HasMagicEffect" can only run on an actor. That means we sort of need to promise the script that the new container will be an actor. We can do that by replacing "akNewContainer" with "(akNewContainer as Actor)" in our if statement. Now it reads "if !((akNewContainer as Actor).HasMagicEffect(BoundBowFFSelf))"
Our final script here is this:
Scriptname X99_BoundWeaponCleanupScript extends ObjectReference  

MagicEffect Property BoundBowFFSelf Auto

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
	if !((akNewContainer as Actor).HasMagicEffect(BoundBowFFSelf))
		Disable()
		Delete()
	EndIf
EndEvent

Now, you can save that script and exit it. In the bow window, you'll see checkboxes near the top left. Two are checked: Can't Drop and Bound Weapon. After testing this a bit, I found we needed to have "Playable" checked so, check that. It was only after I'd already done all of this that I realize you could leave Bound Weapon checked when checking Playable. But testing showed that didn't work. It was also only now that I realized Can't Drop should make the bows undroppable, but testing showed that also didn't work. So, uncheck Bound Weapon and Can't Drop.

 

Each bound weapon has two parts. The normal effect and weapon, and also a Mystic effect and Mystic weapon. The spell for each bound weapon check's if the player has a perk. If the player doesn't, it uses the normal effect. If the player does, it uses the Mystic version. So the Mystic version will need the same changes. They're easy, though, now that all the work is done. For the BoundBowMysticFFSelf Magic Effect, change its Archetype to Script. Add the script you made for the other bound bow (for me: X99_BoundWeaponScript). Set its first property the same way (auto-fill) but set the second property to the mystic version of the bound bow instead of the normal version.

 

In the weapons tab, open the Mystic version of the bound bow and uncheck Can't Drop and Bound Weapon and check Playable. Add the script you made for the other bow (for me: X99_BoundWeaponCleanupScript). Set its property with Auto-Fill. Now, save your work and go test the bow. It worked for me without any problems. When I dropped the bow it disappeared. But when I switched to cast a healing spell, it was in my inventory, so I was able to switch back and continue using it until the timer ran out. I didn't test with giving it to another NPC, but it should work just as well.

 

 

--------------------------------------------------------------------------------

 

Now, if you opted for the short version, here it is. Copy the first script I posted above. Now, in the CK, left pane, at the top, type in Bound. At the bottom, click *All. Open BoundBowFFSelf. Bottom right>Add>"[New Script]"> Name it X99_BoundWeaponScript. Right-click the script and Edit Source. Paste the script you copied (make sure there's one lines at the top that says "Scriptname X99_BoundWeaponScript extends activemagiceffect"). Save and exit. Click properties. Select Auto-Fill, then set the property that wasn't autofilled to "BoundWeaponBow". Close the properties window. In the top left of the window, change the effect archetype from Bound Weapon to Script. Close the window with the OK button.

 

Open BoundBowMysticFFSelf and repeat the process. Instead of filling the property with "BoundWeaponBow", use "BoundWeaponBowMystic".

 

Open BoundWeaponBow. Uncheck Bound Weapon and Can't Drop. Check Playable. Add a script called X99_BoundWeaponCleaupScript. Paste here the SECOND script I posted above. Save and exit. Auto-Fill its property. Close the window with the OK button.

 

Open BoundWeaponBowMystic and repeat the process.

 

--------------------------------------------------------------------------------

 

Save the mod. Repeat that process for each weapon you'd like to be able to sheath and unsheath. Save again. Play.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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