I would like to have a stat screen where the information changes, while you are playing the game.
That means that I do not only want to add your name not until you wrote your name but I want to stay the variable *name to stay hidden.
So, I thought I could write an *if function like that *stat_chart .....*if (knowname) ..........text name .....text strength .....text whatever
but it looks like you can’t write *if in *stat_chart…
any ideas?
(how can I write the code in the forum s.t. it’s all in one box… and not each line in another box?)
My personal preferred method of this is to put the *ifs above the stat chart, where one after another they *goto each other to check if they are true and then eventually hit the stat chart.
`
*if (condition)
*set stat “true”
*goto statChart
*else
*set stat “false”
*goto statChart
*label statChart
*stat_chart
text stat
`
You can of course add more *ifs, you just have to put them under the label and make a new label for going to the stat chart.
This problem has been bugging me as well. The problem with multiple stat chats is that the bars don’t line up. I’d like to display a bar stat if it isn’t zero. So, as the game progresses, more and more bars show as the MC learns skills. But, if I do multiple charts, the bars don’t line up.
@CJW Ah, I always forget that most authors here are aiming to get their games hosted by CoG - yeah, if that’s the case then it definitely wouldn’t work.
Don’t think that’s a bug - there is a function “stat_chart” which includes bars that line up.
If you write “*stat_chart” twice you run two functions that both do the same with the variables each of them include.
I don’t think that it would be very easy to change the function so that it checks if there are other *stat_charts, then include the variables of those into the line up of the new variables…
Much easier to me sounds include the possibility of “if” for the list of variables.
@loelet - It’s not a bug, it’s what you might call an oversight.
It doesn’t break anything but it would be MORE convenient if we could either *if items in a stat list or keep all stats lists aligned the same (and *if entire charts).
I could it do something myself but if it’s not an official solution, CoG probably won’t port it.
This is off the top of my head, but could you “band-aid” it by adding to style.css:
.leftStatName {width:200px;}
replacing “200px” with some width equal to or longer than the width of your longest stat name? I think that’d line up the left edges of all the stat bars across charts.
However doing that wouldn’t be officially supported by CoG, and you’d have to go back and change it if you made any of the stat names longer. So I don’t know if I’d recommend it unless you’re comfortable with CSS…
@aetheria The reason you shouldn’t do it is because if CoG want to patch something, they patch all their games (for obvious reasons) - if you’ve got a tailored style.css or similar file, when they patch it - it’ll be overwritten with the vanilla one and start breaking stuff. They don’t have the time to individually patch games with modifications - the only thing they could do here is make the author responsible for all patches, but that has its own set of problems.
I’ve a problem with the *if in the stats, my game have perks player could acquire if perk are true well I cant stop all perks read true for instance nocturnal true in my stats I have:
*if nocturnal
--------*stat_chart
----------------text nocturnal Nocturnal
“text x y” in stat_chart is just another way of writing:
y ${x}
… by the way.
The reason why “text …” is cooler than the second thing is that also not even “text x” means x ${x}
which is much shorter but also “text IwRiTeSomEthInGHEre” would mean IwRiTeSomEthInGHEre ${iwritesomethinghere}.
So in your example there is no need to write an extra “Nocturnal” with a large “N”… (or an extra nocturnal with a small one) - since CS knows that Nocturnal, nocturnal, NoCtUrNaL all refer to the same variable “nocturnal”. So, “text Nocturnal” is all you need to get
“Nocturnal true”