Scripting the birth of a new life.

Bale

Minion
I'm very sorry. I was aware of that bug and fixed it in my local copy, but I had forgotten to update it in this thread. Very belatedly I present...

Updated newLife to v1.72

  • Bug fixes.
 

Winterbay

Active member
Isn't that more a problem with you not having a familiar rather than with the sweater? And that problem is either from KoL not leting you have a familiar when you ascend (but I don't think that is the case) or you having a familiar with the letter B in it when you ascended.

Edit: Ninjad by Bale :)
 

Bale

Minion
Isn't that more a problem with you not having a familiar rather than with the sweater? And that problem is either from KoL not leting you have a familiar when you ascend (but I don't think that is the case) or you having a familiar with the letter B in it when you ascended.

I discovered that when I ascended and found myself familiarless. I believe because my familiar had a b. That's definitely a problem with the script though since there's no way for the user to control the issue short of remembering to use a legal familiar BEFORE entering the gash. I cannot consider that to be user error.
 

Winterbay

Active member
True, especially since there really is no way to demand that people know what path they are going to end up in before they ascend :)
 

Bale

Minion
Fortunately it wasn't hard for my script to check if you have a familiar. :) I just wish I'd rolled out that fix before it caused trouble for Weatherboy.
 

ziz

Member
I've run into a minor bug with 1.72:

Bad item value: "Newbiesportô tent" (newLife.ash, line 188)

Changing it from Newbiesport(character) tent to Newbiesport tent works as expected.
 

shazbot

Member
I've run into a minor bug with 1.72:

Bad item value: "Newbiesportô tent" (newLife.ash, line 188)

Changing it from Newbiesport(character) tent to Newbiesport tent works as expected.

FYI, this is an OSX specific bug, so the repeatability of it will be limited.
 

Veracity

Developer
Staff member
It's a bug in the script. The script SHOULD use item names with character entities, just like KoL and KoLmafia itself use, rather than operating system depending characters.

In particular, "Newbiesport™ tent".
 

Bale

Minion
If this is a bug in the script, then shouldn't KoLmafia write character entities when it does a map_to_file()? Is that a bug with map_to_file()?

Though I agree that I should play nice with OSX. It's just too easy to forget about that problem. I'll fix this in my next update.
 

xKiv

Active member
Mafia writes files in UTF-8 encoding, to my experience (and expects files in UTF-8).
NewLife.ash [1] is not in UTF-8. It's in some sort of 8-bit encoding, probably some "special" MS encoding (I tried iso-8859-1 through iso-8859-10 and none worked, cp1250 works and displays the character as superscript TM)

[1] at least as downloaded by firefox from the attachment in #1. But I am trying it on windows now, so 1) the broken thing is way before mafia even touches the script 2) not OSX specific at all
 
Last edited:

Veracity

Developer
Staff member
Your script has this:

use(1, $item[Newbiesport\231 tent]);

The actual name of the item is "Newbiesport™ tent".

Apparently, some systems are able to parse that original as a trademark symbol and some are not. I'm not sure what this has to do with writing items to maps, since your script doesn't do that. But I'll agree that if we read an item, we should probably normalize the name so that if you DO write it to a file, it will have the expected character entities and will be readable on any system.

Not that that would help with the strangely encoded character embedded right in the script, as in this case.
 
Last edited:

Veracity

Developer
Staff member
And revision 9406 does exactly that: when we create an item value, we normalize the name to the "data name". This script:
Code:
item [int] map;
map[0] = $item[newb tent];
print( map[0] );
map_to_file( map, "out.txt" );
generates this in the CLI:
> enc.ash

Newbiesport™ tent
and this map file:
Code:
0	Newbiesport™ tent
 

Bale

Minion
Not that that would help with the strangely encoded character embedded right in the script, as in this case.

I understood that. I merely meant that since mine was an error, you should look at how KoLmafia does it also. I figured that might cause trouble on some systems also.
 

Bale

Minion
Updated newLife to v1.73

  • Compatibility with r9408. Non-ascii characters are no longer permitted by KoLmafia's script parser.
 

morgad

Member
You could put them in your closet if you don't want EatDrink to use them. Is that bad?

Not bad at all, I have just never used my closet, and was not sure I coud pull stuff back out of it in hardcore.

sorry for the noise

Dave
 

Theraze

Active member
Closet can be used (or not) during hardcore as much as you want... the important thing there is that if you don't want it to be used automatically, be sure you have the preference to "take items from the closet whenever needed" off. :)
 
Top