Sign in to follow this  
Followers 0
MythosGamer

Changing a stats name in Strange Eons?

22 posts in this topic

Hey guys! Im working on some custom investigators and I was wondering if theres a way to change the name of a stat in Strange Eons?  Its mainly just for flavor reasons and doesnt effect gameplay.  i.e. can I change Sanity or Sneak to say something else?  It seems like its not possible but I wanted to make sure i wasnt missing something.  Thanks guys!

Share this post


Link to post
Share on other sites

Copy, paste, and run the following in the Quickscript window while an invetsigator is being edited. (Script written for Strange Eons 3+.)

useSettings( Component );
$speed_text = 'PACE';
$sneak_text = 'PROWL';
$fight_text = 'POTENCE';
$will_text = 'PURPOSE';
$lore_text = 'PSYCHE';
$luck_text = 'PROVIDENCE';
$luck_text_ratio = 0.8;
$sanity_text = 'PELLUCIDITY';
$sanity_text_pointsize = 20;
$stamina_text = 'POWER';
Editor.redrawPreview();

Braknil and player1809340 like this

Share this post


Link to post
Share on other sites

Sorry to necro an old thread, but I was wondering if there was a Quickscript I could use to change the name of Fixed Possessions and Random Possessions to something different.  Also, would that script still work if you select the "Custom Text" box for shopping?

EDIT: Nevermind, I figured it out.  Just replace any of the above lines with

$random_possessions_text = 'Whatever you want';

and substitute random with fixed for the other one.

Share this post


Link to post
Share on other sites

Great, I was looking just ofr this.

 

Anybody knows how can I change the 'max.stamina' and 'max.sanity' text for characters with the Yin & Yang special skill?

Share this post


Link to post
Share on other sites

I think you didn't understand me, Dr.Faust.

 

Using $sanity_text = 'Energy'; I was able to change the description for all investigators except the ones who can change their Sanity with the Yin&Yang special skill. (The ones that have stamina/sanity as a stat) This stat has a different description: "MAX. SANITY".

 

I've tried using things like $maxsanity_text = 'Max. Energy' but it doesn't work. How did you find out the names for this settings for the investigator card component?

Share this post


Link to post
Share on other sites

I found the ones for the stats online during a search, but the rest just came from experimenting, I'm afraid. I don't think I've seen anyone try the Yin-Yang words though.

Share this post


Link to post
Share on other sites

Here are a few general ways to do this sort of thing:

 

Method 1

You can use the Quickscript window, as you've apparently been doing. If you have a recent build of Strange Eons, then there are a couple of new features to be aware of: First, you don't have to translate "-" to "_" in setting key names anymore. So instead of "$lore_text" you can just write "$lore-text". Second, I've started some work on a code completion facility. For JavaScript code this is still very much a work-in-progress, but code completion for setting keys works pretty well already.

 

Example:

  1. Open a new investigator; check Variable under Stamina/Sanity.
  2. Open the Quickscript plug-in window (from the Toolbox menu).
  3. If there is already some script code in the window, delete it (Ctrl+A, then Delete) or comment it out if you want to keep it for later (Ctrl+A, Ctrl+/).
  4. On an empty line, make sure that the $ notation you are about to use will refer to the currently edited component by inserting the line "useSettings( Component );"
  5. On a new line, type $ and the first letter or two or what you guess the key name might be (such as "$max").
  6. Press the code completion command key (Ctrl+Space) or select it from the Source menu. A list of possible completions appears, if there are any.
  7. Look for the setting key that matches what you expect, such as "$max-sta-text". Use the up/down cursor keys to select that option in the list, and press Space or Enter to select it. In the script, the rest of the key name will be completed for you.
  8. Finish the line of code, typically with something like " = 'some alternate text';".
  9. Add a line that will force the card to be redrawn with the new setting value: "Editor.redrawPreview();".
  10. Run the script.

 

Method 2

If you want to do this sort of thing a lot, it will be worth your time to learn to use the developer tools plug-in. It has a searchable table that matches against both keys and values (that is, you can search for the text you want to change, such as "LORE").

 

Example:

  1. Open a new investigator; check Variable under Stamina/Sanity.
  2. Open the Setting Explorer plug-in (in the Toolbox menu), make sure that the source is "Private settings" and, at the bottom. set "Parent settings to list" to "Immediate Parent Only". Now it will only show the custom changes you make and defaults for Arkham Horror.
  3. In the "Regex setting filter" field, just above the "Parent settings to list", type some of the text you want to change. In this case, just start typing "MAX" It will be enough just to type the "M" and the "A". Note that the filter is case sensitive. (And because it is a regex---that is, regular expression filter, it also recognizes some characters as special. For example "." matches any single character.)
  4. You can now see from the filtered-down table that the key names are "max-san-text" and "max-sta-text", respectively. You can edit them directly in the explorer by double clicking the current value in the Value column of the table (such as "MAX. SANITY").

Cheers,
Chris

Braknil likes this

Share this post


Link to post
Share on other sites

This may sound crazy, but is there a quickscript or setting I can use to get an investigator set to 3 sanity and 3 stamina?

And, yes, I know what I'm doing. -_-

Share this post


Link to post
Share on other sites

Yes.

 

It isn't as simple as changing a stat name, though.

 

What you'd do is set, say, Stamina to 3 and then paint the Sanity value yourself. To do that, you'd change the existing Sanity region so that it is completely off the card (by setting it to say, -200,-200,100,100). Then add an "on paint handler" to the component that draws your replacement Sanity value in the same location as the original. This is a bit of script code that you assign to the setting on-paint. When this setting exists on a component, every time a face gets painted the script code in this setting will be parsed and the onPaint function it defines will be called to customize the way the face is painted.

