Addon Rematch

Discuss pet battles, strategy and theorycrafting.
User avatar
Alkaia
Posts:21
Joined:September 17th, 2014
Pet Score:13143
Realm:Lightbringer-eu
Contact:
Re: Addon Rematch

Post by Alkaia » November 4th, 2014, 6:19 am

Loving the notes section. Most battles are quite simple and easy to remember but there are a few which require notes to remember specific details.

One problem I did have was saving a team for Sully McLeary in the Celestial Tournament.
It wouldn't recognise Sully and tried to save over the previous team I had been using (Ion Goldblum)

That was before I updated Rematch so the problem may be fixed now but won't know for a few weeks when Sully returns.

Gello
Posts:576
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Addon Rematch

Post by Gello » November 4th, 2014, 4:35 pm

Alkaia wrote:Loving the notes section. Most battles are quite simple and easy to remember but there are a few which require notes to remember specific details.

One problem I did have was saving a team for Sully McLeary in the Celestial Tournament.
It wouldn't recognise Sully and tried to save over the previous team I had been using (Ion Goldblum)

That was before I updated Rematch so the problem may be fixed now but won't know for a few weeks when Sully returns.
Hmm that's another report of that happening. I'll make this the focus of this week's work on the addon.

Could you export the team for Sully and Ion Goldblum and post them here? Right-click the team, Export, then CTRL+C the string and paste i there.

Were you able to load Sully btw? As in going into team list and double-clicking the team to load? Or was that failing too?

User avatar
Iibis
Posts:154
Joined:October 21st, 2013
Pet Score:4297
Realm:Emerald Dream-eu
Contact:

Re: Addon Rematch

Post by Iibis » November 5th, 2014, 3:05 am

Ok, so here are some new clues about the Celestial teams not loading. CT reset so I went to the Tournament (I haven't completed it so I can test further if you need me to) and completed the 3 tamers before celestials. When I could battle Xu-Fu/Zao/Chi-Chi/Yu'la, all teams loaded with mouseover except the team for Yu'la, Yu'la failed to load last week too(*). But after I defeated Xu-Fu, none of the other teams are suggested.

Could this be because the fight with Xu-Fu doesn't end properly? The game calculates that I win from dot damage (or something like that) and ends the battle before I can see Xu-Fu dying. If I target Xu-Fu (after I've fought him) it asks me whether I want to load the team saved for Xu-Fu after I manually load other teams, but none of the other Celestials are registered. And I think that the next fight resets the situation back to normal, which is why Chi-Chi & previously Yu'la loaded normally and I thought there was an issue with Zao.

(*)I think the reason for this is my own mistake. I deleted my Yu'la team, but now I can't save a new team to Yu'la by targeting it, since it's saying that I already have a team saved for Xu-Fu. So the NPC ID saves as 0. But before I deleted my Yu'la team it had a white name and an NPC ID associated with it (didn't work). I unfortunately lost that copy paste export, but my savedvariables still show the old team and the ID associated with it was 73507 if I interpret it correctly. That doesn't match the NPC ID I get from a /run print(UnitGUID("target")) macro: 0954 Creature-0-1465-1161-7993-72291-000059D2E4. So I probably saved the team for Yu'la before it was available for battle which is why it didn't load previously.

Edit. Now that I fought Zao after Xu-Fu, the team for Yu'la loaded based on name and I'm also able to save it with the NPC ID :) I don't know if my thoughts are correct and they don't really explain failures to load teams before fighting Xu-Fu.

User avatar
Alkaia
Posts:21
Joined:September 17th, 2014
Pet Score:13143
Realm:Lightbringer-eu
Contact:

Re: Addon Rematch

Post by Alkaia » November 5th, 2014, 4:17 am

Gello wrote: Could you export the team for Sully and Ion Goldblum and post them here? Right-click the team, Export, then CTRL+C the string and paste i there.

Were you able to load Sully btw? As in going into team list and double-clicking the team to load? Or was that failing too?
I didn't have a team set up for Sully as it was the first time doing him with Rematch. I had set up Ion successfully and the one before that (forget who) and Sully was the last one I did.
Did the battle anyway but WoW crashed while I was on Chi-Chi so lost those. Gonna have to wait a few weeks to set Rematch up again for those.

