Thread Tools Display Modes
06/27/24, 09:38 AM   #21
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,083
I cant seem to get that to work but I also think you missunderstood the question. I dont want RidinDirty as a dependency for RidinDirtyLite.
I totally understood it and wrote you exactly what to do in my explanation above.
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.
  Reply With Quote
06/27/24, 09:51 AM   #22
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 273
Originally Posted by Baertram View Post
I totally understood it and wrote you exactly what to do in my explanation above.
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.
manifest:
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:
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)
bindingsxml:
Code:
<Bindings>
	<Layer name="SI_KEYBINDINGS_CATEGORY_GENERAL">
		<Category name="|c6666FFRidinDirtyLite|r">
			<Action name="MOUNT_PLAYER">
				<Down>RidinDirtyLite.MountPlayer()</Down> 
			</Action>
		</Category>
	</Layer>
</Bindings>
theres still some more trimming i need to do for the sound files and saved variables which currently there are none but I left incase the need arises while working on it here. And i realize I could and prolly should be using elseif's for the passenger state change which i'll likely change but for the moment only issue is the addon keeps loading when RidinDirty is loaded causing the keybinding conflict. I need RidinDirtyLite to not load if RidinDirty is loaded.

Last edited by sinnereso : 06/27/24 at 11:11 AM.
  Reply With Quote
06/27/24, 10:35 AM   #23
tdc-nl
Join Date: Apr 2024
Posts: 9
Originally Posted by sinnereso View Post
Ya np bro it was fairly simple I'm just trying to ensure compatibility with my primary addon is in place before I throw it up there. I did have a question though, is BIG ONSCREEN message & soound required for your needs or is chat output & sound enough?
Pfew i am so happy that it was not that crazy to do haha
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
  Reply With Quote
06/27/24, 10:42 AM   #24
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 273
Originally Posted by tdc-nl View Post
Pfew i am so happy that it was not that crazy to do haha
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
Was no big deal I largely had a plan in place to do this very thing already. So currently it checks every second.. if you previously had no passenger but do now it alerts you.. If you previously had a passenger but dont now it alerts you.. fairly simple but I'm not into the checking every second aspect. down the road when there's an EVENT for such things I'll redo it to make it more efficient so it only fires when someone mounts or dismounts you but until then or I find another way this gets the job done for you

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.
  Reply With Quote
06/27/24, 10:56 AM   #25
tdc-nl
Join Date: Apr 2024
Posts: 9
Originally Posted by sinnereso View Post
Was no big deal I largely had a plan in place to do this very thing already. So currently it checks every second.. if you previously had no passenger but do now it alerts you.. If you previously had a passenger but dont now it alerts you.. fairly simple but I'm not into the checking every second aspect. down the road when there's an EVENT for such things I'll redo it to make it more efficient so it only fires when someone mounts or dismounts you but until then or I find another way this gets the job done for you

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
Oooh so i am kinda lucky then
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
  Reply With Quote
06/27/24, 11:48 AM   #26
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,083
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.
  Reply With Quote
06/27/24, 11:53 AM   #27
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 273
Originally Posted by Baertram View Post
What error with the keybind do you get then?
Duplicate name MOUNT_PLAYER?
Correct this is the error.. I'll try what you suggest here when I get back and see what I can do with it ty
  Reply With Quote
06/27/24, 03:55 PM   #28
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 273
Originally Posted by tdc-nl View Post
Oooh so i am kinda lucky then
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
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
  Reply With Quote
06/27/24, 03:57 PM   #29
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 273
Originally Posted by Baertram View Post
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.
And TY bear! that did the trick. I never realized having the same control would have been the issue as I was assuming it would disable and not even try to create it. I'll update RidinDirty as well to have more custom control names but thats gonna be a day or two as I'm working on something else that may require some saved variable resets so... id rather piss everyone off only once haha

Last edited by sinnereso : 06/27/24 at 04:00 PM.
  Reply With Quote
06/27/24, 05:12 PM   #30
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,083
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
  Reply With Quote
06/27/24, 05:34 PM   #31
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 273
Originally Posted by Baertram View Post
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
Thats interesting as well... theres 2 issues with the addons running at the same time.. the previouosly identicle keybind which id like to be the case if possible, and the looping RidinDirtyLite.PassengerStateChange() which obviously we wouldn't want running twice at the same time. That was the idea behing disabling the LITE version if the full featured was running. It might be kewl if they could have the same keybind making that part of them compatible should someone "upgrade" shall we say from the lite version but not critical.

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.
  Reply With Quote
06/28/24, 12:19 AM   #32
tdc-nl
Join Date: Apr 2024
Posts: 9
Originally Posted by sinnereso View Post
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
Will do! Thank you both again for all the work and effort you have put into this!
  Reply With Quote
06/28/24, 12:28 AM   #33
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 273
Originally Posted by tdc-nl View Post
Will do! Thank you both again for all the work and effort you have put into this!
Just updated it with improved efficiency and added a /rdl slash to toggle chat or onscreen. hasnt been approved yet but should work well for you
  Reply With Quote
06/28/24, 01:33 AM   #34
tdc-nl
Join Date: Apr 2024
Posts: 9
Originally Posted by sinnereso View Post
Just updated it with improved efficiency and added a /rdl slash to toggle chat or onscreen. hasnt been approved yet but should work well for you
your amazing that you even added the on screen option!
Holy .... If the on screen is triggering me to much i can switch even to chat...
Your a legend _O_
  Reply With Quote
06/28/24, 03:49 AM   #35
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 273
Originally Posted by tdc-nl View Post
your amazing that you even added the on screen option!
Holy .... If the on screen is triggering me to much i can switch even to chat...
Your a legend _O_
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,
  Reply With Quote
06/28/24, 03:54 AM   #36
tdc-nl
Join Date: Apr 2024
Posts: 9
Well for me you are
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » Request: dual mount notification


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