Ultimate Noob Coding


#365

Quicktest, if questions about it here are any indication, is a bully.


#366

I’ve also run into that annoyance with setting variables to zero, too. I’ve just taken to setting my variables to 1 at the start. So like,
*temp triplet 1

And then setting it as the real thing before I use the variable in multireplace.


#367

I’m going to be real with y’all. Like, painfully real. And prove that I’m not as far removed from the noob I was at the top of this thread as my Hosted Games Author title implies.

I was just about to ask how to type the vertical line that divides the different options, and then I realized there’s a key on the keyboard for that. And I’m about 75% sure that key snuck on here somehow in the night, because that’s the only explanation for someone who has been using a computer for 20 years not recognizing a key on a keyboard. Right? Yeah, it snuck on there. I’m sticking with that.


#368

Fun fact it’s called a pipe!


#369

Huh, I called it separator bar.


#370

Trying to make some achievements, noticed the name variable $!{aname} shows up as exactly that in the text body of the achievement. Is there a reason it did not update when the variable was set, and can I fix it or is it just not possible?


#371

I’ll admit I’m guessing here, but there’s probably no fix. The achievement will persist across all subsequent play-throughs, while the value of aname absolutely won’t.


#373

@hustlertwo I just discovered this temp variable is technically unnecessary. Instead, you could do the following:

*stat_chart
    text ("$" & money) Money

Basically, at many points you’d stick a variable’s name, you could instead stick a pair of parentheses and do stuff to the variable inside those parentheses!

Except it’s not actually changing the variable itself, only changing the way the player sees the variable. The variable’s value is unchanged. And sometimes that’s exactly what you need!

In the example above, I used concatenation, but the process works just as well for arithmetic. Behold:

It's currently ${temperature}°F. That means it's
*if temperature > 32
    ${(temperature - 32)} degrees above
*if temperature = 32
    exactly
*if temperature < 32
    ${(32 - temperature)} degrees below
freezing.

I’m glad I decided to test this idea. It’s pretty neat.