Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Math problem - Percentage [SOLVED]
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#3
RE: Math problem - Percentage

Remember it's not x*y it's x/y.

Dividing by 0 would be a bad idea.

Both variables are int levels, and what I'm testing it with is:

FriendlyMonsterLevel = 1
EnemyMonsterLevel = 2 or 3

I know this for sure since I have billboards going active showing the exact level.

In all cases it returns 0.


Also, if you take a look at this line:
PHP Code: (Select All)
AddDebugMessage(GetGlobalVarInt("FriendlyMonsterLevel")+"/"+GetLocalVarInt("EnemyMonsterLevel")+"* 100 = "+((GetGlobalVarInt("FriendlyMonsterLevel")/GetLocalVarInt("EnemyMonsterLevel"))*100), false); 

it's showing the exact thing happening.

[Image: e721e3953b.jpg]
(It's not showing a paranthesis in the debug message, but there is one, if you look in the code)

Trying is the first step to success.
(This post was last modified: 08-30-2014, 01:54 AM by FlawlessHappiness.)
08-30-2014, 01:51 AM
Find


Messages In This Thread
RE: Math problem - Percentage - by Mudbill - 08-30-2014, 01:49 AM
RE: Math problem - Percentage - by FlawlessHappiness - 08-30-2014, 01:51 AM
RE: Math problem - Percentage - by MrBehemoth - 08-30-2014, 02:18 AM



Users browsing this thread: 1 Guest(s)