Results 1 to 4 of 4

Thread: FindXP Simba Fix

  1. #1
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default FindXP Simba Fix

    Simba's Pow needs the 7 and/or 2 in these functions to be 7.0 and 2.0, So I made a few changes to get it working
    SCAR Code:
    function ConvertXpToLvl(xp: Integer): Integer;
    var
      level, exp: Integer;
    begin
      for level := 0 to 99 do
      begin
        exp := exp + Trunc(level + 300 * Pow(2.0, level / 7.0));
        if ((exp / 4) > xp) then
        begin
          Result := level;
          Exit;
        end;
      end;
      Result := 99;
    end;
    SCAR Code:
    function ConvertLvlToXP(Level: Integer): Integer;
    var
      I, exp: Integer;
      Power, TPower:Extended;
    begin
      for i := 1 to Level-1 do
        IncEx(Exp, Trunc(i + 300.0 * Pow(2.0, i / 7.0)));
      Result := exp / 4;
    end;

    Current Script Project
    Pot of flour gatherer - 95% done

    Can't get Simba to work? Click here for a tutorial

  2. #2
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry for double posting but this NEEDS to be commited, every times I re-open simba, it updates SRL, and it takes away what I changed, (this fix). This is what is NEEDED to get Simba to use this function.

    Current Script Project
    Pot of flour gatherer - 95% done

    Can't get Simba to work? Click here for a tutorial

  3. #3
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Committed.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  4. #4
    Join Date
    Mar 2006
    Location
    Behind you
    Posts
    3,193
    Mentioned
    61 Post(s)
    Quoted
    63 Post(s)

    Default

    That Function that your fixing looks awfully familar. Good to see that somebody uses it. Nice fix by the way.

    "Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •