Builds on one below, please help

Zabikai
10 Dec 2020, 20:34

So I changed the code and now logically it makes sense, but I still get an Internal Error every time I try to use firsttime more than once in a function. I even tried two of the methods suggested.


Pertex
11 Dec 2020, 09:44

could you post the code of your function?


Zabikai
11 Dec 2020, 09:55

Of course, here is what I'm trying to do:

if (game.score>=100) {
  firsttime {
    msg ("<br/> Your muscles grow again, making you visibly stronger")
  }
}
else if (game.score>=50) {
  *firsttime*  {
    msg ("<br/>You have gained a bit of muscle, and can wield weapons better now")
  }
}

However every time I try to put in the second firsttime (the one with the asterisks) I get an internal error warning.


mrangel
11 Dec 2020, 11:21

Two questions.
Does it give an error if you try to add something else in the same place? (for example another msg line just for testing purposes)

And are you pasting it in code view using the web editor? (For some reason, code view on the web editor will give an error if you have a <br /> inside a string. I usually change the < to [ temporarily, and then change it back to < in the GUI)


Pertex
11 Dec 2020, 14:02

What is this?

*firsttime*  {

The * is only a marker to show the problem, you don't insert this in the code?


Zabikai
11 Dec 2020, 14:48

Yeah, theres no asterisk in the actual code


Zabikai
11 Dec 2020, 14:51

Ohhhhhhh, it's the < in the code editor thing. Mrangel, you really are an angel thank you so much!!!!