So, I’m having trouble with testing relationships that are grater than other relationships, as in, the game is through up errors when I try to run it.
Currently, I am using this format:
*if (relationship) >relationship
What would be the correct format in this situation?
Anyway, I hope that all of you who read this have a good rest of your day.
*if (relationship1 > relationship2)
should work. What is your exact error? Are you sure that you’ve created both variables ahead of time? And set them to numerical values?
For each relationship, you should have a
*create relationship 0
in the start up (0 can be replaced with whatever the starting relationship value is)
EDIT: the statement you have should work, it would never run because you’re checking if “relationship” is greater than itself, which it will never be, but it shouldn’t error.
1 Like
Currently, when I run the game, the error is:
First_day line 122: not a number: false.
No idea why it’s doing that, although the exact values I have are:
*if (t_relationship > n_relationship)
Do you have the code for where you set t_relationship and n_relationship? If you’re getting not a number errors, the problem is likely earlier on in the code.
The error code it’s giving you means that one of the variables is set to false instead of a number.
2 Likes
Currently, my code looks like this:
*create t_relationship 50
*create l_relationship 50
*create n_relationship 50
*create d_relationship 50
I’ve also got them a little further down, although just for variable testing:
*set t_relationship 50
*set l_relationship 50
*set n_relationship 50
*set d_relationship 50
So, yeah. Don’t know what’s going on, since you said above that the reason this is happening is because one of my variables is set to false instead of a number, but as I copied the code from my startup into the post that you see, well.
Print out the values of both variables before the if statement is called. Play the game and see what value each is set to.
Once you know for sure what the value is, then you can find out where it is going wrong.
You can also search for the variables to double check every place they are used
Yeah sorry, without any more information, not sure what the fix is.
Based solely on the info you’ve given, it should work. You’ve likely modified a variable somewhere and made a mistake there.
Think I fixed it, I forgot that I put some of the relationships as binary variables by mistake, just saw that now and corrected it, so that shouldn’t pop up anymore. Also learned how to print out relationships, so thanks for that, smily.
Really though, thanks for all your help on trying to fix this as it has been very much so annoying me for the last two days or so.