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-nmm7 (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-nmm7 (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-nmm7 (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
@Hit, ARGN1 and floatval/feval
Author Message
Murmur
Apprentice
*

Posts: 33
Likes Given: 3
Likes Received: 2 in 2 posts
Joined: Feb 2013
Reputation: 0



Post: #1
@Hit, ARGN1 and floatval/feval
Whats up guys, I was cruising along on my custom @Hit algorithms and I was making major progress until I hit this scenario and I can't figure out the magic formula.

Ok, so in my @Hit I have a long equation that, lets just say for ease, set ARGN1 = 22

That formula has been tested extensively ingame and works great.

Then I wanted to grant a bonus to that ARGN1 algorithm if the weapon in question was a 2hander.

So I simply wanted to take my ARGN1 = 22, and give a 10% bonus if it was a 2hander instead of a 1hander.

So logically I make ARGN1 = 22 * 1.1

Well, in the debugging process I instantly saw that eval was dropping it.

So I instantiated a variable, LOCAL.TWHOHANDBONUS equal to 1.1, and I tried 0.1, and I tried .1

Next I tried <floatval <LOCAL.TWOHANDBONUS>>, <floatval <fval <LOCAL.TWOHANDBONUS>>>

None of which worked, so here I am asking for help, I need to take my ARGN1 value in @Hit and add 10% to it, any ideas?

Thanks as always for the help.
-Murmur

I just thought about maybe doing all the math outside of ARGN1, then calling the result via a variable on the ARGN1 line?

Found the FLOAT.*** information in the WIKI, and I tried to do FLOAT.TWOHANDSBONUS = 1.1

I did ARGN1=22*<FLOAT.TWOHANDSBONUS> and it creates some massive numbers.. So still looking for the solution.

*you glance to your left to a region you just surveyed... you glimpse a magical being, more shadow than substance, caught midway in transformation... the figure smiles, the corners of his mouth jut upwards slightly on the edges, suddenly stretched to a length not at all human...*
(This post was last modified: 05-10-2017 03:41 PM by Murmur.)
05-10-2017 03:06 PM
Find all posts by this user Like Post Quote this message in a reply
Murmur
Apprentice
*

Posts: 33
Likes Given: 3
Likes Received: 2 in 2 posts
Joined: Feb 2013
Reputation: 0



Post: #2
RE: @Hit, ARGN1 and floatval/feval
Ok I got the result I wanted using Muldiv:

LOCAL.HitPassToARGN1 = 22
LOCAL.HitPassToARGN1Percent10 = <muldiv <LOCAL.HitPassToARGN1> 10 100>

ARGN1 = <LOCAL.HitPassToARGN1> + <LOCAL.HitPassToARGN1Percent10>

Seems like there is an easier way but maybe not, any suggestions would be helpful. Smile

As always, thanks for the help

*you glance to your left to a region you just surveyed... you glimpse a magical being, more shadow than substance, caught midway in transformation... the figure smiles, the corners of his mouth jut upwards slightly on the edges, suddenly stretched to a length not at all human...*
05-10-2017 04:10 PM
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)