User avatar
Emmaleah
Posts:9
Joined:June 15th, 2013
Pet Score:8976
Realm:Doomhammer-us
Contact:

Re: Addon Rematch

Post by Emmaleah » November 5th, 2014, 12:44 pm

Question about the notes? I added a few notes via copy paste from my personal notes to the addons notes. Then I went and copied the rest of my notes following the same format. I then went back into the game and discovered that didn't work. It over wrote it all to no teams saved. (Luckily I had a backup ). Any logical reason why that didn't work? And any possibility for an import of notes other than manually copy/paste.

User avatar
Ravnhawk
MVP
Posts:705
Joined:January 2nd, 2013
Pet Score:6534
BattleTag®:ravnhawk#1272
Realm:Zul'jin-us
Contact:

Re: Addon Rematch

Post by Ravnhawk » November 5th, 2014, 1:34 pm

OK I know this might and a dumb question but how do I make a new team?

User avatar
Kpb321
Posts:938
Joined:April 30th, 2013
Pet Score:3974
BattleTag®:kpb#1554
Realm:Sisters of Elune-us
Contact:

Re: Addon Rematch

Post by Kpb321 » November 5th, 2014, 2:09 pm

Ravnhawk wrote:OK I know this might and a dumb question but how do I make a new team?
Just pick your pets and hit save. If you have an NPC selected it automatically names the team for them and will make it autoload. Otherwise it should prompt you for a name.

Gello
Posts:576
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Addon Rematch

Post by Gello » November 5th, 2014, 3:05 pm

Re: Saves attempting to save for a previous target, I found a major culprit: the addon thinks when you leave a pet battle that you're still targeting what you had targeted when you started a pet battle. I don't think this is the whole story since it should offer the new target when you target something new. But it's likely a big part. It could have potentially copied the npcID to the new target also which would prevent the target match also. The fix above is already done for next update, but I may include a way to reset the npcID also for teams if any are affected.

To rewind a bit about the option to not reset filters, is the main purpose to revert to a standard filter? Like excluding TCG pets, excluding pets not collected, etc as a baseline filter? Perhaps we can combine the favorite filter idea and this. In the filter menu is Saved Default Filters and Delete Default Filters. When a default filter is saved, every time you log in it will start at the defaults, and every time you Reset All (or click the little X by the filter results at the bottom) it would restore to defaults. Thoughts?
Emmaleah wrote:Question about the notes? I added a few notes via copy paste from my personal notes to the addons notes. Then I went and copied the rest of my notes following the same format. I then went back into the game and discovered that didn't work. It over wrote it all to no teams saved. (Luckily I had a backup ). Any logical reason why that didn't work? And any possibility for an import of notes other than manually copy/paste.
Can you rephrase the part in bold? I don't understand what you mean. You made a bunch of notes to different teams, logged in later and the notes were gone? They had wrong notes? Did you happen to crash or exit the game abnormally for some reason in the session where you made the notes?

User avatar
Ravnhawk
MVP
Posts:705
Joined:January 2nd, 2013
Pet Score:6534
BattleTag®:ravnhawk#1272
Realm:Zul'jin-us
Contact:

Re: Addon Rematch

Post by Ravnhawk » November 5th, 2014, 3:39 pm

Thanks! That sounds really simple. I am sure I was totally not doing it right.

User avatar
Emmaleah
Posts:9
Joined:June 15th, 2013
Pet Score:8976
Realm:Doomhammer-us
Contact:

Re: Addon Rematch

Post by Emmaleah » November 5th, 2014, 8:48 pm

Gello wrote:
Emmaleah wrote:Question about the notes? I added a few notes via copy paste from my personal notes to the addons notes. Then I went and copied the rest of my notes following the same format. I then went back into the game and discovered that didn't work. It over wrote it all to no teams saved. (Luckily I had a backup ). Any logical reason why that didn't work? And any possibility for an import of notes other than manually copy/paste.
Can you rephrase the part in bold? I don't understand what you mean. You made a bunch of notes to different teams, logged in later and the notes were gone? They had wrong notes? Did you happen to crash or exit the game abnormally for some reason in the session where you made the notes?
I made notes in the game. I exited the game normally. I searched in my file system and found the the save variables file. (rematch.lua) and observed the correct format to have the notes in and copied a bunch more of the notes in to the saved variables file using a text editor. I saved the file and then logged back into WoW. When I opened rematch, I discovered all my teams were gone. I presume that means I did something wrong when editing the saved variables file. when I check the file (rematch.lua from saved variables) in a text editor it is now a new file, with almost no info in it.

