Jump to content
  • 0

Calculating with point values​​.


Hismoon

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  48
  • Reputation:   0
  • Joined:  12/07/11
  • Last Seen:  

Hello,

I have a script in these I want to calculate with point values like 0,33*5 or so on.

But now is the problem that the ragnarok server didn't calculate with point values as far as I know.

I have test the script on my server, but if I load the script comes the error that something is with the 0,33 like:

parse_simpleexpr: unmatch ')'

line xxx: set .@x, (0','33*5+3);

I hope someone can help me with this problem.

Hismoon~

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

There's no float in the script engine.

To support it you have to multiply per 100 (or much).

Example:

set .@x, 33 * 5 + 300; // .@x/100 = your result

Another thing is to assume that 0.33 = 1/3 so:

set .@x, 5/3 + 3;

But the result here is trunk: Floor(result).

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...