useSettings( Component );

// move the standard sanity value off the card face
$sanity-region = '-200,-200,100,100';
// set this to the standard location of the sanity value;
// this controls where we will paint our value, and should
// the standard location ever change we can fix our component
// by updating this setting
$fixed-sanity-region = '447,261,73,30';

// this function will draw the new sanity value
function onPaint( g, gc, sheet ) {
	var font, region;

	// this is called for every sheet (card face); we need to make
	// sure that we are dealing with the front face since that
	// is the only one we want to modify
	if( sheet != gc.sheets[0] ) return;

	useSettings( gc );	
	g.setPaint( new Colour( $ah-black-colour ) );
	region = new Region( $fixed-sanity-region );
	font = resources.ArkhamFonts.monoTitleFont;
	sheet.drawTitle( g, '3', region, font, $sanity-pointsize, 0 );
}

// we use the toSource() function to get the above function
// definition as a string of script text, and assign that to
// the component's on-paint setting; the default painting
// mechanism looks for this setting, executes the script it
// contains, and calls its onPaint function each time one
// of the component's sheets (faces, sides) needs to be redrawn
$on-paint = onPaint.toSource();

Cheers,

Chris

Edited by Thelric

Share this post


Link to post
Share on other sites

Hey, thanks for the last script, worked out just fine and finished the investigator to go with it.

 

Since this is the closest thing to a Strange Eons thread I could find, I wanted to let you know that the Create New Deck of Cards function isn't working on the latest version of Strange Eons for me.  Any idea why?

Uncaught TypeError: Cannot find function getIconForComponent in object ca.cgjennings.apps.arkham.NewEditorDialog[Form,6,5,726x438,invalid,layout=java.awt.BorderLayout,MODELESS,title=New Game Component,defaultCloseOperation=DISPOSE_ON_CLOSE,rootPane=javax.swing.JRootPane[,8,30,710x400,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.synth.SynthBorder@53f7e890,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true].
	at editors/plain-deck.js:27


Share this post


Link to post
Share on other sites

Sorry, didn't notice this earlier. If you haven't already done so, update to the most recent build, which fixes this problem.

 

Cheers,

Chris

Share this post


Link to post
Share on other sites

I tried changing some variables around, but I honestly don't know anything about coding :(.  Needless to say, didn't work.

 

BUT

 

I tried running the original unedited code from 4 posts up to see if that at least still worked and it doesn't!  Here's the error screen it gave me:

 

function onPaint(g, gc, sheet) {var font, region;if (sheet != gc.sheets[0]) {return;}useSettings(gc);g.setPaint(new Colour($ah-black-colour));region = new Region($fixed-sanity-region);font = resources.ArkhamFonts.monoTitleFont;sheet.drawTitle(g, "3", region, font, $sanity-pointsize, 0);}

 

EDIT: Don't worry about me, I'm just going to cheat it with Photoshop.  I am still curious about why the original code didn't work though...

Edited by Shining Aquas

Share this post


Link to post
Share on other sites

It does work, it just doesn't force the component to be repainted right away so you won't see the change until the next time the component is modified normally. Adding the line Editor.redrawPreview(); to the end of the script will redraw the component immediately so the change is picked up right away.

 

The message that is printed is not an error message (script errors are shown in a different colour). When you run a script in the Quickscript window, it prints the final value of the script (as if the script were evaluated as an expression... yeah, its a bit technical I'm afraid.) When the script consists of multiple lines, its value as an expression is the value of the last thing to be executed, which is the last line, the one that assigns a value to $on-paint. It turns out that when assignment is evaluated as an expression, the value of that expression is the value that is being assigned, which is the source code of the onPaint function.

 

You might be wondering what the point of printing the expression is. It is a useful shortcut for getting information. For example, you can type the name of any variable, run the script, and find out the variable's value (or more specifically its string representation). Or you can use the Quickscript window like a calculator by running an arithmetic expression: running 1+1 would print 2.0.

 

Cheers,

Chris

Share this post


Link to post
Share on other sites

Alright, I see what you mean.  I tried adjusting the character's sanity and stamina later and found that it did indeed work.  Ultimately, it ended up being easier to achieve my intended goal with earlier examples in this thread and some Photoshop magic:

 

qywDyg5.jpg

 

The main thing I was trying to accomplish was making an extra, single stat skill bar that would exist in the Ability space.  I know for sure that I couldn't figure that one out in Quickscript.

 

Anyways, thanks for all the help.

Share this post


Link to post
Share on other sites

Is there a way to make the dollar amount of a Miscellaneous Small item appear in the bottom corner when using a setting other than "Item-Style"?  I'd like it to be a "Title and Body", but still display the dollar amount.

Share this post


Link to post
Share on other sites

There are probably several ways.

 

Using code similar to the above, you can draw anything you want on a component face.

 

You could play with the settings and probably get something like what you want. For example, you could change the template image setting for the item style card to the use the same image as the title and body style card, and change the text region to cover the whole card instead of just the bottom half. Note that when changing the template image, you typically need to set the setting, save the component, close it, and reopen it before the image changes. Though that might not be the case for the misc small since the template image changes dynamically when you change the card style anyway.

Share this post


Link to post
Share on other sites

Not really related to this thread (especially since every code-based fix I have is just easier to accomplish in Photoshop), but I wanted to ask:

 

What's the progress on Strange Eons for Eldritch Horror?  Is there any?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0