"Invalid create instruction only allowed at the top of startup.txt"

Hoping someone know what the problem is because I can’t figure out what I’m missing

When i’m creating a variable another variable to add on startup under one that works it stops working and says “create instruction only allowed at top of startup” even though the previous variable above it works just fine,

My code looks like this:
*create health “health”
*set health “:heart::heart::heart::heart::heart:
*create strength “strength”
*set strength “:heart::heart::heart::heart::heart:

health variable works, strength right below does not. I tried switching them around but and placing it on top any variable I create below the one does not work. right below is story text. Had no problems before I added the strength variable. Hope my problem makes sense,

That’s saying that you have to *create all your variables first, then you can do other stuff.

Also, you can create your variables with the initial value you intend to use instead of immediately replacing it.

*create health “:heart::heart::heart::heart::heart:
*create strength “:heart::heart::heart::heart::heart:

What the error means is that all the *create bits have to be at the top, with no *set or anything else until you’ve finished with *create.

Also, the “set” part of your code is unnecessary. Just have the hearts in the initial “create” part. For example:
*create health “:heart::heart::heart::heart::heart:
*create strength “:heart::heart::heart::heart::heart:

Better yet, make heart and strength both numerical values so they’ll be easier to manage in-game:

*create health 5
*create strength 5

Then if you want them to display as hearts in the stats page, you can do this:

*temp healthhearts ""
*if (health = 5)
   *set healthhearts "♡♡♡♡♡"
*if (health = 4)
   *set healthhearts "♡♡♡♡"

And so on. Does that make sense?


Thank you for your help!

1 Like

I think so! Thank you for your help!

1 Like