Jump to content
Calestian

Achievement System

Recommended Posts

Hi rockstar @

Calestian

 

You just made the script just as i wanted it to be..Thank you very very much..

I'm gonna make a bold remark with your name in my upcoming game's credits.. Thanks again..  :lol:

 

Keep the hits coming..

  • Like 1

Share this post


Link to post
Share on other sites

@Amber,

the script works just fine. I checked your piece of code. You set

Achievement_Points_color   = 495

Such color ID doesn't exist, so it uses blank color.

For color references, use this link. Color IDs go from 0 to 31 only.

  • Like 2

Share this post


Link to post
Share on other sites

Thanks for pointing, Glasses. I been thinking maybe was a bug or coding error, but there's no color code for that number.

Share this post


Link to post
Share on other sites

Hi rockstar @

Calestian

 

You just made the script just as i wanted it to be..Thank you very very much..

I'm gonna make a bold remark with your name in my upcoming game's credits.. Thanks again..  :lol:

 

Keep the hits coming..

Well, it's not finished yet, I still have to implement the titles along with some other stuff. But thats probably next week cos thats when I 'll be back home.

 

Edit: Crafting System soon as well!

Edited by Calestian
  • Like 1

Share this post


Link to post
Share on other sites

 

Hi rockstar @

Calestian

 

You just made the script just as i wanted it to be..Thank you very very much..

I'm gonna make a bold remark with your name in my upcoming game's credits.. Thanks again..  :lol:

 

Keep the hits coming..

Well, it's not finished yet, I still have to implement the titles along with some other stuff. But thats probably next week cos thats when I 'll be back home.

 

Edit: Crafting System soon as well!

 

Yeah...i will appreciate every updates you will make to this script..but i have a question, see, in this script the achievements depends on tiers..and for so i have to make script calls with tiers to get each achievements..in case if i want to make an achievement which will be completed after i gather a certain amount of gold, means a gold gathering award, then what should i do??

 

And it's Great to hear that a new crafting system is on the way...Woooo.. I'm madly waiting for your upcoming scripts..

Share this post


Link to post
Share on other sites

If you have an achievement like, gather 1.000gold, you could update your achievement on every event. Like this:

set_achievement($game_party.gold, index) -> index being your achievement index

That way your achievement will update on every event, and it the progress will be equal to your current gold.

  • Like 1

Share this post


Link to post
Share on other sites

I will do something like this in a day or two coz I'm trying to finish the Crafting System script at the moment.

Edited by Calestian

Share this post


Link to post
Share on other sites

A quick extension to Cale's script.

Allows for achievement increase using variables and achievements.

 

 

# )----------------------------------------------------------------------------(
# )--     AUTHOR:     Mr. Trivel & Original Script by Calestian              --(
# )--     NAME:       Calestian's Achievement System extension               --(
# )--     CREATED:    2015-04-18                                             --(
# )--     VERSION:    1.0                                                    --(
# )----------------------------------------------------------------------------(
# )--                           REQUIRES                                     --(
# )--  Original Achievement Script by Calestian.                             --(
# )----------------------------------------------------------------------------(
# )--                          DESCRIPTION                                   --(
# )--  Allows increasing achievements with gold and variables.               --(
# )--  E.g. increasing variable 5 by 9 points, will increase achievement     --(
# )--    99 by 9 points.                                                     --(
# )--  Or increasing gold will increase another variable and so on.          --(
# )--                                                                        --(
# )----------------------------------------------------------------------------(

