Bug - Fixed edPoints never increments

Veracity

Developer
Staff member
I just completed my 15th Ed run.

> get edPoints

0
The only place is in the code where that is incremented is in KoLCharacter.liberateKing:

Code:
			else if ( oldPath.equals( ACTUALLY_ED_THE_UNDYING ) )
			{
				int edPoints = wasInHardcore ? 2 : 1;
				Preferences.increment( "edPoints", edPoints );
			}
The only place where that method is called is in SorceressLairManager.parseTowerResponse:

Code:
		if ( action.equals( "ns_11_prism" ) &&
		     responseText.contains( "King Ralph the XI stands before you in all his regal glory" ) )
		{
			// Freeing the king finishes the quest.
			QuestDatabase.setQuestProgress( Quest.FINAL, QuestDatabase.FINISHED );
			KoLCharacter.liberateKing();
			return;
		}
Obviously, that never happens when you are Ed. Instead, we set Quest.FINAL to Quest.FINISHED when you receive the scarab beetle statuette.
 

Theraze

Active member
As a cleanup job, should edPoints consider how many points you have when you visit the book and compare what that means for edPoints, if you aren't at a point yet where you can unlock everything and are above level 1.
 

Veracity

Developer
Staff member
The book pegs at 21. You can have an additional 9 servant imbumentation points.
I suppose we could parse the "you can learn X more skills" and "you can ..." (whatever the servant message is) and ensure that edPoints is at least as large as needed to make that possible.

A gripe: I thought I was done with Ed, but decided to do one more run so I could switch to Seal Clubber for aftercore Wart Dinsey - and write and test parsing the event for the /servant command. I had 9 servant points by the time I got my first servant and happily gave one of them to my Priest. When I got my second servant, a few turns later, I selected the Scribe - and forgot (and/or didn't notice) that summoning forth a new servant did NOT automatically make him active. As a result, I used a couple of servant points on my Priest before I wised up and activated the Scribe. And I did it again when I got my next servant...

Considering that I have done this on multiple different runs, I'd have to characterize NOT making the newly activated servant your current servant as a User Interface Flaw.
 

Bale

Minion
I made that mistake myself twice. Ugh! It's a seriously UI flaw, but it is KoL's UI flaw so there's nothing for us to do about it. :(
 

Theraze

Active member
Unless KoL can make a new button for "Unlock and activate" which will do the two requests. But... that would be a different FReq unrelated to this bug.
 

PeKaJe

Member
This is the first path that doesn't end with freeing the king, to the best of my knowledge.
The Ed path ends when you return the MacGuffin, or at least that's where I would reasonably guess points are awarded.
As such, could the kingLiberated function not be called on encountering choice 1055, right before the call to handleAfterAvatar?
As for cleanup, I feel it should be up to people to manually set the points if they feel it's important (e.g. if it makes it into a profile snapshot of some sort).
 

Veracity

Developer
Staff member
I feel it should be up to people to manually set the points if they feel it's important (e.g. if it makes it into a profile snapshot of some sort).
That is at odds with how we track skill progress in every other Avatar path. I have no sympathy for profile snapshots that depend on a setting that might or might not be accurate, but After Ascension scripts might want to be able to buy skills for you without using a server hit to find out how many are available.

Edit: Oh, I see what you mean. "cleanup" is fixing currently incorrect settings.

I suppose we could just let people fix them by hand, but there are any number of other places where we auto-correct things that have wrong if we can deduce a better value by looking at a page that the user asked us to visit anyway.

I see that EdBaseRequest.java exists but is pretty vestigial. seems like EdBaseRequest.parseResponse could be munged to do that stuff. If anyone is still doing Ed, it would be helpful if they could get a debug log from a newly ascended character visiting the Skill Book location, and visiting the servant quarters once that hit level 3.
 
Last edited:

PeKaJe

Member
I just ascended and the attached debug log is from visiting the book of undying and the servant's quarters immediately after ascending. I had 22 extra starting points, and including the first free skill point, I should have enough for 21 pages and 2 wisdom impartments. This is indeed reflected in the HTML of those pages. Once wisdom has been imparted, I don't think it's shown anywhere (don't know if mafia tracks it, but I don't see why it should). As such, it would be dangerous to rely on anything shown in those places, after a servant has been released. Maybe the best way would be to force a visit right after ascension, and parse the values only then?
 

Attachments

  • DEBUG_20150514.txt
    86.8 KB · Views: 54

Veracity

Developer
Staff member
Well, we can either force a visit, or just look on passively when the user visits them manually.
I was thinking we'd set edPoints only if the displayed value is greater than what our setting thinks it is.
I'll look at your log soon. Thanks!
 

Veracity

Developer
Staff member
could the kingLiberated function not be called on encountering choice 1055, right before the call to handleAfterAvatar?
I think this is exactly right: you have just selected your new class, so we are done with the choice adventure and can do all the various requests we need to do when leaving a restricted class (like Ed) in order to get into aftercore.

Revision 15912 does this. Untested.

That revision also attempts to correct edPoints when you visit the book or the servants quarters, based on what it sees about how many skills you can learn or how many points of wisdom you can imbue. Using HTML from your DEBUG log:

I had edPoints=30
I did "test load edbase_book.html"
I did "test visit-choice"
edPoints remains 30
I did "test load edbase_door.html"
I did "test visit-choice"
edPoints remains 30

I set edPoints=0
I did "test load edbase_book.html"
I did "test visit-choice"
edPoints is now 20
I did "test load edbase_door.html"
I did "test visit-choice"
edPoints is now 22

So, except for testing what happens when Ed chooses his new class, I think this is done. I will not be testing that any time soon (if ever), so I will optimistically mark this Fixed.
 

PeKaJe

Member
The bit about what happens when Ed chooses a new class is something I had patched into my own build a while ago, and that works. I noticed that my patch management script thought I was reversing an already applied patch, so I know the code is exactly the same. The only worry I have is that I don't know if the same choice is used for when you drop the path and what would happen then. I don't intend to ever do that, though, so I won't be testing that.
 

Veracity

Developer
Staff member
Well, if you drop your path, we should not call kingLiberated, since you haven't actually freed the king yet. If dropping your path also sends you through choice 1055, we'd have to detect somehow that this was NOT a result of returning the MacGuffin.

Like you, I will never test that, though.
 
Top