Feature - Implemented Track progress in Oil Peak, A-boo Peak

ckb

Minion
Staff member
Mafia tracks a lot of things. Lots of usefule things. But not this (yet).
It would be great if it tracked the progress of A-boo Peak hauntedness % and Oil Peak pressure (µB/Hg).
And then wrote this number to a settings property value.

And while I am dreaming of things, is there a way to track what has been done in the Twin Peak? This would be most useful for scripting.


Thanks,
ckb
 

Vandermonde

New member
Dunno about Twin Peaks, but visiting the tower after finishing the bridge creates an entry in the Quest Log with the other two items.
 

Winterbay

Active member
Mafia does not track twin peaks, you can look in Bumcheekascend for a way to do it in a script which is working pretty well.
 

ckb

Minion
Staff member
Mafia does not track twin peaks, you can look in Bumcheekascend for a way to do it in a script which is working pretty well.

Yes, thank you. I see that now.
I am actually working on ChIT, to add some quest tracking to the character pane, and was hoping to get this information without additional server hits. Though I suppose checking the questlog only for Twin peak might not be so bad.

ckb
 

roippi

Developer
So here's what I'll do:

3 preferences:
booPeakProgress (default: 0)
twinPeakProgress (default: 0)
oilPeakProgress (default: 0)

The three progresses will count up. booPeak is done at 100, twinPeak is done at 1 (*I think? see below), and oilPeak is done at 310.66. Optionally I can make the defaults 100, false, and 310.66, with the first and third counting down to 0 and the second a boolean. Or some combination. Whatever people convince me of.

*twin peak is poorly documented in the wiki. Note the bolded line. What is it in reality? Is the entry redundant just because the entry is redundant?
After speaking to the Highland Lord:

The Highland Lord wants you to light his three signal fires in the Highlands.

You should check out A-Boo Peak and see what's going on there. or You should keep clearing the ghosts out of A-Boo Peak so you can reach the signal fire. It is currently X% haunted. or You've lit the fire on A-Boo Peak.

You need to solve the mystery of Twin Peak and figure out how to light the signal fire. or You need to solve the mystery of Twin Peak and figure out how to light the signal fire. or You've lit the fire on Twin Peak.

You should go to Oil Peak and investigate the signal fire there. or You should keep killing oil monsters until the pressure on the peak drops enough for you to reach the signal fire. The pressure is currently Y microbowies per Mercury. or You've lit the fire on Oil Peak.
 

lostcalpolydude

Developer
Staff member
You need to solve the mystery (four parts) or burn the hotel to the ground. I don't know if people are hoping all 4 parts of Twin Peak get tracked (with all 4 parts set to complete/whatever if you burn the hotel down).
 

Bale

Minion
Twin Peak: There is a choice adventure with three different options, each of which needs to be completed separately in any order. That would be three different preferences to indicate which parts were completed. Then a fourth option needs to be completed to finish it.
 

roippi

Developer
I'm certainly not making three/four separate preferences just for twin peak. If there's a compelling reason for tracking the individual twin peak choiceadventure steps, I could make the preference a pipe-delimited string, but I'd rather not.

My point was that it's important to make closed-loop systems whenever possible. I want to be able to log in at any point, hit the quest log, and figure out where I am. But from what the wiki tells me, that's not an option?
 

Bale

Minion
Yup. Not an option.

The reason for tracking the twin peak steps separately is because they each require different preparations so you would need to buff for them. If you log out and come back the next day to finish it then you would be in trouble if you forgot which steps you have completed. It would be very useful for mafia to remember them to help the user.
 

roippi

Developer
Ehhh. I hate open-loop operation. The entirety of mafia's quest log tracking is built on this: steps are universally mapped to quest log entries because we want to have something to fall back on when Something Goes Wrong.

I'll sleep on making a bunch of individual twin peak booleans. It's awful, but maybe necessary. Meh.
 

Bale

Minion
Well you could just make one for twinPeak separated by pipes as you already suggested. Number the choice adventure options completed successfully. Like "2" or "1|2". If the preference doesn't contain that number, then that step wasn't successfully.
 

Theraze

Active member
Or twinPeak could be bits... 1/2/4/8. 15 means fully done, 4 means only the third choice done, etc. Yes, we're moving away from bitwise internally, but here it makes things relatively easy-ish and keeps us on a single value. Or pipes. Either way.
 

roippi

Developer
A bitmask seems fine. I'm still grumpy about it being open-loop but since these are kind of separate from the questLxxx preferences I suppose they can work differently.
 

ckb

Minion
Staff member
Yea for booPeakProgress and oilPeakProgress.
This solves the initial request.

Any of these twinPeakProgress options works for me, as long as someone can explain it clearly for how to interpret it once it is working.

Thanks.
 

Bale

Minion
Any of these twinPeakProgress options works for me, as long as someone can explain it clearly for how to interpret it once it is working.

He'll probably use the bitmask option which can be interpreted using bitwise operators. That works like this-ish:

PHP:
boolean twinStepDone(int choice) {
   return get_property("twinPeakProgress").to_int() & (2 ** (choice - 1));
}

Pretty small function, eh? Essentially, the twinPeakProgress will be an integer which is the sum of (2 to the power of choice number - 1) for each choice completed successfully. In binary those numbers are: 1, 10, 100, 1000. You can then determine if a given choice is a digit in that sum by using the bitwise AND operator.

If you know anything about binary numbers it should be pretty easy to understand the concept. If you don't know how binary arithmetic works, then it'd be tricky to explain so you should just use my code sample.
 
Last edited:

Veracity

Developer
Staff member
How about:
PHP:
boolean twinStepDone(int choice)
{
   return get_property("twinPeakProgress").to_int() & (1 << (choice - 1));
}
 

Bale

Minion
Oh. Yeah, I suppose left shift would be faster operation than exponentiation.

Hmm... It seems that operator precedence is such that those parenthesis could be removed, but I would be loath to do so.
 
Top