[Papyrus] Simple math issue

Post » Thu Aug 25, 2016 11:36 pm

So I'm new to programming, and have learned a decent bit of Papyrus. I have never done math within programming, so this might be a dumb question. When I try to multiply an intger variable that I made, it will not work. I have made sure the variable has an assigned value.



Reward = Currentbet * 2

Currentbet has an assigned value when his code is executed, and I want to fill the int: Reward, with: Current bet * 2.


Any help is appreciated.

User avatar
Ellie English
 
Posts: 3457
Joined: Tue Jul 11, 2006 4:47 pm

Post » Fri Aug 26, 2016 10:12 am

Hey, post your full script if possible. Also, what do you mean by "it will not work?" Does the script not compile, or does Reward not equal the expected value? When in doubt, use debug messages to figure out what is going on with the script.



int Currentbet
int Reward

Function SomeFunction()
Currentbet = 23
Debug.Notification("Current bet is set to " + Currentbet) ;expected to be 23
Reward = Currentbet * 2
Debug.Notification("Reward is now set to " + Reward) ;expected to be 46
endFunction
User avatar
JAY
 
Posts: 3433
Joined: Fri Sep 14, 2007 6:17 am


Return to V - Skyrim