Bug - Fixed Scritp verification error less than helpful unless creating debug log

Winterbay

Active member
Sometimes I do stupid things when I write ash-scripts. Generally it is trying to compare two variables that are not the same type (stat versus int for example when I forget that my_primestat() returns a stat and not the value of said stat). In this case the verification prints out "Cannot apply operator " which doesn't really help. Starting a debug-log, verifying and stopping the log gives the following text in the debug log:
Code:
Cannot apply operator < to safeMox() (int) and my_primestat() (stat) (test.ash, line 17)

Which is slightly more helpful. Could the printout in the CLI be the same as for the debuglog? Or is my setup somehow screwed up and this is working for everyone else?

The code I used to create the error in this case were:
Code:
//Returns the safe Moxie for given location, by going through all the monsters in it.
int safeMox(location loc) {
	//Softcore is deemed to be able to take care of virtually any ML. 
	if (loc == $location[primordial soup] || !in_hardcore() || get_property("bcasc_ignoreSafeMoxInHardcore") == "true") return 0;
	int ret = 0;
	
	//Find the hardest monster. 
	foreach mob, freq in appearance_rates(loc) {
		if (freq >= 0 && mob != $monster[Guy Made of Bees]) ret = max(ret, monster_attack(mob));
	}
	//Note that monster_attack() takes into account ML. So just add something to account for this.
	return ret + 4;
}

location best = $location[none];
foreach loc in $locations[] {
	if(safeMox(loc) < my_primestat() && safeMox(loc) > safeMox(best)) best = loc;
}
print("The best place to level in is " + loc);
 

StDoodle

Minion
I'm getting the same thing... However, flip that comparison sign around, and I get:
Code:
Cannot apply operator > to safeMox() (int) and my_primestat() (stat) (deleteWBtest.ash, line 17)

Leads me to wonder if there's an accidentally-parsing-as-HTML-tag-opening issue...
 

Veracity

Developer
Staff member
Yes. This is an issue with how it is shown in the gCLI, not what error message we generate.
 
Top