Page 1 of 2

Efficiency

Posted: Thu Sep 13, 2012 9:00 pm
by Zedingo
I went through scripts in abilities and effects, changing vars to local, and generally cleaning up.

I also noticed that Spirit Link didn't give a damn about Stoneskin, but I'll include that patch separate from the cleanups.

Re: Efficiency

Posted: Thu Sep 13, 2012 9:51 pm
by Zedingo
Oh, it's important to note that I tested Spirit Link, but I didn't go through every ability and effect that I cleaned up. The same is true for the mobskills I'm working on now.

Re: Efficiency

Posted: Sun Sep 16, 2012 8:55 pm
by Zedingo
And here is mobskills, updated to use the modified applyPlayerResist and optimized as best I could. I may have missed some things and ask for some help double-checking my work, because this one was HUGE.

Also I had to modify applyPlayerResist, so that in the case a mob has and uses Elemental Seal before a TP move, the enfeeble of that move doesn't have increased accuracy.

Re: Efficiency

Posted: Tue Sep 18, 2012 12:49 am
by Metalfiiish

Re: Efficiency

Posted: Tue Sep 18, 2012 1:52 am
by Metalfiiish
as for the mob tp moves as per our conversation revert to revision 1734 then make the changes as we need to include accRandom that was removed. Thanks! If you don't get a chance to finish let me know and I will get it done.

Re: Efficiency

Posted: Tue Sep 18, 2012 2:28 am
by Zedingo
Got some things I missed. Next I'll work on the problem of if a physical move misses, the enfeeb can still be applied. I'm not sure if the same applies to magical moves.

Re: Efficiency

Posted: Tue Sep 18, 2012 4:06 am
by Metalfiiish
Don't implement this as the new resist function is not working and players resist 100% of the time. Needs to be revised by teschnei

Re: Efficiency

Posted: Mon Sep 24, 2012 4:14 am
by Metalfiiish
So did test and it seems like it is passing either 0 or 1. It does not pass the value expected. It looks like lua is converting the float into an integer.

resist should be equal to one of the below:

Code: Select all

    if(resvar <= sixteenth) then
        resist = 0.0625;
        --printf("Spell resisted to 1/16!!!  Threshold = %u",sixteenth);
    elseif(resvar <= eighth) then
        resist = 0.125;
        --printf("Spell resisted to 1/8!  Threshold = %u",eighth);
    elseif(resvar <= quart) then
        resist = 0.25;
        --printf("Spell resisted to 1/4.  Threshold = %u",quart);
    elseif(resvar <= half) then
        resist = 0.5;
        --printf("Spell resisted to 1/2.  Threshold = %u",half);
    else
        resist = 1.0;
as you can see there is no 0 yet it spits 0 out most of the time when it passes this before sending it to return. (I can see what it considers resist to be before it sends it to return by using printf just before the return resist;)

We need to figure out why it is not using resist as a float so the resistance works properly.

Re: Efficiency

Posted: Mon Sep 24, 2012 7:32 pm
by bluekirby0
You need to use %f to print floats (or doubles) or you will get invalid values. %u is for unsigned integers, %i for integers, and %s for strings.

Re: Efficiency

Posted: Tue Sep 25, 2012 1:05 pm
by kjLotus
or just use lua's print() function :p