- Joined
- Jun 12, 2007
- Messages
- 1,261
I'm working on a save code of myself. But it doesn't work properly due to some math problems.
After a search I found what was the problem. The gold and exp values. They end up being 0. Why, I don't know.
Here is what I use to set up my variable for exp.
So this should result in: 0 x multiplier (1 to 5 at random) + 10101 = 10101
But it always ends up giving me a 0 why?
Is it because you can't multiply with 0 that I get 0?
Same goes for skills or gold when they are 0.
My formula must be (value x multiplier) + constant number
so even if the x part = 0 it should still add 10101
Help is needed.
After a search I found what was the problem. The gold and exp values. They end up being 0. Why, I don't know.
Here is what I use to set up my variable for exp.
- Set EXPAmount_ForSaves[(Player number of (Triggering player))] = ((Hero experience of Unit_PlayerHero[(Player number of (Triggering player))]) x (Multiplier_ForSaves[(Player number of (Triggering player))] + 10101))
So this should result in: 0 x multiplier (1 to 5 at random) + 10101 = 10101
But it always ends up giving me a 0 why?
Is it because you can't multiply with 0 that I get 0?
Same goes for skills or gold when they are 0.
My formula must be (value x multiplier) + constant number
so even if the x part = 0 it should still add 10101
Help is needed.