Quick question about multiplying variables

For questions about using Classic.

Post » Tue Sep 14, 2010 9:35 am

I've tried multiplying a variable several times, but even if I add "*25" to the end of a variable, it just prints the variable. I need maxhealth to equal Constitution multiplied by 25.



constitutionedit is an editbox, maxhealth is a number variable.

http://www.mediafire.com/?monkg3ssbvjyoyt - amaprogram.cap
B
2
G
2
Posts: 22
Reputation: 694

Post » Tue Sep 14, 2010 10:28 am

I've had similar issues with global and private variables in expressions. To fix it, specify in the expression what the type of the variable is: int, float or str.

change this
-> System: Set global variable 'Maxhealth' to global('Constitution')*32
to this
-> System: Set global variable 'Maxhealth' to int(global('Constitution'))*32

-cheers
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Tue Sep 14, 2010 11:23 am

Thanks again hound. : D
B
2
G
2
Posts: 22
Reputation: 694


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests