Page 1 of 1

A few questions

Posted: Wed Jun 19, 2019 1:49 pm
by JacktheRipper

A few days ago I started studying POL's documentation and scripting, Racalac's guide helped a lot, but a few questions remained.

First of all, CInt(). What the hell is it for? Im reading a script that says "cd = CInt(time/10) and can't understand what's the purpose in here. On Racalac's guide it only says "CInt(100.3) // Results in 100", I mean, it just return a value as an int?

Second, I'm having some issues with another part of this script. It's was not written by me, i'm just trying to debug, but I noticed a few errors. One is after you cast the spell, your weapon is supposed to change color and after the spell timer, it returns to the original color. But if the player logs out while the spell is still active, the weapon never changes back to it's original value.

Third. After the spell wears off, the damage bonus is still being applied, unless the player move the weapon from the hand layer. How am I supposed to make the value change after the timer is done, without forcing the player to move the weapon?

A lot of questions, hope someone can help me. Thanks!

Re: A few questions

Posted: Wed Jun 19, 2019 2:19 pm
by Yukiko
Hello Jack the Ripper,
First, you should know that Scotland Yard has been looking for you for quite some time now. So be careful :D

CInt() converts a non-integer to an integer. So if you pass it 100.3 it strips off the decimal .3 and returns 100. The example you gave

Code: Select all

cd = CInt(time/10)
divides the variable time by 10 then the CInt call strips off any fractional part of the result. Let's say time = 25 and it is divided by 10 then the result is 2.5. Passing that to CInt will return 2. Please note that CInt does not do any rounding up or down. It simply strips off any amount on the right side of the decimal point.

As for your questions regarding the script, you need to post the script.

I hope I've helped a little.

Re: A few questions

Posted: Wed Jun 19, 2019 3:04 pm
by Yukiko
Been thinking about the script you are having problems with. The first issue is probably a little tougher to handle than the second one. The reason we need to see it is so we can look at what it is doing and figure out where to apply the fixes.

Re: A few questions

Posted: Wed Jun 19, 2019 5:37 pm
by JacktheRipper
Yeah, I thought you probably need some code to check it, but I'm still learning about it, and don't know exactly which script should I post, since this spell I'm trying to fix is divided on a bunch of scripts :|

Re: A few questions

Posted: Wed Jun 26, 2019 9:07 am
by guialtran
I think the best option for you, at this moment is, to try to gain more intimacy and trust of your code, you have to learn to look for and understand all the calls of your script.
this is the minimum

not understanding a script and making a modification is a very bad thing.