+ Reply to Thread
Results 1 to 5 of 5

Thread: MSI Alcher counting off

  1. #1
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default MSI Alcher counting off

    Just noticed now that the counting for amount of spells is off for the alcher. I think it's because it's clicking a little too fast, and it's counting each click as an alch rather than the alchs themselves. I think the animation needs to be redone (I still have to properly make a tutorial on the new animation system, but in the meantime you can look at the chopping animation as an example).

    I'll get to it eventually, but if someone would like to have a go at it that would be great.

    Cheers,
    Cohen

  2. #2
    Join Date
    Jun 2009
    Posts
    177
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Why even use clicks or animations to count off? Just store the number of nature runes when the script begins. natureRunesOnStart - natureRunesNow = howManyAlchs??

  3. #3
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Good point. I'd hate to decrease the speed of the alcher anyway. Right now its really fast. We already calculate how many spells can be cast based on the runes found, so passing the variable shouldn't be difficult.

    Can't believe I didn't think of that!

  4. #4
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Good point. I'd hate to decrease the speed of the alcher anyway. Right now its really fast. We already calculate how many spells can be cast based on the runes found, so passing the variable shouldn't be difficult.

    Can't believe I didn't think of that!
    or:

    CurrentEXP-StartEXP/65 := alchs

  5. #5
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Yeah.

    I wrote a new function for this, and so far it's working perfectly. I'm alching well over 1k/hour (I checked the actual amount with the script amount), which is quite a bit of magic experience. I'm working on fixing the random detection issue with the alcher, so once I solve that I'll commit both fixes. Here's the function if anyone is curious:
    Progress Report:
    (*
    MSI_CastsDone
    ~~~~~~~~~~~~~
    
    .. code-block:: pascal
    
      procedure MSI_CastsDone();
    
    Calculates the amount of casts the player has done for each spell and adds the
    difference from the previous amount to the progress report/stats variables.
    
    .. note::
    
      | Author: Coh3n
      | Last Updated: 04 June 2011 by Coh3n
    
    Example:
    
    .. code-block:: pascal
    
      MSI_CastsDone();
    *)
    procedure MSI_CastsDone();
    var
      i, j, castsDone, castsDiff: integer;
      castsLeft: TIntegerArray;
    begin
      if (not loggedIn) then
        exit;
    
      castsLeft := MSI_CalculateCasts();
      for i := 0 to high(castsLeft) do
        with MSI_Players[currentPlayer].Scripts[currentScript] do
        begin
          if (castsLeft[i] <= 0) then
            continue;
    
          castsDone := (maxCasts[i] - castsLeft[i]);
          MSI_SubDebug('Number of casts[' + intToStr(i) + ']: ' + intToStr(castsDone));
    
          with MSI_Players[currentPlayer].ReportInfo do
          begin
            castsDiff := (castsDone - Casts[currentScript][MSI_CurrentSpell]);
            incEx(Casts[currentScript][MSI_CurrentSpell], castsDiff);
            MSI_AddToProggy(PROG_ADD_CASTS, -1, -1, castsDiff);
            stats_IncVariable(MSI_Spells[Spells[MSI_CurrentSpell]].StatsName, castsDiff);
          end;
    
          MSI_AddToProggy(PROG_ADD_EXP, -1, -1, (Round(MSI_Spells[Spells[MSI_CurrentSpell]].Experience * castsDiff)));
          MSI_SubDebug('Casts left[' + intToStr(i) + ']: ' + intToStr(castsLeft[i]));
        end;
    end;

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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