Random Tome Generator for Strange Eons

By ThorGrim2, in Fan Creations

Ok, here we (finally) have one of my finished SE plugins. This was the first one I started, kind of just a kickstart for me into modding SE, and thus may be kind of clunkily coded, but it works. I've tested it fairly thoroughly, and there is only one bug I can find, which is documented in the read me file included in the zip as I don't know how to fix this problem, not that it is a major bug. All feedback is welcome.

Updating:

There are not going to be any major updates anytime soon, but when I get Kingsport I will add any tome powers from it to the collection. The same goes for when I get Innsmouth. Also, there will be a minor update sometime when I find some more images as the collection so far is quite small.

www.sendspace.com/file/nr5x7g

thorgrim said:

I don't know how to fix this problem, not that it is a major bug.

The array of strings is defined at the global scope (that is, not within a function). Code at the global scope is only ever executed once, when the plug-in is first loaded. When you activate the plug-in, the run() function of the script is called, and it uses the symbols that were set when the array was defined at the time the plug-in was loaded.

There are lots of ways you could change this, but perhaps the quickest and easiest would be to replace the global array with a function that returns a new array each time it is called:

function ExhibitText() {
return [
// Tablet of Bast, COTDP
"<b>Arkham Encounters:</b> Before making any checks during an encounter,"
// ...
];
}

// ...

function GenerateText( TypeNum ) {
switch( TypeNum ) {
// ...
case EXHIBIT_ITEM:
return ExhibitText().pick();
// ...
}
}

Cheers,
Chris

Thanks for that, will hopefully have time in a couple of days to look at it again and fix it up.

Really nice plugin.

Thanks for working on this, and expanding an already brilliant resource.