Feature - Implemented Maintain data purity when setting item goals

zarqon

Well-known member
Not long ago, I requested more friendly warnings for things with the same name. Eliminating the resultant friendly warnings as I scripted led me to greater peace of mind.

Except in one case. The friendly warnings persist and there's nothing I can do to get rid of them. That's because once you set a specific item as a goal (correctly using the item ID, even), the information mafia gives you about that goal -- as supplied by get_goals() -- loses the item ID:

CLI said:
> condition add [7302]Spookyraven's library key

Condition added: Spookyraven library key

> ash get_goals()

Returned: aggregate string [1]
0 => +1 Spookyraven library key

Then, when a script goes to parse your current goals -- e.g. ZLib's has_goal() function -- it has to convert from the supplied string. Which prompts friendly warnings! AAAAAGHGHH

I would like to request that if mafia's internal representation of goals does not include item ID's, that it do so. I would then like to request that any relevant item conditions present in get_goals() be prepended with their item ID, so as to prevent necessitating more friendly warnings.

Thanks!
 

Bale

Minion
I've actually run into this specific example getting friendly warnings from my preAdventureScript before every adventure. It's rather a—awkward.
 

Veracity

Developer
Staff member
Looking at get_goals():

Code:
		List<AdventureResult> goals = GoalManager.getGoals();
This is promising, since an "AdventureResult" for an item includes the item #.
If it actually includes the number you specified, then it shouldn't be hard to include the item # in the string.
Perhaps only if it is needed for disambiguation.
 

Veracity

Developer
Staff member
Not too hard.

Code:
[color=green]> condition add [7302]Spookyraven's library key[/color]

Condition added: +1 [7302]Spookyraven library key

[color=green]> condition add 1 8-ball[/color]

Condition added: +1 8-ball

[color=green]> condition add 1 [1907]8-ball[/color]

Condition added: +1 8-ball

[color=green]> ash get_goals()[/color]

Returned: aggregate string [2]
0 => +1 [7302]Spookyraven library key
1 => +2 8-ball
Revision 20069
 

zarqon

Well-known member
One more thing to do here: looks like mafia's suggested goals for the billiards room include "1 Spookyraven library key". BatMan RE parses mafia's default goals and offers them as suggestions in its goal manager, which is resulting in "Multiple matches" messages when adventuring there (though fewer than before). I believe changing that to include the ID would solve this once and for all.
 
Top