# )===========-----------------------------------------------------------------(
# )--  Module: Clstn_Achievement_System                                      --(
# )-----------------------------------------------------------------===========(
module Clstn_Achievement_System
  # )--------------------------------------------------------------------------(
  # )--  The place to set up the variable/achievement gain.                  --(
  # )--------------------------------------------------------------------------(
  # )--  The table is as follows:                                            --(
  # )--  Variable ID => [Achievement ID, type],                              --(
  # )--
  # )--  Variable ID is the variable you're changing.                        --(
  # )--  Achievement ID is ID in achievement list in the original script.    --(
  # )--  type is either :add or :current or :highest                         --(
  # )--    :add - when you increase the variable, the increase will get      --(
  # )--           added to achievement, too.                                 --(
  # )--    :current - when you change the variable, achievement progression  --(
  # )--               will change to the variable.                           --(
  # )--    :highest - when you change the variable, if it's value is higher  --(
  # )--               than achievement progession, it'll change to that var. --(
  # )--------------------------------------------------------------------------(
  VARIABLE_TABLE = {
  
    # Variable ID => [Achievement ID, :add/:current/:highest],
    5 => [0, :highest],
  }
  
  # )--------------------------------------------------------------------------(
  # )--  Achievement ID to increase when gaining gold.                       --(
  # )--  If there's no achievement that changes with gold gain, change the   --(
  # )--    number to -1.                                                     --(
  # )--------------------------------------------------------------------------(
  GOLD_GAIN_ADD = 2 # Set to -1 of no achivement
  
  # )--------------------------------------------------------------------------(
  # )--  Method copied from interpreter.                                     --(
  # )--------------------------------------------------------------------------(
  def self.gain_achievement(amount, index)
    item = Clstn_Achievement_System::Achievements[index]
    tier = Clstn_Achievement_System::tier?(Clstn_Achievement_System::Achievements[index])
    if $game_party.achievements[index] != item[:Tiers][-1]
      if !Clstn_Achievement_System::locked?(item)
        if amount <= item[:Tiers][tier]
          $game_party.achievements[index] += amount
          set_achievement(item[:Tiers][tier], index) if $game_party.achievements[index] > Clstn_Achievement_System::Achievements[index][:Tiers][tier]
        else
          set_achievement(item[:Tiers][tier], index)
        end
      end
      $game_party.achievement_completed(index)
      if $game_party.achievements[index] == item[:Tiers][-1] && item[:Repeatable] != false && item[:Repeatable] > $game_party.achievement_repeated[index]
        $game_party.achievements[index] = 0
        $game_party.achievement_repeated[index] += 1
      end
    end
  end
  
  # )--------------------------------------------------------------------------(
  # )--  Method copied from interpreter.                                     --(
  # )--------------------------------------------------------------------------(
  def self.set_achievement(amount, index)
    item = Clstn_Achievement_System::Achievements[index]
    if $game_party.achievements[index] != item[:Tiers][-1]
      $game_party.achievements[index] = amount unless Clstn_Achievement_System::locked?(Clstn_Achievement_System::Achievements[index])
      $game_party.achievement_completed(index)
      if $game_party.achievements[index] == item[:Tiers][-1] && item[:Repeatable] != false && item[:Repeatable] > $game_party.achievement_repeated[index]
        $game_party.achievements[index] = 0
        $game_party.achievement_repeated[index] += 1
      end
    end
  end
end

# )===========-----------------------------------------------------------------(
# )--  Class: Game_Variables                                                 --(
# )-----------------------------------------------------------------===========(
class Game_Variables
  # )--------------------------------------------------------------------------(
  # )--  Alias list                                                          --(
  # )--------------------------------------------------------------------------(
  alias :mrts_clsn_achv_equal_operator :[]=
  
  # )--------------------------------------------------------------------------(
  # )--  Method: []=                                                         --(
  # )--------------------------------------------------------------------------(
  def []=(variable_id, value)
    unless Clstn_Achievement_System::VARIABLE_TABLE[variable_id]
      mrts_clsn_achv_equal_operator(variable_id, value)
    else
      dif = value - (@data[variable_id] ? @data[variable_id] : 0)
      q = Clstn_Achievement_System::VARIABLE_TABLE[variable_id]
      case q[1]
      when :add
        if dif > 0
          Clstn_Achievement_System::gain_achievement(dif, q[0])
          mrts_clsn_achv_equal_operator(variable_id, dif)
        else
          mrts_clsn_achv_equal_operator(variable_id, dif)
        end
      when :current
        mrts_clsn_achv_equal_operator(variable_id, value)
        Clstn_Achievement_System::set_achievement(@data[variable_id], q[0])
      when :highest
        mrts_clsn_achv_equal_operator(variable_id, value)
        Clstn_Achievement_System::set_achievement(@data[variable_id], q[0]) unless $game_party.achievements[q[0]] > value
      else
        mrts_clsn_achv_equal_operator(variable_id, value)
      end  
    end
  end
