Question about Gosub highest_Calc

So, I set up all the gosub highest_calc stuff, but now I am getting this when gosub_scene highest_calc
“highest_calc line 1: invalid create instruction, can only be done at the top of startup.txt”
Only got that after it threw up an arror when I just had *gosub highest_calc. Not really sure what to do here. If I need to change the code on the highest_calc file, not sure what to change, or to change it too, really.

The error means in highest_calc

You have *create on the 1st line.

*create is only valid in startup.

1 Like

I am aware of that, but I am confused about is from what I was told, several star creates are required in highest underline Calc.
I have the highest underline Calc set up as a way to track the relationships, so that I can use highest underline relationship to call the story to go to different scenes based on who has the highest relationship among the characters.

I’m assuming you use the code Sinnie has wrote of. Or any modifications of of it?

*create highest_relationship ""
*create highest_relationship_stat 0

*create relationship_name_1 "t"
*create relationship_1 0
*create relationship_name_2 "l"
*create relationship_2 0
*create relationship_name_3 "n"
*create relationship_3 0
*create relationship_name_4 "d"
*create relationship_4 0

*create total_relationships 4

*label highest_relationship_calc
*temp relationship_counter 1

*label relationship_calc_loop_start
*if relationship_counter <= total_relationships
    *if relationship[relationship_counter] > highest_relationship_stat
        *set highest_relationship_stat relationship[relationship_counter]
        *set highest_relationship relationship_name[relationship_counter]
    *set relationship_counter + 1
    *goto relationship_calc_loop_start
*return

If so, then sorry I forgot to mention that all of the *creates are still going to be placed in the startup.txt.

I mentioned something required for the code to work, and by that I mean the number in the variables name, as in relationship_name_1, relationship_1, and so on.

If this is not the case, then you can ignore it.

Edit: Just realized that I can’t do bold in preformatted text

2 Likes

That makes sense, yeah, I had The creates in the Calc file. Thanks, I’ll swap them out and see if it fixes it.