Quantcast Mount-Mini-Me addon alternative/replacement - WoWInterface
Thread Tools Display Modes
06-11-19, 11:43 AM   #1
kittykatmax
A Fallenroot Satyr
 
kittykatmax's Avatar
Join Date: Apr 2007
Posts: 21
Mount-Mini-Me addon alternative/replacement

This is an addon on CurseForge that has been abandoned for nearly a year. The July 2018 version is broken and was uploaded that way, with a promise to release a working version SOON(TM). I greatly miss this addon, and lack programming skills, so I was wondering if anyone either knew of an alternative, or was willing to make one, or could provide LUA I could cut/paste to get it working again.

The aforementioned addon lets you pair pets and mounts, so when you mount a particular mount, it summons the paired pet, too. Let's you opt whether to unsummon the pet when you dismount. Also has dismiss pet when stealthed option.

Addon is: https://www.curseforge.com/wow/addons/mount-mini-me

If anyone knows of an alternative, this addon is greatly missed!!! Thanks.
  Reply With Quote
06-12-19, 02:27 AM   #2
LudiusMaximus
A Cliff Giant
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 71
How is it broken? Are there any LUA errors?

Make sure to activate the error output by entering
Code:
/console scriptErrors 1
into the chat box.
  Reply With Quote
06-24-19, 02:04 PM   #3
kittykatmax
A Fallenroot Satyr
 
kittykatmax's Avatar
Join Date: Apr 2007
Posts: 21
According to the author, it was BFA's API changes that broke the addon, and the changes were much bigger than anticipated. Syrae's last "update," Version 8.0.0.0, bumped the version number for BfA, but only summoning on dismount was working (is supposed to summon the pet when you mount).

Apparently, BFA's API changes were daunting enough it wasn't an easy fix, and then Syrae disappeared, whether because BFA was a disappointment and they quit the game, life became too busy, or the coding was more than they wanted to deal with.

I stopped using the addon when it broke at the beginning of BFA, and have just kept checking to see if it was updated every week or two. I'll install it and try to see what errors it's throwing, thanks.
  Reply With Quote
06-24-19, 02:41 PM   #4
kittykatmax
A Fallenroot Satyr
 
kittykatmax's Avatar
Join Date: Apr 2007
Posts: 21
So, I've been playing around with the addon. As promised by addon author, I can set a pet I want summoned when I dismount, but the pairing of pets with mounts is broken. Addon is throwing no errors. I use Bugsack, but I also ran the script. before starting. Nada.

Can an API break an addon but not throw errors?
  Reply With Quote
06-24-19, 04:50 PM   #5
LudiusMaximus
A Cliff Giant
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 71
I had a quick look at the Addon.

First of all, I did in fact get an error because it tries to register the events LOOT_STARTED and LOOT_STOPPED which do not exist (any more?). See MountMiniMe.lua, line 95.
It should probably be LOOT_OPENED and LOOT_CLOSED?
https://wowwiki.fandom.com/wiki/Events/L

I commented this out:
Code:
-- self:RegisterEvent("LOOT_STARTED", Addon.LootStartedHandler);
-- self:RegisterEvent("LOOT_STOPPED", Addon.LootStoppedHandler);
Then I did not get an error any more.

I tried to locate the code that is executed when you mount up and found it in event.lua, line 21:

Code:
function Addon:HandleMountStart()
	Addon:debug_print('HandleMountStart');
	
	AddonTable.StealthPetId = nil;
	
	local hunterModeOp = self:GetHunterModeOperation();
	-- self:debug_print('hunterModeOp' .. tostring(hunterModeOp));
	
	if Addon:IsHunterMode() and IsPetActive() and (hunterModeOp == 'keep') then
		-- Addon:debug_print('Hunter op is keep, not summoning mount pet');
		return;
	end
	
	local shapeshiftModeOp = self:GetShapeshiftModeOperation();
	self:debug_print('shapeshiftModeOp = ' .. tostring(shapeshiftModeOp));
  
	if Addon:IsShapeshiftMode() and AddonTable.PlayerShapeshifted and (shapeshiftModeOp == 'keep') then
		Addon:debug_print('Shapeshift op is keep, not summoning mount pet');
		return;
	end
	
	
	local mountSpellId = Addon:FindMountSpellId()
	AddonTable.SummonDelay = AddonTable.DefaultSummonDelay;
	Addon:SummonPet(Addon:FindPetIdForMountSpellId(mountSpellId));	
end
As you can see it has lots of debug_print() calls which would actually be helpful. To activate them, you have to set the AddonTable.DEBUG variable to true in MountMiniMe.lua, line 9:

Code:
AddonTable.DEBUG = true;

In the last line of HandleMountStart() you see the call of SummonPet() taking as its argument the return value of Addon:FindPetIdForMountSpellId(mountSpellId).

Beforehand, the variable mountSpellID gets assigned the return value of FindMountSpellId().
I checked to see what it returns by adding a print() command to the code:

Code:
local mountSpellId = Addon:FindMountSpellId()

-- My new command to see the value of mountSpellId.
-- (You actually do not need ; at the end of lines in lua.)  
print("mountSpellId", mountSpellId)
  
AddonTable.SummonDelay = AddonTable.DefaultSummonDelay;
Addon:SummonPet(Addon:FindPetIdForMountSpellId(mountSpellId));
This showed me that the return value of FindMountSpellId() is "nil", which is apparently why everything else from here on cannot work either.

To see what is wrong I located FindMountSpellId() in util.lua, line 39.

Code:
function Addon:FindMountSpellId()
	-- No use trying to find a mount if we're not mounted
	if not IsMounted() then
		return nil
	end

	local buffs, i = {}, 1;
	local name, _, _, _, _, _, _, _, _, _, spellId = UnitBuff("player", i);
	while name do
		if AddonTable.MountCollection[spellId] then
			return spellId
		end
		i = i + 1;
		name, _, _, _, _, _, _, _, _, _, spellId = UnitBuff("player", i);
	end
end
This function obviously tries to find out what mount you are on by iterating through all active buffs.

I added the line
Code:
print (name, spellId)
to see what was going on and found that, spellId was always nil already. I searched the web for UnitBuff() and found that spellId is actually the 10th, not the 11th return value. This was probably something that got changed in the API at some point (?). I changed the code to:

Code:
function Addon:FindMountSpellId()
	-- No use trying to find a mount if we're not mounted
	if not IsMounted() then
		return nil
	end

	local buffs, i = {}, 1;
	-- local name, _, _, _, _, _, _, _, _, _, spellId = UnitBuff("player", i);
	local name, _, _, _, _, _, _, _, _, spellId = UnitBuff("player", i);
  
	print ("These are the active buffs:")
	while name do
		print (name, spellId)
  
		if AddonTable.MountCollection[spellId] then
			return spellId
		end
		i = i + 1;
		-- name, _, _, _, _, _, _, _, _, _, spellId = UnitBuff("player", i);
		name, _, _, _, _, _, _, _, _, spellId = UnitBuff("player", i);
	end
end

This seems to have done the trick I guess...?

I could have told you just the solution right away, but maybe by explaining how I found it you could see that it is not too difficult.
"Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime." :-)
  Reply With Quote
07-09-19, 06:11 AM   #6
kittykatmax
A Fallenroot Satyr
 
kittykatmax's Avatar
Join Date: Apr 2007
Posts: 21
Sorry it took me so long to respond after your post (which was on my birthday - best. gift. ever!).

Thank you SOOOO much. I'm not sure why "bugsack" didn't catch that error. Sorry about that.

I do appreciate your explaining everything. I don't know programming (beyond an HTML course in the 90s) - will be referencing this next time I'm stuck!

Thank you again!!!
  Reply With Quote
07-09-19, 06:23 AM   #7
LudiusMaximus
A Cliff Giant
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 71
Haha, happy birthday then!

Glad I could help!

I was assuming that you did not know a lot of programming yourself. Just thought that getting some insights into how it can be done might rid you of possible inhibitions or whet your appetite. But never mind, not everybody needs to be a programmer. :-)
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Mount-Mini-Me addon alternative/replacement

Thread Tools
Display Modes

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