Why is the code fine with é in one place, but not in another?


#1

alright. I’m currently despairing a little:
When going through my game atm, at one point the following error pops up:

WHHYY

image

this is the codeline in question:

 *if ((from_cafe = "true") and (cafe_checked_1 = "false")) #I head back to the café now.
      *if ((apartment_check_count1 = 2) and (apartment_check_up_count1 = 6))
         Now then, let's see...
         *set apartment_checked_1 "true"
         *goto investigatecafe

At the other choices the é in café works perfect fine, as demonstrated here:

Why?

image

Why?


#2

Are all your scene files saved in UTF-8?


#3

yes. And as you can see (now that the screenshots are up) it works perfectly fine the other times.
and this is the respective code:

*choice
   *disable_reuse #I investigate the café's sales floor closer.
      *set salesfloor_checked "true"
      *set cafe_check_count1 +1
      *goto cafe_floor

and

   *choice
      #I check the café of course.
         *goto insidethecafe1
      *if (apartment_checked_1 = "false") #Head back to the apartment.
         You turn and head back. Now let's see.
         *goto day1_hall_1
      #I've seen enough. I'll check the café tomorrow.
         *goto back_to_hotel

#4

Ok, have you tried setting a variable instead?

*set cafe "café"

#I've seen enough. I'll check the ${cafe} tomorrow.

#5

i’ll just replace it all with e.
after crying a bit.
it’s gotten physically draining


#6

gasps while clutching the é in my surname

Is setting a variable really the only way to guarantee that accent marks or the like can be properly depicted, or is it just the most consistent method?


#7

You shouldn’t have to put them in variables at all. UTF-8 should be able to handle it. I recommended putting it in a variable as a way of testing to see if the other code surrounding the problem bit was working properly; as a process of elimination.


#8

Its something else in the code.
I tested again and now instead of the é it’s the .

I’m at the end of my wits.

Could it be that the choice tree is too long?


#9

That’s one option. Try and break it down into single *if statements and see if the bug still happens.


#10

I’ll try making two new labels for the choicetrees.
As said. The problem seems to come from the
From_cafe variable.


#11

This may not be related or in a weird non-sensical way it may …

Here you list the label as “insidethecafe1” … everywhere else, in your code you separate the 1 with an underscore (_) … is your label written as “insidethecafe_1” or as you have written currently?

also:

in your code as written “f” is not capitalized … in this post it is.


#12

No, that is all fine. (The from_cafe too. In the post that was to blame on my phones auto-caps when switching lines.)
The labels are fine. I dunno whats wrong


#13

Are you getting the same error on your computer as you are on Dashingdon?


#14

If from_cafe is a true or false variable try

*if (from_cafe) or *if (from_cafe = true)

See if that fixes it.


#15

Same there.

Though i’ll prolly go and make two
*if bodies instead of having the choiceoption rely on it
Thanks everyone


#16

I’m curious with this error.
If you’ve the time, would you mind to put the full scene for me to take a look at?
Via dashingdon is fine.


Or maybe through pm if you wish to not spoil your story :]


#17

Are you in the discord group? I can throw the file at you tomorrow via there (and hope duscird does not meddle with the indents… the indents are not the problem)
Alternatively its the 5th scene on the list. 5_cocioldtowncafe.txt i believe feel free to check via the sceneslist


#18

Yap! I joined the server!

But since you mentioned that,

I guess I’ll just go ahead and check that out :eyes:


#19

Looking at the code I’m curious you seem to be having true or false variables be strings as opposed to actual true or false variables is there any particular reason for that?

What I mean is you do;

*set variable “true”

When you could

*set variable true

It should still work but with the later one you can simplify the check

*if (variable)

Instead of having to do

*if (variable = “true”)


#20

Doing it without the “” caused some errors to me before

and then theres the issue of my aspergers pretty much calling for me to do it this way otherwise ill get uncomfortable. Dx