Non-Existent Variable help

I was going through the Random Test and it was coming up with a non-exstant variable for the acceptedseeds section but I checked spelling and spacing and both seem fine.
This is my code for the start up.

*create acceptedseeds "?"

and this is what I have in the game where the issue is

*if acceptedseeds = Yes
	*goto acceptedseeds

You defined your variable as a string (text) , and you are asking CS to check whether it’s a boolean (should be true or false, not yes, btw)

This might help

1 Like

CS thinks ‘Yes’ is a variable here, I believe. The correct syntax is

*if acceptedseeds = "Yes"
	*goto acceptedseeds

Otherwise, CS is checking to see if the variable ‘acceptedseeds’ has the same value as the (nonexistent) variable ‘Yes’.


Definitely easiest to go with a t/f statement here, than to use a text variable.

1 Like

Thanks for the help and that did fix that part but now I’m getting the same problem in another spot.

*if (experenced1 = unkown)
			*set experenced1 "Samantha"
			*set expereincedfarmhands +1
			*set farmhandnumber +1
			*goto checkfarmhands

I’ve checked spelling and not sure what the issues is.

You need to use quotes when you’re using *if to check if variables equal a certain phrase, otherwise the system doesn’t now what you’re trying to compare.

*if (experenced1 = "unkown")

Ok thanks that worked

1 Like

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.