I have a Ranger/Archer. So normally I have a bow equiped. But if I get into melee, I would of course like to equip two swords (since as a ranger I have two weapon fighting specialty).
Is there a way to do this automatically? Either through the interface, or (more likely) through scripting? Possibly a script command to take a weapon from your backpack and equip it in your shield slot?
Switching between bow and two weapons
- ElesarTheStrong
- Posts: 43
- Joined: Thu Jan 29, 2004 2:26 am
- Location: Billericay, Essex, England
- Contact:
I know I can pause the game and do it manually, but I'd rather find a script solution. Just playing around I've found something that works ... sort of!
If I call FillSlot(SLOT_SHIELD), and I have a sword in my backpack, it will equip it in the shield slot.
The problem is if I have multiple swords (daggers etc) in my backpack, I think it tries to equip all of them. In any case, I end up with the last one equiped, and the rest just GONE!
Not exactly an ideal solution ... anyone used FillSlot before? Any way to make it only equip one item?
If I call FillSlot(SLOT_SHIELD), and I have a sword in my backpack, it will equip it in the shield slot.
The problem is if I have multiple swords (daggers etc) in my backpack, I think it tries to equip all of them. In any case, I end up with the last one equiped, and the rest just GONE!
Not exactly an ideal solution ... anyone used FillSlot before? Any way to make it only equip one item?
- krunchyfrogg
- Posts: 542
- Joined: Sun Apr 04, 2004 12:19 am
- Location: NY
- Contact:
Originally posted by glenfar
If I call FillSlot(SLOT_SHIELD), and I have a sword in my backpack, it will equip it in the shield slot.
The problem is if I have multiple swords (daggers etc) in my backpack, I think it tries to equip all of them. In any case, I end up with the last one equiped, and the rest just GONE!
This is actually quite interresting. Could you tell me how you do this exactly??
"Sometimes Dreams are wiser than waking"
Originally posted by Sytze
This is actually quite interresting. Could you tell me how you do this exactly??
If you mean scripting in general, start here: Scripting
Other than that - just call it from the script:
IF
ActionListEmpty()
THEN
RESPONSE #100
FillSlot(SLOT_SHIELD)
END
I should note that I haven't actually tried this with a bow equiped at the same time - I was just trying to figure out how to move an item in your inventory.
for the scripting can't you specify what item you want in the shield slot via item tags? if you can do that you can manually tell it to fill your shield slot with the appropriate item...
sigh* this is why I play a party that either uses only bows, 2 swords etc. and doesnt ever switch
sigh* this is why I play a party that either uses only bows, 2 swords etc. and doesnt ever switch
Tact is for people not witty enough to be sarcastic
Originally posted by Ekental
for the scripting can't you specify what item you want in the shield slot via item tags?
Not that I've been able to figure out yet ...
The FillSlot command only takes one parameter (the slot to fill). If there's a way to specify which item with a prior command, I haven't been able to find it.
- Minute Mirage
- Posts: 12
- Joined: Sun Jun 20, 2004 3:54 am
- Contact:
I've been battling with this problem as well, and I've also come to the conclusion that FillSlot() is the only action that seems to work. Of course, in order to use FillSlot() without destroying any of your items, you have to know exactly what weapons (and shields) you are carrying in your inventory and which weapons you want to equip. What I like to do, is to only carry the weapons I'm planning on using on my dual-wielders and let the people who can use more normal scripts carry all the weapons that are going to be sold. When I start using a newer weapon, I have to edit my script again.
To illustrate what I'm doing, here's the script for my fighter/mage. He's dual-wielding the Frostreaver and Stonefire and using Hangard's Axe and the Shield Of Harmony for ranged combat. When he's facing undead, he uses the Azuredge for ranged combat and the Daystar for melee. Note that the way I work around FillSlot() destroying my items is to drop them on the ground before using the action.
// Has cast Melf's Minute Meteor or equivalent
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
!InParty(LastSeenBy())
!HasItemEquipedReal("AX1H10",Myself) // Azuredge
!HasItemEquipedReal("AX1H08",Myself) // Hangard's Axe +2
!HasItemEquipedReal("AX1H13",Myself) // Battle Axe +3, Frostreaver
!HasItemEquipedReal("SW1H31",Myself) // Daystar
THEN
RESPONSE #100
AttackOneRound(LastSeenBy())
END
//
// Ranged attack
//
// Target is an undead creature
// Has Azuredge currently equipped
IF
ActionListEmpty()
See(TenthNearestEnemyOf(Myself))
!Range(NearestEnemyOf(),4)
!InParty(LastSeenBy())
See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
HasItemEquiped("AX1H10",Myself) // Azuredge
THEN
RESPONSE #100
SelectWeaponAbility(SLOT_WEAPON0,0)
AttackOneRound(LastSeenBy())
END
// Doesn't have Azuredge currently equipped
IF
ActionListEmpty()
See(TenthNearestEnemyOf(Myself))
!Range(NearestEnemyOf(),4)
!InParty(LastSeenBy())
See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
!HasItemEquiped("AX1H10",Myself) // Azuredge
THEN
RESPONSE #100
SetInterrupt(FALSE)
DropItem("AX1H12",[0.0]) // Battle Axe +3, Stonefire
DropItem("AX1H08",[0.0]) // Hangard's Axe +2
DropItem("SW1H31",[0.0]) // Daystar
DropItem("AX1H13",[0.0]) // Battle Axe +3, Frostreaver
// Drop all weapons except for the throwing axe to be equipped
FillSlot(SLOT_WEAPON0) //Equip throwing axe in the first weapon slot
FillSlot(SLOT_SHIELD) // Equip Shield
//Pick up dropped items
PickUpItem("AX1H12") // Battle Axe +3, Stonefire
PickUpItem("AX1H08") // Hangard's Axe +2
PickUpItem("AX1H13") // Battle Axe +3, Frostreaver
PickUpItem("SW1H31") // Daystar
SelectWeaponAbility(SLOT_WEAPON0,0)
SetInterrupt(TRUE)
AttackOneRound(LastSeenBy())
END
// Target is not an undead creature
// Has the throwing axe currently equipped
IF
ActionListEmpty()
See(TenthNearestEnemyOf(Myself))
!Range(NearestEnemyOf(),4)
!InParty(LastSeenBy())
!See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
HasItemEquiped("AX1H08",Myself) // Hangard's Axe +2
THEN
RESPONSE #100
SelectWeaponAbility(SLOT_WEAPON0,0)
AttackOneRound(LastSeenBy())
END
// Doesn't have the throwing axe currently equipped (dual-wielding)
IF
ActionListEmpty()
See(TenthNearestEnemyOf(Myself))
!Range(NearestEnemyOf(),4)
!InParty(LastSeenBy())
!See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
!HasItemEquiped("AX1H08",Myself) // Hangard's Axe +2
THEN
RESPONSE #100
SetInterrupt(FALSE)
DropItem("AX1H12",[0.0]) // Battle Axe +3, Stonefire
DropItem("AX1H10",[0.0]) // Azuredge
DropItem("SW1H31",[0.0]) // Daystar
DropItem("AX1H13",[0.0]) // Battle Axe +3, Frostreaver
// Drop all weapons except for the throwing axe to be equipped
FillSlot(SLOT_WEAPON0) //Equip throwing axe in the first weapon slot
FillSlot(SLOT_SHIELD) // Equip Shield
//Pick up dropped items
PickUpItem("AX1H12") // Battle Axe +3, Stonefire
PickUpItem("AX1H10") // Azuredge
PickUpItem("AX1H13") // Battle Axe +3, Frostreaver
PickUpItem("SW1H31") // Daystar
SelectWeaponAbility(SLOT_WEAPON0,0)
SetInterrupt(TRUE)
AttackOneRound(LastSeenBy())
END
//
//Melee attack
//
// Target is an undead creature
// Has Daystar currently equipped
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
!InParty(LastSeenBy())
Range(NearestEnemyOf(),4)
See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
HasItemEquiped("SW1H31",Myself) // Daystar
THEN
RESPONSE #100
EquipMostDamagingMelee()
AttackOneRound(NearestEnemyOf())
END
// Daystar not equipped
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
!InParty(LastSeenBy())
Range(NearestEnemyOf(),4)
See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
!HasItemEquiped("SW1H31",Myself) // Daystar
THEN
RESPONSE #100
SetInterrupt(FALSE)
DropItem("AX1H10",[0.0]) // Drop throwing axe (Azuredge)
DropItem("AX1H08",[0.0]) // Drop throwing axe (Hangard's Axe +2)
// Drop all items that go to shield slot except for the weapon to be equipped
DropItem("SW1H31",[0.0]) // Daystar
DropItem("AX1H12",[0.0]) // Battle Axe +3, Stonefire
DropItem("SHLD25",[0.0]) // Shield of Harmony +2
FillSlot(SLOT_SHIELD) // Equip Frostreaver in off-hand
PickUpItem("SW1H31") // Daystar
FillSlot(SLOT_WEAPON1) // Equip Daystar
// Pick up dropped items
PickUpItem("AX1H10") // Azuredge
PickUpItem("AX1H08") // Hangard's Axe +2
PickUpItem("SHLD25") // Shield of Harmony +2
PickUpItem("AX1H12") // Battle Axe +3, Stonefire
EquipMostDamagingMelee()
SetInterrupt(TRUE)
AttackOneRound(NearestEnemyOf())
END
// Target is not an undead creature
// Has the Frostreaver equipped
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
!InParty(LastSeenBy())
Range(NearestEnemyOf(),4)
!See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
HasItemEquiped("AX1H13",Myself) // Battle Axe +3, Frostreaver
THEN
RESPONSE #100
EquipMostDamagingMelee()
AttackOneRound(NearestEnemyOf())
END
// Doesn't have the Frostreaver equipped
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
!InParty(LastSeenBy())
Range(NearestEnemyOf(),4)
!See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
!HasItemEquiped("AX1H13",Myself) // Battle Axe +3, Frostreaver
THEN
RESPONSE #100
SetInterrupt(FALSE)
DropItem("AX1H10",[0.0]) // Drop throwing axe (Azuredge)
DropItem("AX1H08",[0.0]) // Drop throwing axe (Hangard's Axe +2)
// Drop all items that go to shield slot except for the weapon to be equipped
DropItem("SW1H31",[0.0]) // Daystar
DropItem("AX1H13",[0.0]) // Battle Axe +3, Frostreaver
DropItem("SHLD25",[0.0]) // Shield of Harmony +2
FillSlot(SLOT_SHIELD) // Equip Stonefire in off-hand
PickUpItem("AX1H13") // Battle Axe +3, Frostreaver
FillSlot(SLOT_WEAPON1) // Equip Frostreaver
// Pick up dropped items
PickUpItem("AX1H10") // Azuredge
PickUpItem("AX1H08") // Hangard's Axe +2
PickUpItem("SHLD25") // Shield of Harmony +2
PickUpItem("SW1H31") // Daystar
EquipMostDamagingMelee()
SetInterrupt(TRUE)
AttackOneRound(NearestEnemyOf())
END
// Back-up attack sequence
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
!InParty(LastSeenBy())
THEN
RESPONSE #100
AttackOneRound(LastSeenBy())
END
This is not what I would call a very elegant solution to the problem, but it does work for me and substantially lessens the micromanagement (I have three dual-wielders in my party).
To illustrate what I'm doing, here's the script for my fighter/mage. He's dual-wielding the Frostreaver and Stonefire and using Hangard's Axe and the Shield Of Harmony for ranged combat. When he's facing undead, he uses the Azuredge for ranged combat and the Daystar for melee. Note that the way I work around FillSlot() destroying my items is to drop them on the ground before using the action.
// Has cast Melf's Minute Meteor or equivalent
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
!InParty(LastSeenBy())
!HasItemEquipedReal("AX1H10",Myself) // Azuredge
!HasItemEquipedReal("AX1H08",Myself) // Hangard's Axe +2
!HasItemEquipedReal("AX1H13",Myself) // Battle Axe +3, Frostreaver
!HasItemEquipedReal("SW1H31",Myself) // Daystar
THEN
RESPONSE #100
AttackOneRound(LastSeenBy())
END
//
// Ranged attack
//
// Target is an undead creature
// Has Azuredge currently equipped
IF
ActionListEmpty()
See(TenthNearestEnemyOf(Myself))
!Range(NearestEnemyOf(),4)
!InParty(LastSeenBy())
See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
HasItemEquiped("AX1H10",Myself) // Azuredge
THEN
RESPONSE #100
SelectWeaponAbility(SLOT_WEAPON0,0)
AttackOneRound(LastSeenBy())
END
// Doesn't have Azuredge currently equipped
IF
ActionListEmpty()
See(TenthNearestEnemyOf(Myself))
!Range(NearestEnemyOf(),4)
!InParty(LastSeenBy())
See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
!HasItemEquiped("AX1H10",Myself) // Azuredge
THEN
RESPONSE #100
SetInterrupt(FALSE)
DropItem("AX1H12",[0.0]) // Battle Axe +3, Stonefire
DropItem("AX1H08",[0.0]) // Hangard's Axe +2
DropItem("SW1H31",[0.0]) // Daystar
DropItem("AX1H13",[0.0]) // Battle Axe +3, Frostreaver
// Drop all weapons except for the throwing axe to be equipped
FillSlot(SLOT_WEAPON0) //Equip throwing axe in the first weapon slot
FillSlot(SLOT_SHIELD) // Equip Shield
//Pick up dropped items
PickUpItem("AX1H12") // Battle Axe +3, Stonefire
PickUpItem("AX1H08") // Hangard's Axe +2
PickUpItem("AX1H13") // Battle Axe +3, Frostreaver
PickUpItem("SW1H31") // Daystar
SelectWeaponAbility(SLOT_WEAPON0,0)
SetInterrupt(TRUE)
AttackOneRound(LastSeenBy())
END
// Target is not an undead creature
// Has the throwing axe currently equipped
IF
ActionListEmpty()
See(TenthNearestEnemyOf(Myself))
!Range(NearestEnemyOf(),4)
!InParty(LastSeenBy())
!See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
HasItemEquiped("AX1H08",Myself) // Hangard's Axe +2
THEN
RESPONSE #100
SelectWeaponAbility(SLOT_WEAPON0,0)
AttackOneRound(LastSeenBy())
END
// Doesn't have the throwing axe currently equipped (dual-wielding)
IF
ActionListEmpty()
See(TenthNearestEnemyOf(Myself))
!Range(NearestEnemyOf(),4)
!InParty(LastSeenBy())
!See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
!HasItemEquiped("AX1H08",Myself) // Hangard's Axe +2
THEN
RESPONSE #100
SetInterrupt(FALSE)
DropItem("AX1H12",[0.0]) // Battle Axe +3, Stonefire
DropItem("AX1H10",[0.0]) // Azuredge
DropItem("SW1H31",[0.0]) // Daystar
DropItem("AX1H13",[0.0]) // Battle Axe +3, Frostreaver
// Drop all weapons except for the throwing axe to be equipped
FillSlot(SLOT_WEAPON0) //Equip throwing axe in the first weapon slot
FillSlot(SLOT_SHIELD) // Equip Shield
//Pick up dropped items
PickUpItem("AX1H12") // Battle Axe +3, Stonefire
PickUpItem("AX1H10") // Azuredge
PickUpItem("AX1H13") // Battle Axe +3, Frostreaver
PickUpItem("SW1H31") // Daystar
SelectWeaponAbility(SLOT_WEAPON0,0)
SetInterrupt(TRUE)
AttackOneRound(LastSeenBy())
END
//
//Melee attack
//
// Target is an undead creature
// Has Daystar currently equipped
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
!InParty(LastSeenBy())
Range(NearestEnemyOf(),4)
See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
HasItemEquiped("SW1H31",Myself) // Daystar
THEN
RESPONSE #100
EquipMostDamagingMelee()
AttackOneRound(NearestEnemyOf())
END
// Daystar not equipped
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
!InParty(LastSeenBy())
Range(NearestEnemyOf(),4)
See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
!HasItemEquiped("SW1H31",Myself) // Daystar
THEN
RESPONSE #100
SetInterrupt(FALSE)
DropItem("AX1H10",[0.0]) // Drop throwing axe (Azuredge)
DropItem("AX1H08",[0.0]) // Drop throwing axe (Hangard's Axe +2)
// Drop all items that go to shield slot except for the weapon to be equipped
DropItem("SW1H31",[0.0]) // Daystar
DropItem("AX1H12",[0.0]) // Battle Axe +3, Stonefire
DropItem("SHLD25",[0.0]) // Shield of Harmony +2
FillSlot(SLOT_SHIELD) // Equip Frostreaver in off-hand
PickUpItem("SW1H31") // Daystar
FillSlot(SLOT_WEAPON1) // Equip Daystar
// Pick up dropped items
PickUpItem("AX1H10") // Azuredge
PickUpItem("AX1H08") // Hangard's Axe +2
PickUpItem("SHLD25") // Shield of Harmony +2
PickUpItem("AX1H12") // Battle Axe +3, Stonefire
EquipMostDamagingMelee()
SetInterrupt(TRUE)
AttackOneRound(NearestEnemyOf())
END
// Target is not an undead creature
// Has the Frostreaver equipped
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
!InParty(LastSeenBy())
Range(NearestEnemyOf(),4)
!See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
HasItemEquiped("AX1H13",Myself) // Battle Axe +3, Frostreaver
THEN
RESPONSE #100
EquipMostDamagingMelee()
AttackOneRound(NearestEnemyOf())
END
// Doesn't have the Frostreaver equipped
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
!InParty(LastSeenBy())
Range(NearestEnemyOf(),4)
!See(NearestEnemyOfType([EVILCUTOFF.UNDEAD.0.0.0.0.0]))
!HasItemEquiped("AX1H13",Myself) // Battle Axe +3, Frostreaver
THEN
RESPONSE #100
SetInterrupt(FALSE)
DropItem("AX1H10",[0.0]) // Drop throwing axe (Azuredge)
DropItem("AX1H08",[0.0]) // Drop throwing axe (Hangard's Axe +2)
// Drop all items that go to shield slot except for the weapon to be equipped
DropItem("SW1H31",[0.0]) // Daystar
DropItem("AX1H13",[0.0]) // Battle Axe +3, Frostreaver
DropItem("SHLD25",[0.0]) // Shield of Harmony +2
FillSlot(SLOT_SHIELD) // Equip Stonefire in off-hand
PickUpItem("AX1H13") // Battle Axe +3, Frostreaver
FillSlot(SLOT_WEAPON1) // Equip Frostreaver
// Pick up dropped items
PickUpItem("AX1H10") // Azuredge
PickUpItem("AX1H08") // Hangard's Axe +2
PickUpItem("SHLD25") // Shield of Harmony +2
PickUpItem("SW1H31") // Daystar
EquipMostDamagingMelee()
SetInterrupt(TRUE)
AttackOneRound(NearestEnemyOf())
END
// Back-up attack sequence
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
!InParty(LastSeenBy())
THEN
RESPONSE #100
AttackOneRound(LastSeenBy())
END
This is not what I would call a very elegant solution to the problem, but it does work for me and substantially lessens the micromanagement (I have three dual-wielders in my party).