RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[REQUEST] Hide npc name and Achievement script

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 82
hmm first request here xD don't even know where to begin ;x

the problem i'm having is... i'm trying to make an "pen and paper" style game... i already got lots of script that will help and made some modifications (i know a little of rgss2 so i can modify a little the scripts)

the thing is... i need a way to hide the npc name till i activate a switch

dunno if this is do-able but what I have in mind is with the nms 3.0 message script


when the \nb tag is used, the script will do a quick search in the active event NAME box for a tag (or just for the event name... doesnt have to be a tag at all) and then will compare the name string with an array to see if the name was added there

if the name is in the array then it'll show the name... if not, it will show "????" or not show the name box at all

of course, the array has to be blank and made in a way that is possible to add strings to this array with event comands


it should be something like
$Npc_knowname["name"]

then wherever the npc say his name, we just have to put this comand and the game will save his name on the string


====

another thing is to make a sys variable to make a quick script call by the event... this would be used on scenes

something like
$Npc_Actname = "Lillyan"

then everytime the \nb tag is used it'll do a check if you know the "$npc_actname" and if you know, show the name till the $npc_actname equals to nill or none again



ps: If the script cant search for the event name, then make it to search for a comentary tag

hope someone can do that for me, I really need this one ;/
it may seems like a waste of time... but for me, these little details are everything o/

==================================================================================

And a addition to this achievement script made by Omegas7

Spoiler for:
Code: [Select]
===========================================================================
#                 Achievements System Script by Omegas7.
# ===========================================================================
#        Version: 2.0.
#        Possibly final version, functional.
# ===========================================================================
#     Author: Omegas7.
#     Exclusive script for:  http://www.myrpgmaker.com
#     Platform: RPG Maker VX.
# ===========================================================================
#
#     New to version 2.0:
#      Set complete achievements icon.
#      Set incomplete achievements icon.
#      Window showing the total achievements done.
#
# ===========================================================================


# ===========================================================================
#   Module, here you may edit the achievements here.
# ===========================================================================

module OMEGAS7_ACHIEVEMENTS
 
  # Achievents Icons ID when incomplete.
  ICON_INCOMPLETE = 5
 
  # Achievents Icons ID when complete.
  ICON_COMPLETE = 6
 
  # Achievements Icons spaces before the achievements names.
  # Default 3 (3 spaces).
  ICON_SPACE_LEVEL = 3
 
  # Achievements Names, separated by commas.
  ACHIEVEMENT_NAME = ["01- Super Love.","02- Super Hate.","03- Amazing Chest."]
 
  # Achievements Done Switches ID, sperated by commas.
  ACHIEVEMENT_SWITCH = [1,2,3]
 
 
  ACHIEVEMENT_INFO = []      # <--- Don't edit this.
 
  # Achievements Information/Descriptions.
  # ACHIEVEMENT_INFO[N] = [Text Lines]
  # N is the Achievement ID, counting from 0.
  # The text lines, each separated by a comma.
 
  ACHIEVEMENT_INFO[0] = [
  "There is a pretty green haired girl.",
  "I bet I could make her love me",
  "easily."
  ]
 
  ACHIEVEMENT_INFO[1] = [
  "I bet I could make that green",
  "haired girl hate me."
  ]
 
  ACHIEVEMENT_INFO[2] = [
  "There is a quite interesting red,",
  "chest wonder what's in it?"
  ]
 
end

# ===========================================================================
# End of module.
# ===========================================================================

class Omegas_Achievements_Scene < Scene_Base
 
  include OMEGAS7_ACHIEVEMENTS
 
  def initialize
    create_values
    create_commands
    create_info
    create_info_window
  end
 
  def start
    create_menu_background
  end
 
  def create_values
    @names = []
    @switches = ACHIEVEMENT_SWITCH
    @info = []
    @info_2 = []
  end
 
  def create_commands
    for i in 0...ACHIEVEMENT_NAME.size
      if $game_switches[@switches[i]] == true
        @names[i] = ACHIEVEMENT_NAME[i].to_s
      else
        @names[i] = "???"
      end
    end
    @command_window = Window_Command_Ach.new(200,@names)
    @command_window.height = 316
  end
 
  def update
    @command_window.update
    @info_2 = @info[@command_window.index]
    @info_window.update(@info_2)
   
    if Input.trigger?(Input::B)
      @command_window.dispose
      @info_window.dispose
      @info_window_2.dispose
      $scene = Scene_Map.new
    end
     
  end
 
  def create_info
    for i in 0...ACHIEVEMENT_INFO.size
      if $game_switches[@switches[i]] == true
        @info[i] = ACHIEVEMENT_INFO[i]
      else
        @info[i] = ["Unknown Information."]
      end
    end
  end
 
  def create_info_window
    @info_window = Omegas7_Achievement_Info.new
    @info_window_2 = Omegas7_Achievement_Info_2.new
  end
 