end

# )===========-----------------------------------------------------------------(
# )--  Class: Game_Party                                                     --(
# )-----------------------------------------------------------------===========(
class Game_Party < Game_Unit
  # )--------------------------------------------------------------------------(
  # )--  Alias list                                                          --(
  # )--------------------------------------------------------------------------(
  alias :mrts_clsn_achv_gain_gold :gain_gold
  
  # )--------------------------------------------------------------------------(
  # )--  Method: gain_gold                                                   --(
  # )--------------------------------------------------------------------------(
  def gain_gold(amount)
    unless (amount > 0)
      mrts_clsn_achv_gain_gold(amount)
    else
      Clstn_Achievement_System::gain_achievement(amount, Clstn_Achievement_System::GOLD_GAIN_ADD) if Clstn_Achievement_System::GOLD_GAIN_ADD != -1
      mrts_clsn_achv_gain_gold(amount)
    end
  end
end 

 

 

  • Like 3

Share this post


Link to post
Share on other sites

Found a bug when you get an achievement during combat, like for killing monsters. Your combat will end abruptly, the achievement will play and no triggers will be usable. The combat music also continues to play. It only partially gets fixed when you get into another battle, the battle runs it's course normally but the music still continues after the battle until a trigger changes it. Not sure if any more bugs come along with it but that's what I've noticed.

Share this post


Link to post
Share on other sites

Could you please provide the exact steps you took so I can reproduce the bug?

 

I will look into it during the weekend most likely.

Share this post


Link to post
Share on other sites

Sure, no problem. I made an achievement to kill 5 slimes. In the troops tab I put in "gain_achievement(1, 0)" to progress the first achievement which was to kill the slimes. I also had to make them immortal, then set the trigger for when they are at 0% life or less, add the achievement, then add the death state, because if you don't the last enemy killed won't give and progress. So if you enter a battle with 4/5 slimes defeated, once you kill the first slime and gain the achievement point that's when the battle closes and the problems I stated before arise.

Share this post


Link to post
Share on other sites

Hullo, and thanks for all your hard work!

 

I had a quick question: I'm trying to make more use of the achievement category window — specifically, the description text. It's a big window with plenty of room to gallop, but the text by default scrunches up the first few words and then that's that. I've tried coding line breaks and using word-wrap scripts to no avail.

 

What change would I need to make in the coding to alter this text behaviour?

 

Cheers!

Edited by Raizaiel

Share this post


Link to post
Share on other sites

Hi, love the script, I have just a few questions.

 

EDIT:

1. Is it possible to hide achievements ( the ones requiring prerequisites) and make them automatically appear in the achievement menu when the prerequisites have been completed?

 

2. Is it possible to get a different pop-up window when a tier is completed? I really want this one. Just something with "achievement: "-", Tier: x completed. To next tier: x"

 

3. how do you activate a prerequisites quest without having to repeat the previous one. when I use [index, 0,0] it doesn't do anything until i make the previous quest repeatable (on 0 still, but you get the notification window popping up twice and I don't want that.)

Edited by loozje

Share this post


Link to post
Share on other sites

I might be dumb, but I don't understand how to set this up. Is there a demo available?

Share this post


Link to post
Share on other sites

This is a very nice script.

 

But I really need to hide the ones that are not meant for the part of the game the player is playing. The title of the achievement would spoil the future events.

 

So is there a possibility to hide the achievement or maybe simply change the name of the achievement with a variable ?

 