What I am asking is if there is a way to successfully do what I am trying to do? (I am not asking you to speculate on all the steps I might have done wrong, just if there is an obvious reason that wouldn't work?)

Gello
Posts:576
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Addon Rematch

Post by Gello » November 5th, 2014, 10:36 pm

Emmaleah wrote:I made notes in the game. I exited the game normally. I searched in my file system and found the the save variables file. (rematch.lua) and observed the correct format to have the notes in and copied a bunch more of the notes in to the saved variables file using a text editor. I saved the file and then logged back into WoW. When I opened rematch, I discovered all my teams were gone. I presume that means I did something wrong when editing the saved variables file. when I check the file (rematch.lua from saved variables) in a text editor it is now a new file, with almost no info in it.

What I am asking is if there is a way to successfully do what I am trying to do? (I am not asking you to speculate on all the steps I might have done wrong, just if there is an obvious reason that wouldn't work?)
Oh lol. Totally misread what you meant.

The way savedvars are written, a team can be formatted subtly differently:

Code: Select all

["Team Name"] = {
  [1] = { -- first pet
    "BattlePet-0-0000etc", --[1] petID (or speciesID or 0 if leveling pet)
    123, -- ability1 or 0 if leveling pet/empty
    123, -- ability2
    123, -- ability3
    9876, -- speciesID (if a petID is already known--or was known)
  }, -- [1]
  [2] = { -- second pet
    "BattlePet-0-0000etc", --[1] petID (or speciesID or 0 if leveling pet)
    123, -- ability1
    123, -- ability2
    123, -- ability3
    9876,
  }, -- [2]
  [3] = { -- third pet
    "BattlePet-0-0000etc", --[1] petID (or speciesID or 0 if leveling pet)
    123, -- ability1
    123, -- ability2
    123, -- ability3
    9876,
  }, -- [3]
  [4] = 1234567, -- npcID if known (could be not here or nil)
  [5] = 4, -- team tab number (could be not here or nil if general tab)
  [6] = "Notes goes here",
}
or:

Code: Select all

["Team Name"] = {
  { -- first pet
    "BattlePet-0-0000etc", --[1] petID (or speciesID or 0 if leveling pet)
    123, -- ability1 or 0 if leveling pet/empty
    123, -- ability2
    123, -- ability3
    9876, -- speciesID (if a petID is already known--or was known)
  }, -- [1]
  { -- second pet
    "BattlePet-0-0000etc", --[1] petID (or speciesID or 0 if leveling pet)
    123, -- ability1
    123, -- ability2
    123, -- ability3
    9876,
  }, -- [2]
  { -- third pet
    "BattlePet-0-0000etc", --[1] petID (or speciesID or 0 if leveling pet)
    123, -- ability1
    123, -- ability2
    123, -- ability3
    9876,
  }, -- [3]
  1234567, -- npcID if known (could be not here or nil)
  4, -- team tab number (could be not here or nil if general tab)
  "Notes goes here",
}
These two teams are identical. It's just written the former as an unordered table (typically for gold-named teams without an npcID, since there is no [4]) instead of an ordered array.

If there's a [1]=etc at the start of each entry, notes would be [6]="Notes here"

If there's no [1]=etc at the start, then notes would be its own line on the 6th entry. If you want to add notes to a team and there is no tab number, add a nil for the tab:

Code: Select all

  { -- third pet
    "BattlePet-0-0000etc", --[1] petID (or speciesID or 0 if leveling pet)
    123, -- ability1
    123, -- ability2
    123, -- ability3
    9876,
  }, -- [3]
  1234567, -- npcID if known (could be not here or nil)
  nil, -- team tab number (could be not here or nil if general tab)
  "Notes goes here",
}
Also, and this would explain the teams disappearing, don't use regular quotes for notes like this:

Code: Select all

      282, -- [4]
      1322, -- [5]
    }, -- [3]
    58960, -- [4]
    nil,
    "This is a test
of regular quotes
in notes.",
  },
WoW will just say this savedvar makes no sense, discard everything, and all teams and settings will be gone.

Instead use literal strings:

Code: Select all

      282, -- [4]
      1322, -- [5]
    }, -- [3]
    58960, -- [4]
    nil,
    [[This is a test
of literal strings
in notes.]],
  },
Note the [[ ]] brackets. Lua uses that to interpret what's between them literally.
Also note that the second+ lines all go to the first column. If you have indentation here it will dutifully include the indentation in the string and it will look awful.

Once that savedvar is loaded, when you /reload or logout, it will change to:

Code: Select all

      282, -- [4]
      1322, -- [5]
    }, -- [3]
    58960, -- [4]
    nil,
    "This is a test\nof literal strings\nin notes.",
  },
You can also use that format using \n for linebreaks but it would defeat the purpose of copy/paste.

But yeah, a good idea to keep a backup of the savedvars if you edit them directly. If WoW ever has any issues reading one it just discards the whole thing.

User avatar
Emmaleah
Posts:9
Joined:June 15th, 2013
Pet Score:8976
Realm:Doomhammer-us
Contact:

Re: Addon Rematch

Post by Emmaleah » November 5th, 2014, 11:53 pm

Thank you this is exactly what I was looking for. Sorry I explained it poorly the first time.

User avatar
Ryazan
MVP
Posts:251
Joined:February 24th, 2011
Pet Score:13560
Realm:Ragnaros-eu
Contact:

Re: Addon Rematch

Post by Ryazan » November 6th, 2014, 12:29 am

Gello wrote:To rewind a bit about the option to not reset filters, is the main purpose to revert to a standard filter? Like excluding TCG pets, excluding pets not collected, etc as a baseline filter? Perhaps we can combine the favorite filter idea and this. In the filter menu is Saved Default Filters and Delete Default Filters. When a default filter is saved, every time you log in it will start at the defaults, and every time you Reset All (or click the little X by the filter results at the bottom) it would restore to defaults. Thoughts?
Sounds like at least that will deliver what I was looking for. :)
- Taking your candles since 2005

User avatar
Iibis
Posts:154
Joined:October 21st, 2013
Pet Score:4297
Realm:Emerald Dream-eu
Contact:

Re: Addon Rematch

Post by Iibis » November 6th, 2014, 6:09 pm

I tested the latest (3.1.4) version at Celestial Tournament. Xu-Fu dies to Lightning Storm + Turret + Flock. The game doesn't display the fight until the end but simply ends it and I win. After that the other teams don't load, so it seems the latest version doesn't fix that unfortunately.

I'm sure you know what the fight is like, but here's a pet battle log from the fight against Xu-Fu. http://pastebin.com/kFHGXcHw Note that it doesn't say that Xu-Fu died or that my Szechuan Chicken died as well, which is what actually happened. It just ends like that.

I started using a new strategy against Nitun and noticed the same thing. Sometimes when Nitun dies to Stampede, it ends like Xu-Fu fight and a test team I made vs. Masked Tanuki next to Nitun doesn't load just like in the tournament. If the fight ends normally, there are no problems loading the Masked Tanuki team. Nitun fight is nicer for testing as it's spammable unlike the tournament. :)

I still had an issue with Yu'la loading after Chi-Chi (so every other team loads, every other doesn't), despite checking that the NPC ID was correct for the team and the log for Chi-Chi dying was normal though it died to Stampede. Stampede relates to Xu-Fu & Nitun too, though, as Inflation/Flock/Stampede are all similar. Doesn't however explain that Chi-Chi loads after Zao where I use Hunting Party, which should be in the same category as those other stampedes. Maybe it's all a red herring, argh!

