Bug - Not A Bug string_modifier(STRING, "Evaluated Modifiers") is not working!

Bale

Minion
Something is broke in r15472.

Code:
> ash string_modifier("Heightened Senses", "Evaluated Modifiers");

Returned:

> ash string_modifier("Prayer of Seshat", "Evaluated Modifiers");

Returned:

Those used to return the modifiers associated with the effects! Note that it still works if I call it with the effect data type.

Code:
> ash string_modifier($effect[Heightened Senses], "Evaluated Modifiers");

Returned: Meat Drop: +50, Item Drop: +25

> ash string_modifier($effect[Prayer of Seshat], "Evaluated Modifiers");

Returned: Experience (Mysticality): +3

For various reasons that is less useful for one of my scripts (a function is called for both items and effects) so I'd rather that mafia worked the way it used to work. Do recent changes regarding disambiguation really make this impossible?
 
Last edited:

Theraze

Active member
What is the type of those items you're looking up? You now need to include that. So if Heightened Senses is an effect, you'll need to do Effect:Heightened Senses. For example.
 

Bale

Minion
So it is now impossible for me to use the same function to deal with both items and effects without it knowing which sort it is dealing with?
 

Theraze

Active member
Well, you could parse one and if you get a null string, parse the other and hand the resultant string to your script...
 

Theraze

Active member
Something like this:
Code:
string unknown_string_evaluated_modifier(string lookup) {
	string result = string_modifier("Item:"+lookup);
	if (string_length(result) > 0) return result;
	return string_modifier("Effect:"+lookup);
}
 

Bale

Minion
I'm marking this as "Not a Bug"

Theraze, thank you very much for all the help here and OVER THERE.

My three publicly released scripts that this affects have now been updated on SVN. It isn't a difficult change, fortunately.

Also, I like your simple solution for unknown_string_evaluated_modifier(). ;) Though I'll probably take on some additional complexity and pass the relevant information to the function so that I don't need to brute force it.
 

xKiv

Active member
So it is now impossible for me to use the same function to deal with both items and effects without it knowing which sort it is dealing with?

You should never not know which sort you are dealing with. That way lies the rich wife yelling "when I said buy china, I meant *food*!".
 
Top