Startup line 291 invalid expression expected OPERATOR, was VAR true]

I’m having this error above and I am sorta confused the error is here (*if captured true)…

*gosub check_suspicion 
*if captured true 
 *goto captured_scene 
*else

The gosub is this…

*Label check_suspicion 
*if (Fugitive = true) and (Suspicion >= 100) 
 *set captured true 
*return

And the create section looks like this…

*create Suspicion 0
*create Fugitive false
*create captured false
1 Like

Label should be lowercase? Looks like it passed regardless which is odd.

Try wrapping the *if in parenthesis.

*if ((Fugitive = true) and (Suspicion >= 100))
 *set captured true 
*return
2 Likes

It didn’t work although I thank you for noticing that.

1 Like

Oh wait I was looking at the wrong thing.

*if captured true 
 *goto captured_scene 

For this to work you need to do it in two ways.

*if captured = true 
 *goto captured_scene 

Or.

*if (captured)
 *goto captured_scene 

Might not need the parenthesis. If you just check a boolean variable it will be the same as checking if it were true (*if captured = true).

2 Likes

It worked and I’m a little embarrassed I didn’t notice it thankyou.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.