Jump to content

Allowed Offhand weapon types?


plainab

Recommended Posts

I'm looking for a definitive list of the weapon types allowed in the offhand for dual wielding.

I know I can do trial and error in the game. However, I am hoping that someone has already done that work and is willing to share.

 

Why?

 

I'm looking to create a mod that will allow the user with the help of spells, script, and a hotkey to automatically swap out bows and crossbows for dual wield or shield use and vice versa. I know that the idea will work as I've tested it before, but now I want to put it to use for all weapons that can be held in the offhand as well as shields.

 

Thanks in advance for any help anyone can give...

Link to comment

Yeah... all one-handed melee weapon types can be used in the offhand. The specific items that have a ranged header in addition to the melee one (ones that can either be thrown or used in melee) don't like being put in the offhand. I think IR turns the vanilla items that are like that into two separate .itm files that the user can swap between, one ranged and one melee, in order to allow offhand usage.

 

Also, don't forget that you can use a shield with sling/dart/throwing dagger/throwing axe/throwing hammer. That often slips my mind.

Link to comment
Also, don't forget that you can use a shield with sling/dart/throwing dagger/throwing axe/throwing hammer. That often slips my mind.
That is why I only mentioned doing it for bows and crossbows...

 

I wondered if it was any one-handed weapons, but wasn't too sure. Thanks for the clarification.

 

Now all I need to do is see how my code works for the shields & bows and then I can add in logic for the one-handed weapons...

Link to comment
Also, don't forget that you can use a shield with sling/dart/throwing dagger/throwing axe/throwing hammer. That often slips my mind.
That is why I only mentioned doing it for bows and crossbows...

You'll have to swap these out when dual-wielding as well.

Link to comment
Also, don't forget that you can use a shield with sling/dart/throwing dagger/throwing axe/throwing hammer. That often slips my mind.
That is why I only mentioned doing it for bows and crossbows...
You'll have to swap these out when dual-wielding as well.
Meaning that you can't have a 2 handed weapon(bow, crossbow, halberd, spear, quarterstaff, Th-sword)s in one weapon slot while using shield or off hand weapon and the current occupied hand...
Link to comment
Also, don't forget that you can use a shield with sling/dart/throwing dagger/throwing axe/throwing hammer. That often slips my mind.
That is why I only mentioned doing it for bows and crossbows...
You'll have to swap these out when dual-wielding as well.
Meaning that you can't have a 2 handed weapon(bow, crossbow, halberd, spear, quarterstaff, Th-sword)s in one weapon slot while using shield or off hand weapon and the current occupied hand...

No, meaning you can use those ranged weapons with a shield in the offhand, but not with another weapon in the offhand, so they need to be treated differently from both one-handed melee weapons and bows/crossbows.

 

Edit: It probably wasn't too clear what I was getting at originally. I don't know what you're planning with your script, but this is what I'm thinking of.

 

"Equip 1h melee" hotkey: nothing to worry about

"Equip 1h melee offhand" hotkey: remove 2h and ranged weapons from all slots

"Equip 2h melee" hotkey: remove shields/weapons from offhand

"Equip 1h ranged" hotkey: remove weapons from offhand

"Equip 2h ranged" hotkey: remove shields/weapons from offhand

 

Ranged also only likes one launcher of the same type equipped (bow + crossbow okay, but not 2x bow).

Link to comment

Let's see if I understand this then....

 

1) Any one-handed weapon can be used as an offhand weapon

2) Any shield can be used in the offhand (Duh!)

3) When dual wielding NO ranged weapons can be in the weapon slots

4) When dual wielding NO two-handed weapons can be in the weapon slots

5) When shield wielding NO two-handed weapons (including two-handed ranged) can be in the weapon slots

 

Original scope of mod:

Allow a player to swap dual wield weapons for bow/crossbow use and vice versa.

 

I decided to add shields as an extended possibility.

 

I should make it easier on myself and work just on ONE type of style proff at a time.

 

Since swapping dual wield and bows was the initial idea, that's what I'll get working first. Then consider adding in other style proffs....

 

So that said...

 