end


class Omegas7_Achievement_Info < Window_Base
  def initialize
    super(200,0,544 - 200,316)
    @info = [""]
    refresh
  end
  def refresh
    self.contents.clear
    for i in 0...@info.size
      self.contents.draw_text(0,i * 28,self.width,28,@info[i].to_s)
    end
  end
  def update(info)
    if @info != info
      @info = info
      refresh
    end
  end
end

class Omegas7_Achievement_Info_2 < Window_Base
 
  include OMEGAS7_ACHIEVEMENTS
 
  def initialize
    super(0,316,544,100)
    @complete = 0
    refresh
  end
 
  def refresh
    for i in 0..ACHIEVEMENT_NAME.size
      if $game_switches[ACHIEVEMENT_SWITCH[i].to_i] == true
        @complete += 1
      end
    end
    self.contents.clear
    self.contents.draw_text(0,0,544,50,"Complete Achievements: " + @complete.to_s + " / " + ACHIEVEMENT_NAME.size.to_s)
  end
 
end


class Window_Command_Ach < Window_Selectable
 
  include OMEGAS7_ACHIEVEMENTS

  attr_reader   :commands

  def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
    if row_max == 0
      row_max = (commands.size + column_max - 1) / column_max
    end
    super(0, 0, width, row_max * WLH + 32, spacing)
    @commands = commands
    @item_max = commands.size
    @column_max = column_max
    @spaces = ICON_SPACE_LEVEL.to_i
    @spaces_text = ""
    @done = []
   
    for i in 0...@spaces
      @spaces_text += " "
    end
   
    for i in 0..ACHIEVEMENT_NAME.size
      if $game_switches[ACHIEVEMENT_SWITCH[i].to_i] == true
        @done[i] = true
      else
        @done[i] = false
      end
    end
     
    refresh
    self.index = 0
  end

  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i)
    end
  end

  def draw_item(index, enabled = true)
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(rect, @spaces_text.to_s + @commands[index])
    if @done[index] == true
      draw_icon(ICON_COMPLETE.to_i,0,rect.y)
    else
      draw_icon(ICON_INCOMPLETE.to_i,0,rect.y)
    end
   
  end
end


the thing is... I need a way to conceal certain achievements... like, i have 2 achievements... "goblin killer" if the player kill all the goblins and a "goblin hero" if he save all the goblins

the problem is... if he get the "goblin killer", the "goblin hero" will continue on the list as "????", but there is no way for the player to get this achievement anymore (cuz he already got the killer one)

so... there has to be a way to hide one if he get the other (automatic, of course... a table with the linked achievements, this way the script will only show ONE ???? and will change it for whatever achievement the player got)


the other problem is that the script only check for game switchs...
this is a problem if I want an achievement to be unlocked when the player get a certain iten... or get to a certain place... because i have to waste a game switch just for that

so, if someone can add a script call and a game_variable check too for me to use on the events...

============================================================

well that's it... alot of texts and two stranges request xD

I already lost three days trying to change this script but I just cant find a way to do it...
the only thing i don't know about scripting is the damn window making x.x (never tried... so i dont know a thing about scene making)

if someone can do that for my i would be really grateful


ps: the game is going to be portuguese... i'm almost done with the game system and soon will get to the game itself
i can try to put up an english demo and if it's good enough i can try and do a translation of the full game later o/


edit ====
almost forgot... if someone can make a "face border" feature on the nms script too...
« Last Edit: December 16, 2009, 08:01:57 PM by h3llh0und »