How do I compare string in "compare two values"

Get help using Construct 2

Post » Mon Apr 06, 2015 5:10 am

Hi :),

I've been tring to compare a text variable, kappavar, that for example stored "Kappa" as a string in the "compare two values" event.

[kappavar == "kappa"]

Most times it returned false and sometimes it did return true, but not because it was the same string.
I know this because I listed many of the comparison events in the same group and all of them, with different strings comaprison, returned true!

Right now I have it working like this:

[-1 < find(kappavar,"kappa")


Is there a better way to compare strings & text variable?

Thanks!
B
8
Posts: 10
Reputation: 338

Post » Mon Apr 06, 2015 6:42 am

Code like this does not return false sometimes and sometimes true, when the values don't change. Go through your code again, you've probably made a mistake. Comparing a string like the way you want to has to work.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
20
S
9
G
1
Posts: 786
Reputation: 3,729


Return to How do I....?

Who is online

Users browsing this forum: Braus, pinoyaida and 4 guests