The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: pacdiggity on March 23, 2011, 10:36:44 AM

Title: Exempt Actor Stats
Post by: pacdiggity on March 23, 2011, 10:36:44 AM
No Actor Levels
Version: 1.5
Author: Welfare-Daddy Pacman
Date: March 26, 2011

Version History


Code: [Select]
#==============================================================================
#  Exempt Actor Stats
#  Version: 1.5
#  Author: Welfare-Daddy Pacman (rmrk.net)
#  Date: March 26, 2011
#
#------------------------------------------------------------------------------#
#  Description:
#
#  This script allows you to choose which actors, if any, should have levels,
#  EXP HP or MP displayed. This is most likely to be used in games where you
#  don't want your actor's progress easily trackable or in games where
#  characters don't have levels or gauges, i.e. non-fighting games.
#
#------------------------------------------------------------------------------#
#  Instructions:
#   
#  - Place this script in the materials section, above Main.
#  - Enter the Actor IDs whose levels and EXP you don't want displayed in the
#  EXEMPT_LEVEL_EXP Array, as shown.
#  - Enter the Actor IDs whose HP and MP in their respective arrays,
#  EXEMPT_HP and EXEMPT_MP.
#=============================================
class Window_Base # DO NOT REMOVE THIS!!!
#============================================= 
# EDITABLE REGION:
#
EXEMPT_LEVEL_EXP = [1, 2] # Place Actor IDs whose levels and exp you do not want
# displayed here, e.g. [1, 2, 3]
#
EXEMPT_HP = [1, 2, 3, 4] # Place Actor IDs whose HP you do not want displayed here
# as above.     
#
EXEMPT_MP = [1, 2, 3, 4] # Do the same for Actors you desire to have no MP.
#
#=============================================
# END EDITABLE REGION 

# EXEMPTING ACTOR LEVELS 

alias exempt_draw_actor_level draw_actor_level
def draw_actor_level(actor, x, y)
  if EXEMPT_LEVEL_EXP.include?(actor.id)
    return
  else
      exempt_draw_actor_level(actor, x, y)
    end
  end
end

#============================================

  # EXEMPTING ACTOR EXP
 
class Window_Status < Window_Base
  alias exempt_draw_exp_info draw_exp_info
  def draw_exp_info(x, y)
    if EXEMPT_LEVEL_EXP.include?(@actor.id)
      return
    else
      exempt_draw_exp_info(x, y)
    end
  end
end

#============================================

  # EXEMPTING ACTOR HP
 
class Window_Base
  alias exempt_draw_actor_hp draw_actor_hp
  def draw_actor_hp(actor, x, y, width = 120)
    if EXEMPT_HP.include?(actor.id)
      return
    else
      exempt_draw_actor_hp(actor, x, y, width)
    end
  end
end

#============================================

  # EXEMPTING ACTOR MP
 
class Window_Base
  alias exempt_draw_actor_mp draw_actor_mp
  def draw_actor_mp(actor, x, y, width = 120)
    if EXEMPT_HP.include?(actor.id)
      return
    else
      exempt_draw_actor_mp(actor, x, y, width)
    end
  end
end

#============================================

  #PROCESS COMPLETE

Credit

Thanks

Known Compatibility Issues

It's unlikely to work with HUDs. That being said, it could probably be made compatible with just a little tweaking.

Author's Notes

If something is wrong, let me know immediately. This will let me know what to fix and hopefully how. Tell me the error, what doesn't work or whatever. If you have a request, just let me know.

 :ccbysa: :rmvx:
Title: Re: No Actor Levels
Post by: Countdown on March 24, 2011, 12:43:27 AM
Wow. Really awesome! Just what I needed. One question for something to add possibly?

(1) Under the level it also tell you your current EXP.
(2) Under the current EXP it says how much to next level.

Can you get rid of those things as well?

You rock Pac.
Title: Re: No Actor Levels
Post by: LoganF on March 24, 2011, 02:52:27 AM
All this script does is simply prevent drawing of the actor's level. You can still level up with it, as well as gain exp. Time will still be spent processing the current/next level exp requirements as it currently stands.

As a temp fix, adding the following code to that script will stop the status window drawing the exp:

Code: [Select]
class Window_Status < Window_Base
 
  alias exempt_draw_exp_info draw_exp_info
  def draw_exp_info(x, y)
    if EXEMPT_LEVEL.include?(@actor.id)
      return
    else
      exempt_draw_exp_info
    end
  end
 
end

It works on testing it, though it's without any other scripts.

EDIT: You can use this along side Jet's No Actor EXP script from his Snippet's collection to prevent specific actors from gaining exp and stop the exp/level from being shown. You can get the collection from this link here (http://rmrk.net/index.php/topic,38168.0.html) (you'll have to scroll down to modern algebra's post at the end for the new download link).
Title: Re: No Actor Levels
Post by: pacdiggity on March 24, 2011, 05:30:59 AM
Ah, I didn't think about that. Thanks for that code. Added to the script. Logan's code will be in the script until I have enough time and can be bothered to do it myself.

If anyone wants any HUDs or simple scripts compatible, just tell me.
Also, thanks DarkCodeZero! I wasn't very confident in my work, I'd much rather do my scripting with VX as a reference; I don't have it atm.
Title: Re: No Actor Levels, EXP, HP or MP
Post by: pacdiggity on March 24, 2011, 07:34:40 AM
Update: EXP portion used is still Logan's (and will remain so until I get VX), but I have added two features to the script: No HP and No MP. The arrays are set up exactly the same, classes defined, alias used (to MA's liking, I'm sure) etc.
I will continue simple udpates like this for quite some time.
Title: Re: Exempt Actor Stats
Post by: pacdiggity on March 25, 2011, 10:39:25 AM
'Nother update: EXP portion overhauled, surprisingly, and added the battle stats (ATK, DEF, AGI, SPI) options to the script. Should any stupid errors occur, just post here.
Told you I would update.
Title: Re: Exempt Actor Stats
Post by: Countdown on March 25, 2011, 09:56:06 PM
Get syntax errors all over the place now.
Title: Re: Exempt Actor Stats
Post by: pacdiggity on March 25, 2011, 10:31:30 PM
Get syntax errors all over the place now.
Told you there'd be stupid errors. Ok, I'll repost 1.3 so that I don't make myself look stupider. 1.4 will be posted when I know it works.
EDIT: Reverted.
Title: Re: Exempt Actor Stats
Post by: LoganF on March 26, 2011, 04:11:07 AM
It's the difficulty of making scripts when you don't/didn't have the software to test it with. At least it's getting there now.
Title: Re: Exempt Actor Stats
Post by: pacdiggity on March 26, 2011, 04:15:02 AM
Haha, I've defeated you, obstacle! I now have VX again!
And, I've created version 1.5, completely free of syntax errors!
The next version - 2.0 -, provided I don't need to do anything else, will be up by the end of today (26 March, EAST)
Title: Re: Exempt Actor Stats
Post by: pacdiggity on March 27, 2011, 03:22:30 AM
The battle stats script is up and available here (http://rmrk.net/index.php/topic,42181). The two scripts will soon be integrated.