When in dual wield: remove offhand and place ranged weapon (bow, crossbow, sling) in the weapon slot and equip. NOTE: Can't do stackable ranged because of inability to know exactly how many are in the users stack...

When in ranged: remove ranged weapon and place offhand weapon in offhand slot and equip on hand melee.

 

Because ordering weapons from best to worst is a very subjective thing, player will need to be 'smart' and only carry the ranged weapon and the offhand melee weapon that they wish to use. Bag of holding would be useful in this case or a party member that doesn't do dual wielding can carry any extra weapons...

Link to comment
Let's see if I understand this then....

 

1) Any one-handed [melee] weapon can be used as an offhand weapon

Yes, aside from ones that also have a ranged header as I mentioned above, like the Dwarven Thrower or Boomerang Dagger.

 

2) Any shield can be used in the offhand (Duh!)

3) When dual wielding NO ranged weapons can be in the weapon slots

4) When dual wielding NO two-handed weapons can be in the weapon slots

5) When shield wielding NO two-handed weapons (including two-handed ranged) can be in the weapon slots

That sounds right. Also,

 

6) When using a ranged launcher of type X, no other ranged launchers of type X can be in the weapon slots

 

These are just picked up from what the in-game interface allows. I can't guarantee that not following one of these rules will put the game in a faulty state because I've never tried.

 

When in dual wield: remove offhand and place ranged weapon (bow, crossbow, sling) in the weapon slot and equip. NOTE: Can't do stackable ranged because of inability to know exactly how many are in the users stack...

When in ranged: remove ranged weapon and place offhand weapon in offhand slot and equip on hand melee.

I don't know how you are coding this and I'm not too familiar with scripting, but maybe it will save time later down the road if you don't make any assumptions about what the user is currently wielding. If you can make a single "swap to ranged" function that works regardless of whether you're currently dual-wielding, you won't have to worry about coding similar-but-different functions "swap dual to ranged", "swap ranged to ranged", etc. Also, this would avoid having to worry about whether users might have manually changed their items since they were last dual-wielding, causing you to verify that they were still dual-wielding when they hit the hotkey.

Link to comment

I assume PCs will be allowed to memorize their preferred sets of weapons. Arm yourself - hit 'memorize set 1', rearm - 'memorize set 2'. Devoting 6 hotkeys to allow for 3 sets sounds a deal.

 

Also, if you go with memorizing - otherwise what's the point, if you carry several weapons of the same type and end up with the wrong one - there'll be no need to bother about allowed combinations, script will check what's being weilded atm, which is to be a legal combo by default, else engine won't let it happen in the first place.

 

1)

2)

...

It can be put into three states

1) left holds nothing - right can hold any weapon

2) left holds shield - right can hold any 1h weapon

3) left holds 1h melee - right can hold 1h melee

 

PS Hm, now that I think of it, 3 sets might a bunch of bytes. One set would eat two long arrays for memorizing and requipping the right hand, and two shorter ones - for the left hand. Even if the item list is reduced from all existing ones to those available to party, it still a fair length to load into engine. Otoh, it's time of faster CPUs now, so I might be wrong.

 

PPS Sasha, I assume you can do it on your own, but if as of late I've had a lot of pratice generating file lists for further processing, so should you need assistance feel free to say.

 

 

PPPS Actually, six arrays - two more for unequipping. But what's the most important is to get a working script, that will put items from inventory into weapon slots and back. I did have seen into this few months ago, when another guy mentioned the same idea, and I don't think I could make it to work.

Link to comment

@Ardanis - I'll take all the help I can get! My wife says I need plenty of it, but then maybe you can't give me that kind of help... :)

 

I did it once before as a test, but didn't keep the stuff around. I need to re-do the test with specific named items, get that working and then see what is the best way to get all the items in the correct place.

 

How do you get it to memorize what weapons are set?

Link to comment
How do you get it to memorize what weapons are set?
Good question, because I don't remember how or even if...

 

