Ultimate Noob Coding

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

3 Likes

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.

2 Likes

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.

5 Likes

Fun fact itā€™s called a pipe!

3 Likes

Huh, I called it separator bar.

1 Like

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?

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.

1 Like

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

3 Likes

i was looking on the choice of games wiki for dice coding cause id like to have it so that i could make it harder for people to fight against a zombie hoard and i want to possibly make there a chance for the character to get bit and a chance for people to turn on you if you lead the group if you make an evil decision but also to give the player a buff with how much they fear you if you go down that route

i also was looking for a simple item collecting code to set up into stats menu that tells how much of the item you have and when you use it it goes down or find more of the item it goes up

*create dice 0

...

*label roll_dice

*rand dice 1 6

You rolled a ${dice} on the die.

(alternatively)

You rolled a @{dice+1 |one|two|three|four|five|six} on the die.

Assuming your result is 2, youā€™ll see either

You rolled a 2 on the die.

or

You rolled a two on the die.

depending on how you output the result.

1 Like

If you donā€™t want them to see the results of the roll and have it work behind the scenes DM-style, you just do like will said, but instead of outputting the answer, you use an *if for each outcome.

Forgive the lack of indents in the following, I am on my phone.

For example:

*temp fightroll 0
*rand fightroll 1 3
*if (fightroll = 1)
     *goto youdie
*if (fightroll = 2)
    *goto youlive 
*if (fightroll = 3)
    *goto youwin

1 Like

Thank you both so much

3 Likes

Okay, so I am wanting to institute a save feature for my WIP. I tried it with Nuclear Powered Toaster and it never worked right, but I am sure thatā€™s because I didnā€™t ask about it here, where all the smart people hang out. How do I do this and have it actually function this time?

Which one specifically, the on-the-fly or chapter restart save system?

For the former, all you need to do is check a box on dashingdon. For the latter youā€™d need to write one, where it takes a snapshot of all the var values at the start of the chapter and then restores them if the reader chooses to reload at the end. I do believe a subroutine (in a separate .txt scene) should be the most efficient here. Then you just use *gosub_scene.

1 Like

Two questions

  1. Do you want the save function to transfer over into the published version; a custom save feature?
  2. What are you expecting from your save feature? Checkpoint? Progress tracker? Save-and-load anywhere you like?
1 Like

The Dashingdon one is all I want. This is just to help my beta readers, not for the finished product. I clicked the box and it didnā€™t work. I inserted the code it mentions and it killed the whole demo (said it was an invalid command I believe). This is the same thing that happened when I tried it with NPT, except this time I have time enough to try and resolve it. What specifically is needed to use it?

I removed the code, since it made the demo unplayable. I can reinsert it later today or tomorrow to try again.

You just need to insert it for your dashingdon version. *sm_init works in tandem with the checkbox thing in the site.

In your case, your error only comes up in your local version as you donā€™t have something to checkbox.

1 Like

Iā€™d also like to add that you make sure that *sm_init goes after all the *create and *achievement lines in startup. Otherwise itā€™ll produce an error.

Yeap!

1 Like

Ah, thatā€™s the issue. First I put it before everything, then after title but in the middle of the create list. It needs to literally be right above the start of the story I take it?

@Szaal I was testing it off the Dashingdon, for the brief time I had the version with the code uploaded. Does that mean it will prevent me testing locally though?

If you want the feature to present in your local version, thereā€™s more things to do. You can check it out on the saving plugin thread, but in the mean time, Iā€™m at outside.

Iā€™ll try to do something once I get back.

1 Like