The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Combat system math problem
Author Message
pushim
Journeyman
*

Posts: 60
Likes Given: 20
Likes Received: 2 in 2 posts
Joined: Dec 2013
Reputation: 0



Post: #1
Combat system math problem
hello, i have a math question
as achievement increase damage by 10%?

i'm do this
ARGN1 += <weapon.dam>
ARGN1 += <eval <<weapon.dam>*(<anatomy>)*(10/100)*(1/100)>>


if for example
<weapon.dam> = 20
ARGN1 + = 2 (+ 10%)

but in game doesn't work this :/
06-01-2015 11:28 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #2
RE: Combat system math problem
<eval> only works with integer numbers (0, 1, 2, ...) and not floats (0.1, 0.001, 0.0001, ...)

10/100 = 0.1 and 1/100 = 0.01, but using these values inside an <eval> it will automatically change these values to int and both values will be 0

so your formula is not working because <eval <<weapon.dam>*(<anatomy>)*0*0>> will always result 0

to use float numbers you must use <floatval> instead <eval>, and dont forget that ARGN1 only works with int numbers so after get the float value you must change it back to int using <feval>

eg:
<feval <floatval 3 * 1.5>> =
<feval 4.500000> =
4

but anyway, I dont know what are you trying to do on this formula, but to get a simple bonus of 0% ~ 10% based on your anatomy skill you must use something like:
Code:
ARGN1 += <WEAPON.DAM>
ARGN1 += <eval ((<WEAPON.DAM> * (<ANATOMY>/100)) / 100)>
06-01-2015 04:05 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
pushim
Journeyman
*

Posts: 60
Likes Given: 20
Likes Received: 2 in 2 posts
Joined: Dec 2013
Reputation: 0



Post: #3
RE: Combat system math problem
So simple that i'm ashamed, and the explanation of eval and float serves me much
THX Coruja!!!!
06-02-2015 06:38 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)