Strange Eons issue

By Talismania2, in Talisman Home Brews

I recently updated my Strange Eons with the newest addition from Talisman Island so I could have access to the symbols like axe, disc, etc.

The problem is, whenever I try to open a card I have previously designed, I get a Script error window popping up and my card is simply a black square.

Please tell me there is an nice easy fix or I've done something goofy and all my many hours of work are not lost forever!

Unless it is already a well-known issue, Jon will probably need to know what the error message actually says if he is going to figure out the cause.

Until then, you should be able to keep using the old version of the plug-in (if you still have a copy) to keep editing your existing cards.

Cheers,
Chris

This is the error I get with Adventure Cards:

Uncaught TypeError: Cannot call method "equals" of null
at uibindings:160
at uibindings:638
at uibindings:654
at uibindings:181
at uibindings:395

Uncaught TypeError: Cannot call method "equals" of null
at uibindings:160
at uibindings:638
at uibindings:654
at uibindings:181
at uibindings:395

Uncaught ReferenceError: "$Card" is not defined.
at talisman4R/diy-adventure.js:214

Uncaught ReferenceError: "$Card" is not defined.
at talisman4R/diy-adventure.js:214

This is the error with Character cards:

Uncaught TypeError: Cannot call method "equals" of null
at uibindings:160
at uibindings:638
at uibindings:654
at uibindings:181
at uibindings:395

Uncaught TypeError: Cannot call method "equals" of null
at uibindings:160
at uibindings:638
at uibindings:654
at uibindings:181
at uibindings:395

Uncaught ReferenceError: "$Base" is not defined.
at talisman4R/diy-character.js:201

Uncaught ReferenceError: "$Base" is not defined.
at talisman4R/diy-character.js:201

I no longer have a copy of the previous plug-in unfortunately. Hopefully someone has it archived someplace?

I found my copy of the previous version anyways so not all is lost!

Hey guys

Hmm.. well I did actually know about this issue, but stupidly forgot to mention it. sad.gif

I think it is something to do with the new variables I have added or there may have been a couple that actually changed when I tidied up the files within the plugin.

I will have a look at it and see exactly what issues there are and see if it can be overcome. I shall be consulting High Lord Thelric shortly! gran_risa.gif

Right...

After a quick look it is the variables that have changed. I will have to see if there is anything that I can do about upgrading the .eon files. For example, the $Base variable did not actually exist in the previous versions, though $Card did have an equivalent, but the name was different... Leave it with me.

Thanks for taking a look at it. I was hoping to use the symbols from the new version, but if it can't happen then it can't happen. i will just design all future cards with the new version once I have my current project complete.

Hi Jon,

This is what the onRead( diy, objectInputStream ) function is for in your DIY script. It gets called while reading an existing card from a file. You just need to check whether the new settings keys are defined. If not, then you have read in an old card, so you need to give them an appropriate default value.

If you use $-notation, you'll get a ReferenceError if the setting is not defined, which you could catch in a try-catch block:

try {
$Funk;
} catch( ex ) {
// $Funk is not defined; upgrade old card
$Funk = "I've got the funk!";
}
println( $Funk );

Another way is to look up the setting the old-fashioned way by getting the Settings instance from the component. In this case, an undefined variable will have the value null:

if( diy.settings.get( "Funk" ) == null ) {
// $Funk is not defined; upgrade old card
$Funk = "I've got the funk!";
}
println( $Funk );

If the new setting has no counterpart on old cards, give it a neutral default value so that the card will come out looking the same. If the new setting is an update or variant of an old setting, try to translate the old value to the new value that is the closest match.

EDIT: I should have added that to make this easier in future you can set and check the diy.version variable. You set diy.version when the card is created to a version number (1, 2, 3, 4, etc.). The version number only needs to change when you add/remove/change settings or other things that are saved to the file. (For example, if you add a portrait to a card that didn't have one, you'd change the version number.) Then, in onRead you check the version number, add anything that is missing, and then finally update the version number:

var CURRENT_VERSION = 4;

function onCreate( diy ) {
// ...
diy.version = CURRENT_VERSION;
// ...
}

function onRead( diy, ois ) {
if( diy.version < 2 ) {
// version 2 added $Monkey
$Monkey = "No Monkey";
}
if( diy.version < 3 ) {
// version 3 added $Banjo
$Banjo = "Obnoxious";
}
if( diy.version < 4 ) {
// version 4 added $Silver
$Silver = "0";
}
diy.version = CURRENT_VERSION;
}

Cheers,
Chris

Okay, thanks to Chris explaining things VERY SLOWLY my old brain has finally understood what was needed!

I would still like to check it out before uploading though, so Talismania.. if you could me a line (link in my sig) I will give you somewhere to get the amended file to check it out.

Thanks for your patience!

I am at work right now and don't like to give out the work email, but you can send anything you want to [email protected]. I would LOVE it if the conversion worked since the project I am almost complete would be made much better with the use of the symbols.

I can open any type of adventure card now, but I am still getting errors when I try to open Character cards:

Uncaught ReferenceError: "characterBase" is not defined.
at talisman4R/diy-character.js:239

Now that the adventure cards are loading just fine, I was curious about a couple of things. Technically what I would love best is the ability to put the symbols into the card name instead of the body of text. I'm not asking you to do it for me Jon. I know my way around code and Strange Eons is obviously customizable, so I was interested in how I might get set up to modify the program myself?

EDIT: I've been reading the website and starting to get everything set up, but I am likely to have 1000 questions.

The easiest way would probably be to use the image tags that are used in the macros, rather than actually altering the code or the macros themselves. The problem being that the macros are set at a certain size to match the body of the special text (6pt).

For example, just add this to the Title line...

<image res://talisman4R/icons/mule.png 8pt 8pt>

If you look at the image below, in most cases the name in tags is the name of the image.

se_icons.jpg

Apart from - <hands> is jazzhands.png, <dark> is fate_dark.png, <light> is fate_light.png.

The expansion icons live in Talisman4R/expansions rather than Talisman4R/icons and are named reaper_30.png etc...

For some reason I can't find the Talisman4R/expansion or icons images...is there a particular file I need to unpack to get at them? I would like to edit some of the colours...

The images are held within the .seext file, which is a glorified zip file. Bear in mind that any changes you make to any of the components in the file won't be supported as updates are made, so I would encourage you to make your own little plugin with any changes in it. The Strange Eons website should contain all the information you need to accomplish that.