06/27/24, 09:38 AM | #21 | |
If that is not working as you expect either your expectation is different to what you asked, or you got an error in there. If you do not understand what the OptionalDependsOn does and why we said you should do that pelase read the Wiki to understand it further. I cannot describe it better sorry, and wookiefriseur also explained why this has to be done -> load RidinDirty BEFORE RidinDirtyLite so one can check if RidinDirty was loaded as ridinDirty loads afterwards. Hint: SHOW US YOUR TOTAL ADDON's CODE and we maybe able to help. Only posting example and parts of the code is not enough to find actual errors. |
||
06/27/24, 09:51 AM | #22 | |
|
Code:
;------------------------------ DISCLAIMER ----------------------------- ; This Add-on is not created by, affiliated with or sponsored by ZeniMax ; Media Inc. or its affiliates. The Elder Scrolls® and related logos are ; registered trademarks or trademarks of ZeniMax Media Inc. in the United ; States and/or other countries. All rights reserved. ; You can read the full terms at https://account.elderscrollsonline.com/add-on-terms ## Title: |c6666FFRidinDirtyLite|r ## Description: Mount group member multi-rider mount in range and audio / visual notification of being mounted / dismounted! ## Author: @sinnereso ## Version: 2024.06.27 ## APIVersion: 101042 ## OptionalDependsOn: RidinDirty ## SavedVariables: RidinDirtyLiteVars RidinDirtyLite.lua bindings.xml Code:
--------------------------------------------------------- ------- GLOBAL ADDON SETTINGS -- --------------------------------------------------------- RidinDirtyLite = { name = "RidinDirtyLite", author = "@sinnereso", version = "2024.06.27", svName = "RidinDirtyLiteVars", svVersion = 1, logo = "|c6666FF[RDL]|r", errSnd = "PlayerAction_NotEnoughMoney", mailSnd = "New_Mail", queSnd = "GuildRoster_Added", chgSnd = "InventoryItem_ApplyCharge", ultSnd = "Ability_Companion_Ultimate_Ready_Sound", warngSnd = "BG_Countdown_Finish", apSnd = "AlliancePoint_Transact", tickSnd = "Duel_Accepted", eventSnd = "GroupElection_ResultWon", hasPassenger = false, } --------------------------------------------------------- --------- ADDON LOADED -- --------------------------------------------------------- function RidinDirtyLite.AddOnLoaded(eventCode, addOnName) if RidinDirty ~= nil then EVENT_MANAGER:UnregisterForEvent("RidinDirtyLite", EVENT_ADD_ON_LOADED) return end if addOnName ~= "RidinDirtyLite" then return end -- Keybindings -- ZO_CreateStringId("SI_BINDING_NAME_MOUNT_PLAYER", "Mount Group Member") EVENT_MANAGER:UnregisterForEvent("RidinDirtyLite", EVENT_ADD_ON_LOADED) RidinDirtyLite.Initialize()--<< INITIALIZE VARIABLES AND OPTIONS end --------------------------------------------------------- ------- INITIALIZE AFTER ADDON LOADED -- --------------------------------------------------------- function RidinDirtyLite.Initialize() -- Default Account Saved Variables -- local defaultSavedVars = { } RidinDirtyLite.savedVariables = ZO_SavedVars:NewAccountWide( RidinDirtyLite.svName, RidinDirtyLite.svVersion, nil, defaultSavedVars ) EVENT_MANAGER:RegisterForEvent("RidinDirtyLite", EVENT_PLAYER_ACTIVATED, RidinDirtyLite.PlayerActivated) end --------------------------------------------------------- -------- PLAYER ACTIVATED -- --------------------------------------------------------- function RidinDirtyLite.PlayerActivated() RidinDirtyLite.PassengerStateChange() end --------------------------------------------------------- -------- MOUNT SAVED PLAYER -- --------------------------------------------------------- function RidinDirtyLite.MountPlayer() local displayNamePref = nil local isMountable = false if IsUnitDeadOrReincarnating("player") or IsUnitInCombat("player") or IsMounted() or HasPendingCompanion() then PlaySound(RidinDirtyLite.errSnd) df(RidinDirtyLite.logo .. " Unable to mount player right now") return end for iD = 1, GetGroupSize() do local playerID = GetGroupUnitTagByIndex(iD) local playerCharName = GetUnitName(playerID) local playerDisplayName = GetUnitDisplayName(playerID) local mountedState, hasEnabledGroupMount, hasFreePassengerSlot = GetTargetMountedStateInfo(playerDisplayName) if mountedState == MOUNTED_STATE_MOUNT_RIDER and hasEnabledGroupMount and hasFreePassengerSlot then isMountable = true else isMountable = false end if not ZO_ShouldPreferUserId() then displayNamePref = playerCharName else displayNamePref = playerDisplayName end displayNamePref = zo_strformat("<<1>>", displayNamePref)--<< Strip genders if playerDisplayName ~= GetUnitDisplayName("player") and IsUnitOnline(playerID) and IsUnitInGroupSupportRange(playerID) and isMountable and RidinDirtyLite.DistanceToUnit(playerID) < 5.0 then df(RidinDirtyLite.logo .. " Mounting " .. displayNamePref) UseMountAsPassenger(playerDisplayName) return end end PlaySound(RidinDirtyLite.errSnd) df(RidinDirtyLite.logo .. " No player in group mountable") end function RidinDirtyLite.PassengerStateChange()--<< CHECK FOR MOUNTED STATE CHANGE local mountedState, hasEnabledGroupMount, hasFreePassengerSlot = GetTargetMountedStateInfo(GetUnitDisplayName("player")) if mountedState ~= MOUNTED_STATE_MOUNT_RIDER then RidinDirtyLite.hasPassenger = false elseif mountedState == MOUNTED_STATE_MOUNT_RIDER and hasEnabledGroupMount and hasFreePassengerSlot and RidinDirtyLite.hasPassenger then RidinDirtyLite.hasPassenger = false PlaySound(RidinDirtyLite.mailSnd) df(RidinDirtyLite.logo .. " Lost Passenger") elseif mountedState == MOUNTED_STATE_MOUNT_RIDER and hasEnabledGroupMount and not hasFreePassengerSlot and not RidinDirtyLite.hasPassenger then RidinDirtyLite.hasPassenger = true PlaySound(RidinDirtyLite.mailSnd) df(RidinDirtyLite.logo .. " Have Passenger") end zo_callLater(function() RidinDirtyLite.PassengerStateChange() end, 1000) end function RidinDirtyLite.DistanceToUnit(unitID)--<< DISTANCE TO UNITID local _, selfX, selfY, selfH = GetUnitWorldPosition("player") local _, targetX, targetY, targetH = GetUnitWorldPosition(unitID) local nDistance = zo_distance3D(targetX, targetY, targetH, selfX, selfY, selfH) / 100 return nDistance end EVENT_MANAGER:RegisterForEvent("RidinDirtyLite", EVENT_ADD_ON_LOADED, RidinDirtyLite.AddOnLoaded) Code:
<Bindings> <Layer name="SI_KEYBINDINGS_CATEGORY_GENERAL"> <Category name="|c6666FFRidinDirtyLite|r"> <Action name="MOUNT_PLAYER"> <Down>RidinDirtyLite.MountPlayer()</Down> </Action> </Category> </Layer> </Bindings> Last edited by sinnereso : 06/27/24 at 11:11 AM. |
|
06/27/24, 10:35 AM | #23 | ||
Join Date: Apr 2024
Posts: 9
|
Its not neccesary, would be nice to have but am already happy if a sounds pop up + chat message Maybe even better then some crazy big message on screen |
||
06/27/24, 10:42 AM | #24 | |
|
It should be complete and on minion/esoui.com as "RidinDirtyLite" later this evening once I get back home and iron out 1 last small issue with compatibility and the big bear approves it Last edited by sinnereso : 06/27/24 at 10:47 AM. |
|
06/27/24, 10:56 AM | #25 | ||
Join Date: Apr 2024
Posts: 9
|
Yea i sended out a ticket to eso (no clue if they do anything with it or something but meh) for more stuff with dual mount api Sweet gonna keep on eye on it! Thanks again |
||
06/27/24, 11:48 AM | #26 |
What error with the keybind do you get then?
Duplicate name MOUNT_PLAYER? The xml files got no conditions so keybinds are a problem. I'd simply define the name different so they do not have the same name in your 2 similar addons. Also: Please do add your addon name to the keybind name constant so one sees it's NOT a ZOs vanila keybind constant! Old: ZO_CreateStringId("SI_BINDING_NAME_MOUNT_PLAYER", "Mount Group Member") New: ZO_CreateStringId("SI_BINDING_NAME_RIDINDIRTY_MOUNT_PLAYER", "Mount Group Member") ZO_CreateStringId("SI_BINDING_NAME_RIDINDIRTYLITE_MOUNT_PLAYER", "Mount Group Member") Remember to change the xml file binding naem too: <Action name="RIDINDIRT_MOUNT_PLAYER"> <Action name="RIDINDIRTYLITE_MOUNT_PLAYER"> The SI_BINDING_NAME_RIDINDIRTYLITE_MOUNT_PLAYER will not load for RidinDirtyLite then if RidinDirty is enabled BECAUSE in your EVENT_ADD_ON_LOADED your exit early before the string is defined via ZO_CreateStringId ! That will make the keybind hide in the controls as it does not find a text. Last edited by Baertram : 06/27/24 at 11:52 AM. |
|
06/27/24, 11:53 AM | #27 |
|
|
06/27/24, 03:55 PM | #28 |
|
ok just uploaded it for approval and cleaned it up a bit.. I'll continue to work on it a bit more for ya while I also incorporate it into my primary addon. Let me know if you find any oddities with it in the addons comments section once its approved. GL and enjoy it
|
06/27/24, 03:57 PM | #29 | |
|
Last edited by sinnereso : 06/27/24 at 04:00 PM. |
|
06/27/24, 05:12 PM | #30 |
I think there is an overwrite=true" tag which can be added to the keybind's XML too, but not sure if that works properly for your usecase here.
e.g. first loas RidingDirty -> 2nd RidinDirtyLite -> overwrites keybind -> RidinDirtyLite is disabled in the EVENT_ADD_ON_LOADED so RidinDirrtyLite.Mount() function is missing and keybind throws a nil error upon usage. It would work the other way around if lite is loaded first and RidinDirty overwrites |
|
06/27/24, 05:34 PM | #31 | |
|
I'll continue to explore other way of doing it and once im satisfied I'll merge it into RidinDirty as well because it is kewl. Last edited by sinnereso : 06/27/24 at 05:36 PM. |
|
06/28/24, 12:19 AM | #32 | |
Join Date: Apr 2024
Posts: 9
|
Will do! Thank you both again for all the work and effort you have put into this!
|
|
06/28/24, 12:28 AM | #33 |
|
|
06/28/24, 01:33 AM | #34 | ||
Join Date: Apr 2024
Posts: 9
|
Holy .... If the on screen is triggering me to much i can switch even to chat... Your a legend _O_ |
||
06/28/24, 03:49 AM | #35 |
|
haha ty but im not really.. Just had been working with this stuff already so I figured I was in a good position to help,
|
06/28/24, 03:54 AM | #36 | |
Join Date: Apr 2024
Posts: 9
|
Well for me you are
|
|
ESOUI » AddOns » AddOn Search/Requests » Request: dual mount notification |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|