IF
Hotkey(M)
Global("memorize","locals",0)
THEN
RESPONSE #100
SetGlobal("memorize","locals",1)
SetGlobal("var_shld01_is_on",locals",0)
...
SetGlobal("var_sw1h01_is_on","locals",0)
END

IF
GlobalGT("memorize","locals",0)
GlobalLT("memorize","locals",3)
!HasItemSlot(Myself,SLOT_SHIELD)
THEN
RESPONSE #100
IncrementGlobal("memorize","locals",1)
END

IF
GlobalGT("memorize","locals",0)
GlobalLT("memorize","locals",3)
!HasItemSlot(Myself,SLOT_WEAPON)
THEN
RESPONSE #100
IncrementGlobal("memorize","locals",1)
END

///////////////////////////////

IF
GlobalGT("memorize","locals",0)
GlobalLT("memorize","locals",3)
HasItemEquiped("shld01",Myeslf)
THEN
RESPONSE #100
IncrementGlobal("memorize","locals",1)
SetGlobal("var_shld01_is_on","locals",1)
END

...

IF
GlobalGT("memorize","locals",0)
GlobalLT("memorize","locals",3)
HasItemEquiped("sw1h01",Myeslf)
THEN
RESPONSE #100
IncrementGlobal("memorize","locals",1)
SetGlobal("var_sw1h01_is_on","locals",1)
END

///////////////////////////////

IF
Global("memorize","locals",3)
THEN
RESPONSE #100
SetGlobal("memorize","locals",0)
END

/////////////////////////////////////////////////////////////////////////////////////////////

IF
Hotkey(K)
THEN
RESPONSE #100
DoReequippingMagic(Myself)
END

Well, seems like I do, though not about a case with offhand weapon being identical to mainhand one. I think that was one of things I couldn't work around. And I'm unsure how to keep a track of which hand each weapon is in.

Can't recall what DoReequippingMagic() stands for either.

Link to comment

Using NI and DLTCEP...

 

With a specific set of weapons here is a working example of what I originally wanted to do....

 

Things to note:

1) Items that were identified no longer are identified because the create item effects of spells don't do identification (perhaps I should create custom versions that don't have lore and replace with those)

2) Items that are created in the weapon slot get equipped but don't show up in the quick buttons... (perhaps because they aren't identified)

3) If two of the same weapon exists they will both be removed and placed into main and off hands.

4) If only one weapon exists it will be removed and placed into the off hand allowing for dual wielding with two different weapons.

5) If more than two of a given weapon exists then it is assumed that the party member is playing the role of 'mule'.

6) If no ranged weapon is currently in inventory, the dual wield weapons will still be dropped to inventory. A massive script block that has a long list of OR(X) HasItem("range_weapon",Myself) and sets a local global needs to be implemented to prevent that... NOTE TO SELF: grab the code from my 'public' party script's ammo pickup option and adjust that when it comes time to do the tp2...

 

Here it is...

 

The script code (which was added to dplayer3.bcs to test on PC character):

IF
 HotKey(F)
 Global("ab_melee_range_switch","LOCALS",0)
THEN
 RESPONSE #100
SetGlobal("ab_melee_range_switch","LOCALS",1)
SetGlobal("ab_in_melee","LOCALS",1)
SetGlobal("ab_in_range","LOCALS",0)
SetGlobal("ab_got_my_melee","LOCALS",0)
EquipMostDamagingMelee()
END

IF
 HotKey(F)
 Global("ab_melee_range_switch","LOCALS",1)
THEN
 RESPONSE #100
SetGlobal("ab_melee_range_switch","LOCALS",0)
SetGlobal("ab_in_range","LOCALS",1)
SetGlobal("ab_in_melee","LOCALS",0)
EquipRanged()
END

IF
 Global("ab_in_range","LOCALS",1)
 CheckStatGT(Myself,0,PROFICIENCY2WEAPON)
 NumItems("sw1h76",Myself,2) // Scimitar +3
 HasItemEquiped("sw1h76",Myself) // Scimitar +3
THEN
 RESPONSE #100
ApplySpellRES("ab1005",Myself) // No such index
END

