Jump to content



Photo

Changing a stats name in Strange Eons?


  • Please log in to reply
20 replies to this topic

#1 MythosGamer

MythosGamer

    Member

  • Members
  • 5 posts

Posted 30 December 2012 - 03:28 AM

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!



#2 Thelric

Thelric

    Member

  • Members
  • 251 posts

Posted 01 January 2013 - 05:17 PM

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();


  • Dr.Faust and Braknil like this

#3 Shining Aquas

Shining Aquas

    Member

  • Members
  • 152 posts

Posted 08 April 2013 - 04:27 PM

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.


My Custom Creation Thread - Tons of content of all kinds, just download and print yourself.

My Custom Gallery - Previews of everything I've made in one convenient space.


#4 Braknil

Braknil

    Member

  • Members
  • 6 posts

Posted 15 September 2013 - 10:41 AM

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?



#5 Dr.Faust

Dr.Faust

    Member

  • Members
  • 352 posts

Posted 15 September 2013 - 05:22 PM

Yep

 

Same as the deal with Stats, just pick 'Stamina'. I did it when I used SE to make stuff for Champions.



#6 Braknil

Braknil

    Member

  • Members
  • 6 posts

Posted 17 September 2013 - 06:58 AM

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?



#7 Dr.Faust

Dr.Faust

    Member

  • Members
  • 352 posts

Posted 17 September 2013 - 02:09 PM

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.



#8 Braknil

Braknil

    Member

  • Members
  • 6 posts

Posted 19 September 2013 - 03:02 AM

Ok. Thanks anyway. I guess I'll have to keep trying words...



#9 Thelric

Thelric

    Member

  • Members
  • 251 posts

Posted 19 September 2013 - 03:03 AM

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

#10 Braknil

Braknil

    Member

  • Members
  • 6 posts

Posted 20 September 2013 - 02:36 AM

Wow, thats very interesting. Thank you very much, Thelric!



#11 Shining Aquas

Shining Aquas

    Member

  • Members
  • 152 posts

Posted 04 October 2013 - 11:39 AM

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. -_-


My Custom Creation Thread - Tons of content of all kinds, just download and print yourself.

My Custom Gallery - Previews of everything I've made in one convenient space.


#12 Thelric

Thelric

    Member

  • Members
  • 251 posts

Posted 05 October 2013 - 03:44 AM

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, 05 October 2013 - 05:46 AM.


#13 Shining Aquas

Shining Aquas

    Member

  • Members
  • 152 posts

Posted 20 October 2013 - 02:46 PM

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



My Custom Creation Thread - Tons of content of all kinds, just download and print yourself.

My Custom Gallery - Previews of everything I've made in one convenient space.


#14 Thelric

Thelric

    Member

  • Members
  • 251 posts

Posted 11 November 2013 - 05:09 AM

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



#15 Shining Aquas

Shining Aquas

    Member

  • Members
  • 152 posts

Posted 07 January 2014 - 03:46 PM

Alright, I have a new one for ya.

 

Is it possible to change the skill slider values from numbers to letters?


My Custom Creation Thread - Tons of content of all kinds, just download and print yourself.

My Custom Gallery - Previews of everything I've made in one convenient space.


#16 Thelric

Thelric

    Member

  • Members
  • 251 posts

Posted 09 January 2014 - 12:12 AM

You could adapt the code four posts up to do so.

 

Cheers,

Chris



#17 Shining Aquas

Shining Aquas

    Member

  • Members
  • 152 posts

Posted 09 January 2014 - 08:57 PM

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, 09 January 2014 - 09:12 PM.

My Custom Creation Thread - Tons of content of all kinds, just download and print yourself.

My Custom Gallery - Previews of everything I've made in one convenient space.


#18 Thelric

Thelric

    Member

  • Members
  • 251 posts

Posted 10 January 2014 - 12:44 AM

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



#19 Shining Aquas

Shining Aquas

    Member

  • Members
  • 152 posts

Posted 10 January 2014 - 03:11 AM

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.


My Custom Creation Thread - Tons of content of all kinds, just download and print yourself.

My Custom Gallery - Previews of everything I've made in one convenient space.


#20 Shining Aquas

Shining Aquas

    Member

  • Members
  • 152 posts

Posted 02 June 2014 - 03:51 PM

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.


My Custom Creation Thread - Tons of content of all kinds, just download and print yourself.

My Custom Gallery - Previews of everything I've made in one convenient space.





© 2013 Fantasy Flight Publishing, Inc. Fantasy Flight Games and the FFG logo are ® of Fantasy Flight Publishing, Inc.  All rights reserved.
Privacy Policy | Terms of Use | Contact | User Support | Rules Questions | Help | RSS