I tried to set up the achievements with assigning variables to :name and :help

But I am not sure it is possible (I am just guessing how Ruby works).

This way I would change the variable from "XXXXXXX" to "Kill the goblien chief" for instance.

 

Thanks for the help.

Share this post


Link to post
Share on other sites

OK, maybe I asked for something that was explained already, but I really can't find it.

 

So I up my question in hope someone has an idea about it. Thx :P

Share this post


Link to post
Share on other sites

I solved my own problem. I modified the script to add variables for hidden achievements and let the script check if it should display the hidden names & help.

I don't know if it's fine with Calestian to post an update of his script though...

Share this post


Link to post
Share on other sites

Hey, I know it's been awhile on this forum.

I have been deeply interested in adding achievements to my game, but I'm new at this whole thing..

On the script, what does it mean by objective, or more specifically what does the number mean that represents that objective?

Share this post


Link to post
Share on other sites

Hi! This is a very cool script!

Unfortunately, it seems the developer isnt answering in this forum anymore. Is there still support for this script?

I have several issues. For example, I set the second achievement to no prerequisite, but it still shows the locked symbol in the menu. Second example, I tried to expand the list of achievements to more than 10, and the game crashes.

Share this post


Link to post
Share on other sites

Last time visited forum 2015... I know it's low chance of probability, but here it is anyway:
Well, the script worked fine now it lags like hell. I have no idea what it could be. The previous version of my game that is avaible to download works perfectly, but new one lags like hell. I open the achiv tab and press the sub tab but then it is like help like 1fps window.
Anyone can help please write down.

Share this post


Link to post
Share on other sites
On 7/8/2018 at 6:09 PM, ddejan90 said:

lags like hell

I ran into the same problem. I got a fix from A-Moonless-Night on RPGMaker Forums

Might not be the same as yours, but I had the lag issue when using a mouse in the window. 

The problem is the script itself. It rewrites the info window a lot.

Don't think I can share my snippet without her permission.

 

Additionally I made an addon that allows changing the window skin and a pause before the window starts fading.

# )----------------------------------------------------------------------------(
# )--     AUTHOR:     Roninator2 & Original Script by Calestian              --(
# )--     NAME:       Calestian's Achievement System extension               --(
# )--     CREATED:    2019-04-05                                             --(
# )--     VERSION:    1.0                                                    --(
# )----------------------------------------------------------------------------(
# )--                           REQUIRES                                     --(
# )--  Original Achievement Script by Calestian.                             --(
# )----------------------------------------------------------------------------(
# )--                          DESCRIPTION                                   --(
# )--  Allows Setting Window skin and pause before disappearing.             --(
# )--                                                                        --(
# )----------------------------------------------------------------------------(

module Clstn_Achievement_System

  Notification_Pause        = 300       # Frames to wait before disappearing
  Window_Skin               = "Oceanic" # Must be in quotes
  
end

class Window_AchievementNotification < Window_Base
 
  #--------------------------------------------------------------------------
  # * Initialize
  #--------------------------------------------------------------------------
  def initialize
    @window = $game_party.notifications[0][1]
    @item   = $game_party.notifications[0][0]
    super(x, 0, width, height)
    $game_party.notification_enabled = false
    self.windowskin = Cache.system(Clstn_Achievement_System::Window_Skin)
    @view = Clstn_Achievement_System::Notification_Pause
    refresh
  end
  
  def update
    if !disposed? && @view > 0
      @view -= 1
    elsif !disposed? && self.opacity > 0
      self.opacity -= 1
      self.contents_opacity -= 1
      self.back_opacity -= 1
    else
      $game_party.notifications.delete_at(0) unless $game_party.notifications.empty?
      if !$game_party.notifications.empty?
        $game_party.notification_enabled = true
        SceneManager.call(Scene_Map) 
      else
        $game_party.notification_enabled = false
      end
      @view = Clstn_Achievement_System::Notification_Pause
    end
  end
end

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted