NaN when trying to set a string to a string.

Get help using Construct 2

Post » Thu Nov 07, 2013 5:38 am

That's pretty much all the problem is that the title says. I have a playerMurderer string variable and when I try to set it to uppercase(Enemies.name) which is another string variable, it just returns NAN.
B
45
S
13
G
1
Posts: 236
Reputation: 4,010

Post » Thu Nov 07, 2013 12:08 pm

Did you somewhere divide by 0 when generating the playerMurderer string?
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
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Thu Nov 07, 2013 2:05 pm

At first you should look if Enemies.name is really decleared with a string or if it's empty (manual debuggin)

- first log Enemies.name before you use the uppercase
- after that log uppercase(Enemies.name)

maybe its not decleared and because of this it returns a NaN
B
7
S
3
Posts: 15
Reputation: 1,455

Post » Thu Nov 07, 2013 2:14 pm

Enemies.name must be NaN. That also implies it's set to a number when it looks like it ought to be a string.
Scirra Founder
B
399
S
236
G
89
Posts: 24,525
Reputation: 195,382


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests