Since you use *create in the startup scene, isn't the choicescript_stats file now void?


#1

Can anyone help me with this?


#2

No, it’s not void. The choicescript_stats file was never supposed to be where you created stats (that was mygame.js, which is now essentially void – at any rate, not a file that authors ever need to worry about editing).

Rather, the choicescript_stats file is where the game takes you when you click on the “Stats” button. It determines how the stats are displayed – not what they are. So still 100% relevant, as long as your game uses a Stats Screen.


#3

Ohhh…well what exactly should be in the choicescript_stats file? I have this in there


// Specify the default starting stats here

Stats = {
    Name: ??
    ,Gender: ??

    ,Beckham's Transformations: ??
    ,Health: 15
    ,Beckham's Health: 10
    ,Beckham's Manna: 8

    ,Relationship With Beckham: 50%
    ,Intelligence: 50%
    ,Courage: 50%
    ,Morality: 50%
    ,Stealth: 50%

    ,Inventory: Demon Book of Names, master key, 8/8 iron shavings, 2/2 salt, chemical instilled staff, flint and metal, blue candles, food, water

}; 
    
// or just use defaults 
// debugStats = stats 


#4

What you’ve got there (stat creation copied from the old mygame.js) should make for an error message when you click on your game’s Stats button.

Instead, you want to (1) make sure you’re working from the latest version of ChoiceScript (go to GitHub and download a fresh copy if you’re not sure), then (2) translate all that stuff into your startup.txt file like so:


*create name "??"
*create gender "??"
*create b_trans "??"

etc,

and in your choicescript_stats.txt file, have


*stat_chart
  text name
  text gender
  text b_trans Beckham's Transformations

etc.

You can have a look at mine, for reference:

https://dl.dropboxusercontent.com/u/88501596/CoRTest/web/mygame/scenes/startup.txt

https://dl.dropboxusercontent.com/u/88501596/CoRTest/web/mygame/scenes/choicescript_stats.txt

Having an inventory, as you’d like, is a lot more complicated – there’s a thread on it somewhere, probably written by @CJW like all such clever coding.

Edits: note that if you want Beckham’s Transformations to be a number, like his Health and Manna, you should create it as a number from the beginning: *create b_trans 0, not *create b_trans “??”

And when you create percentage stats, you create them as numbers, too: so *create intelligence 50, not *create intelligence 50%. You only display them as percentages, e.g.


*stat_chart
  percent intelligence


#5

I took a look at yours, and to me it looks like you have a *stat_chart seperating each type of stats? Do you have to do that instead of just leaving an empty spaced between them? and just out of curiosity, what does the

b_trans

code do?


#6

It’s been a while since I played with my Stats Screen, but when I first did, I recall that separating blocks of stats in the display worked by adding a new *stat_chart command and not by just adding an empty space. Don’t know if that’s still the case.

I suggested you use b_trans as a variable instead of “Beckham’s Transformations” on two grounds:
(1) you can’t have a space in a variable
(2) you’ll get really sick of typing out “beckhams_transformations” every time you want to code it.

You can still have “Beckham’s Transformations” as the way the variable is displayed in your stats screen – see my example above on how to do that. The player won’t see “b_trans” anywhere. But it’ll be a lot easier for you to type.


#7

@Havenstone
Beckham’s transformations are actually going to a description so they’re textual. And what if the stat is a number but not a percentage? and I’ll try to find the thread on making an inventory.


#8

If the stat’s a number you display it with “text” e.g.


*stat_chart
  text b_health Beckham's Health

See e.g. Charisma and Wealth in my game.


#9

Oh ok! and the b_health is just a shortened version? Like in your code where you used int instead of intelligence and cha instead of charisma?


#10

Bingo.