I have a small request for the note function. If I update a saved team I lose the note for that team. I think it would be better if the old note didn't get overwritten, as I have now a couple of times accidentally lost team notes because I've updated one pet of a team for a better pet/breed. For example I replaced Voodoo Figurine with Sen'jin Fetish, which have identical abilities and the tactic is exactly the same, but I lost the team note because I again forgot that saving on top of another team will wipe the note. :/

Gello
Posts:576
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Addon Rematch

Post by Gello » November 6th, 2014, 7:43 pm

I've killed nitun half a dozen times with stampede and fights are always ending normally. PET_BATTLE_OVER fires, nitun is reported dead in log.

Could you post the team you used for nitun? I'd like to be able to reproduce this before I make blind changes. You don't have to export it. I've given up trying to get people to export teams to help me debug. Just the pets and abilities you used would be great.

Thanks btw for the details. This should help a lot to find the cause if I can see it happening myself with an event tracer running and such.

User avatar
Iibis
Posts:154
Joined:October 21st, 2013
Pet Score:4297
Realm:Emerald Dream-eu
Contact:

Re: Addon Rematch

Post by Iibis » November 6th, 2014, 8:03 pm

Here it is anyways.
Nitun:68565:218:210:592:476:627:163:743:663:455:411:165:163:

Sen'jin Fetish and H/P Infected Squirrel. Wild Magic -> Rot -> Stampede. Log#1: http://pastebin.com/hivKgUEQ, log#2: http://pastebin.com/Sr49HB1Z etc.

Is there a way to filter pets so that it only shows pets that I don't have rare versions of?

Edit. I put /etrace on and from the spam I could only find PET_BATTLE_CLOSE but not PET_BATTLE_OVER event after it ended.
Last edited by Iibis on November 6th, 2014, 8:14 pm, edited 1 time in total.

Gello
Posts:576
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Addon Rematch

Post by Gello » November 6th, 2014, 8:11 pm

Thanks! I'll try to reproduce this tonight.

User avatar
Iibis
Posts:154
Joined:October 21st, 2013
Pet Score:4297
Realm:Emerald Dream-eu
Contact:

Re: Addon Rematch

Post by Iibis » November 6th, 2014, 8:28 pm

I drank too much caffeine so I couldn't help trying debugging. :P

After a normal fight (masked tanuki) I see
PET_BATTLE_FINAL_ROUND
PET_BATTLE_OVER
PET_BATTLE_CLOSE

After bugged Nitun I can't see either the final round or over event. Just the close. If I kill Nitun with exploders, I see final round & over & close events.

Normal (against Masked Tanuki so just a normal pet battle fight):
Image

Bugged:
Image

I edited Rematch to use PET_BATTLE_CLOSE instead of PET_BATTLE_OVER and now the team for Masked Tanuki loads without issues after Nitun. Not sure if there are some negative consequences for using that event?

User avatar
Emmaleah
Posts:9
Joined:June 15th, 2013
Pet Score:8976
Realm:Doomhammer-us
Contact:

Re: Addon Rematch

Post by Emmaleah » November 6th, 2014, 9:05 pm

With your instructions above, I was able to add things via a text editor, but the spacing is not what I desired and other things I cant figure out (like lines missing) SO, just for anyone else who was thinking of doing this. Just copy and paste into the game, don't try to manually edit the Saved variables file, its more work than its worth. :)
Please don't take this as criticism of the feature. I really appreciate it. I just thought I would post to save some other person wasting a couple of hours to when trying to save time (something I am far to good at)

Gello
Posts:576
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Addon Rematch

Post by Gello » November 6th, 2014, 9:14 pm

Iibis wrote:I edited Rematch to use PET_BATTLE_CLOSE instead of PET_BATTLE_OVER and now the team for Masked Tanuki loads without issues after Nitun. Not sure if there are some negative consequences for using that event?
Nice work!

You caught exactly what I was looking for. I chose PET_BATTLE_OVER instead of _CLOSE since it only fired once and _CLOSE frequently fires twice. But I can rig it so the end-of-fight processing happens after both _CLOSE ends (will just throttle to 0.25 seconds and if second _CLOSE lags behind then it's not the end of the word if end-of-fight stuff runs twice).

I'll get that and the notes-not-losing-when-resaving-team thing up tonight or tomorrow morning.

Post Reply