Thread Tools Display Modes
11/27/14, 09:24 AM   #1
geron
Join Date: Nov 2014
Posts: 4
Is there a way to swap weapons?

Hey everyone

I was wondering if there was a funcion to swap weapons.

Actually I think there has to be one, but I don't know the name and also don't know if it can be called from an AddOn...

Does anyone know this?
  Reply With Quote
11/27/14, 09:30 AM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
There is a function which swaps weapons (actually 3 of them), but it is private a can't be used by addons.
Lua Code:
  1. OnSpecialMoveKeyPressed(SPECIAL_MOVE_INDEX_WEAPON_SWAP)
  2. OnSpecialMoveKeyDown(SPECIAL_MOVE_INDEX_WEAPON_SWAP)
  3. OnSpecialMoveKeyUp(SPECIAL_MOVE_INDEX_WEAPON_SWAP)
  Reply With Quote
11/27/14, 09:42 AM   #3
geron
Join Date: Nov 2014
Posts: 4
What a pity...

Thanks a lot for the fast reply
  Reply With Quote
12/13/14, 11:14 PM   #4
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Actually I found a way...

If you run game uning the ESO Launcher, you can use secure and private functions in addons. Lets make some cheats...

I have tested that weapon swap works:
/script OnSpecialMoveKeyPressed(SPECIAL_MOVE_INDEX_WEAPON_SWAP)

From the ESOLauncher settings file:
Code:
[General]
# This setting, when set to true, allows player created mods to use protected or
# private Lua functions such as: SendChatMessage, ToggleMount, PerformAttack, etc.
# If you change this setting, you must restart your game for it to take effect.
#
# This is a GameModi Plus only feature
# default: false
EnableProtectedLuaFunctions=true

Last edited by Garkin : 12/13/14 at 11:16 PM.
  Reply With Quote
12/14/14, 02:36 AM   #5
igerup
 
igerup's Avatar
Join Date: Sep 2014
Posts: 5
You do know that WykkudsOtfitter allows weapon swap (among other things) before the game unlocks the feature at level 15? Sure, the chat messages may occasionally get you kicked from the game for "excessive spamming" but it's worth it.
  Reply With Quote
12/14/14, 12:44 PM   #6
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by igerup View Post
You do know that WykkudsOtfitter allows weapon swap (among other things) before the game unlocks the feature at level 15? Sure, the chat messages may occasionally get you kicked from the game for "excessive spamming" but it's worth it.
Thats probably changing weapons. They are talking about the games built in weapon swap (not the same). When you swap weapons it also changes the ability/skill bar so you can have different action abilities for each set of weapons. You can easily "change" from the main weapon set to the backup weapon set by doing something like:
Lua Code:
  1. EquipItem(0, EQUIP_SLOT_BACKUP_MAIN, EQUIP_SLOT_MAIN_HAND)
  2. EquipItem(0, EQUIP_SLOT_BACKUP_OFF, EQUIP_SLOT_OFF_HAND)

But it only changes what slots the items are equipped in, it does not swap the the ability bars for the main/backup weapon set.
  Reply With Quote
12/14/14, 11:57 PM   #7
igerup
 
igerup's Avatar
Join Date: Sep 2014
Posts: 5
WykkydsOutfitter changes skill sets too. Combined with his macro add-on weapon, skill, armour and jewllery swapping (and emote activation too, for whatever reason ) can be done with one button click.
  Reply With Quote
12/15/14, 06:29 AM   #8
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by igerup View Post
WykkydsOutfitter changes skill sets too. Combined with his macro add-on weapon, skill, armour and jewllery swapping (and emote activation too, for whatever reason ) can be done with one button click.
I believe that original question was if there is a way to swap between primary and backup weapon sets in the addon code. Wykkyd's Outfitter allows you to change equipped items using the keybinding, it's something completely different.
  Reply With Quote
12/17/14, 06:43 AM   #9
facemace
Join Date: Dec 2014
Posts: 1
Well, then, is there a way to at least tell whether you have set one or two equipped?

I have identical looking weapons and it's hard to focus on my skill bar during a battle so I was wondering if it would be possible to add an overlay.
  Reply With Quote
12/17/14, 07:05 AM   #10
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by facemace View Post
Well, then, is there a way to at least tell whether you have set one or two equipped?

I have identical looking weapons and it's hard to focus on my skill bar during a battle so I was wondering if it would be possible to add an overlay.
Default UI it has written on weapon swap button:



If you want to check it from the addon code you will need this function:
Lua Code:
  1. local activeWeaponSet = GetActiveWeaponPairInfo()

Information is easy accessible, where you will display it is up to you.
  Reply With Quote
12/17/14, 06:54 PM   #11
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by igerup View Post
WykkydsOutfitter changes skill sets too. Combined with his macro add-on weapon, skill, armour and jewllery swapping (and emote activation too, for whatever reason ) can be done with one button click.
Yes that can be done with code as well, but changing skills wont work while your in combat (cant change skills while in combat).
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Is there a way to swap weapons?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off