IF
 Global("ab_in_range","LOCALS",1)
 CheckStatGT(Myself,0,PROFICIENCY2WEAPON)
 NumItems("sw1h76",Myself,1) // Scimitar +3
 HasItemEquiped("sw1h76",Myself) // Scimitar +3
THEN
 RESPONSE #100
ApplySpellRES("ab1002",Myself) // No such index
END

IF
 Global("ab_in_range","LOCALS",1)
 CheckStatGT(Myself,0,PROFICIENCY2WEAPON)
 NumItems("bow07",Myself,1) // Long Bow of Marksmanship
 !HasItemEquiped("bow07",Myself) // Long Bow of Marksmanship
THEN
 RESPONSE #100
ApplySpellRES("ab1003",Myself) // No such index
EquipRanged()
END

IF
 Global("ab_in_melee","LOCALS",1)
 CheckStatGT(Myself,0,PROFICIENCY2WEAPON)
 NumItems("bow07",Myself,1) // Long Bow of Marksmanship
 HasItemEquiped("bow07",Myself) // Long Bow of Marksmanship
THEN
 RESPONSE #100
ApplySpellRES("ab1000",Myself) // No such index
END

IF
 Global("ab_in_melee","LOCALS",1)
 Global("ab_got_my_melee","LOCALS",0)
 CheckStatGT(Myself,0,PROFICIENCY2WEAPON)
 NumItems("sw1h76",Myself,2) // Scimitar +3
 !HasItemEquiped("sw1h76",Myself) // Scimitar +3
THEN
 RESPONSE #100
SetGlobal("ab_got_my_melee","LOCALS",1)
ApplySpellRES("ab1004",Myself) // No such index
EquipMostDamagingMelee()
END

IF
 Global("ab_in_melee","LOCALS",1)
 Global("ab_got_my_melee","LOCALS",0)
 CheckStatGT(Myself,0,PROFICIENCY2WEAPON)
 NumItems("sw1h76",Myself,1) // Scimitar +3
 !HasItemEquiped("sw1h76",Myself) // Scimitar +3
THEN
 RESPONSE #100
SetGlobal("ab_got_my_melee","LOCALS",1)
ApplySpellRES("ab1001",Myself) // No such index
EquipMostDamagingMelee()
END

 

The effects of the spells are as follows:

ab1000.spl

-- Effect Remove item (112)

-- Effect Create inventory item (122)

 

ab1001.spl

-- Effect Remove item (112)

-- Effect Create item in slot (143) -- slot 9 for off hand

-- Effect Equip weapon (113) //don't think this does anything, but it doesn't hurt either

 

ab1002.spl

-- Effect Remove item (112)

-- Effect Create inventory item (122)

 

ab1003.spl

-- Effect Remove inventory item (123)

-- Effect Create item in slot (143) -- slot 35 for weapon

-- Effect Equip weapon (113) //don't think this does anything, but it doesn't hurt either

 

ab1004.spl

-- Effect Remove item (112)

-- Effect Remove item (112)

-- Effect Create item in slot (143) -- slot 9 for off hand

-- Effect Create item in slot (143) -- slot 35 for weapon

-- Effect Equip weapon (113) //don't think this does anything, but it doesn't hurt either

 

ab1005.spl

-- Effect Remove item (112)

-- Effect Remove item (112)

-- Effect Create inventory item (122)

-- Effect Create inventory item (122)

 

To get the spells, I copied an existing spell, deleted it's effects and added the above listed ones....

 

Based on this, any thoughts as to the best way to create the massive list of script blocks needed for ALL one handed weapons. Perhaps some sort of best to worst with the best being at the top so that they'd get executed first. If so, how to do that without a bunch of different passes through the large quantity of item files? Or the memorize thing that Ardanis mentioned?

Link to comment

Got a little issue. I don't think it's related to the mod per se...

 

I think it might be how the engine is designed to handle things. I'll have to uninstall my test mod and try it out with a simple e-series style ranged melee switch.

 

The problem is that whenever there is an off hand animation such as a shield or weapon one handed ranged weapons such as throwing axes, daggers and darts do not get equipped (even though the engine allows them to be used). However, the sling (a one handed launcher) is properly equipped.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...