The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: pacdiggity on April 30, 2011, 11:36:58 AM

Title: Troop Fix
Post by: pacdiggity on April 30, 2011, 11:36:58 AM
PAC Troop Names
Version: 1.0a
Author: Welfare-Daddy Pacman
Date: 28/4/2011

Version History

#===============================================================================
#
# Pacman Advanced Creative (PAC) Engine - Troop Fixture
# 27/4/2011
# Type: Utility
# Installation: Optional arrays and booleans.
# Level: Super-Simple
#
#===============================================================================
#
# Description:
# Ever been annoyed at the default 'Slime A, Slime B' system that shows up in
# battle? Ever wanted to shoot it? Now, you don't have to! All you need is this
# simple snippet to change the letters into numbers.
#
#===============================================================================
#
# Instructions:
# INSTALLATION
# Stick this in its own slot above main and below materials. Useable but not
# dependent on other PAC scripts or format.
# CONFIGURATION
# If you want, go to line 46 and change USE_FIX if you don't want to use the
# system.
# Put in values in the LETTER_TABLE array below if you don't like my numerals.
# Use Roman Numerals, your own charcters, whatever as long as you put a space
# after the first ' and a comma and another space after the second '.
# Make sure you are using enough values to compensate for the amount of enemies
# you have in your largest troop: if you don't it will go like 1, 2, 3, 1, 2, 3
# etc.
# If you are using PAC Large Troop, make sure you find the largest troop you
# have set and use the highest number from that for your last value, i.e. if
# you've made a 16 enemy troop, make sure you set 16 or more values.
#
#===============================================================================
#
# EDITING BEGINS AT LINE 53. DO NOT TOUCH LINES 40-51. YOU MAY TOUCH LINE 46.
#
#===============================================================================

$imported = {} if $imported == nil
$imported["PACTroopFix"] = true

module PAC
  module TROOP
    USE_FIX = true  # If you must, set this to false to not use the system.
  end
end


class Game_Troop < Game_Unit
  if PAC::TROOP::USE_FIX
   
#===============================================================================
#
# BEGIN EDITING
#
#===============================================================================
   
    LETTER_TABLE = [' 1', ' 2', ' 3', ' 4', ' 5', ' 6', ' 7', ' 8', ' 9', ' 10',
                    ' 11', ' 12', ' 13', ' 14', ' 15', ' 16', ' 17', ' 18',
                    ' 19', ' 20', ' 21', ' 22', ' 23', ' 24', ' 25', '26']
                   
#===============================================================================
#
# This script no longer requires editing. Do not edit anything in this script
# unless you are a compenent scripter. Should you edit without any scripting
# education, it may result in me tutting at you for getting it wrong.
#
# Although, it is only four lines. Bah, you'll screw it up anyway.
#
#===============================================================================

  else
    LETTER_TABLE = ['']
  end
end

#===============================================================================
#
# END OF SCRIPT
# I BET YOU GET A SYNTAX ERROR THOUGH
#
#===============================================================================


Credit




Thanks


Support



Not that you'd need it, but you could just post here or PM me.
Preferably, post here.

Known Compatibility Issues

This script edits ONE THING. That thing serves ONE PURPOSE. Therefore, unless another script alters this ONE THING, it is likely that either the scripter is bad or the script does the same thing, or more, than this one. This will be compatible with %99.99999999999999999996127 of scripts, addons, mods and explosions.

Demo



This will be in a demo of my upcoming script pack, but it is far too simple to deserve a demo.

Author's Notes
You may notice that the script mentions the PAC Large Troop script. That'll be released soon. Worry not. Everything I write gets released.

Restrictions

Don't take credit for my work, edit freely, don't redistribute with your name. If you absolutely must post this on another forum, link to this topic or my profile here.
Title: Re: Troop Fix
Post by: game_guy on April 30, 2011, 03:51:35 PM
Or if you want to remove the system period, replace the numbers with empty strings. :D Nice job!
Title: Re: Troop Fix
Post by: pacdiggity on April 30, 2011, 03:55:40 PM
That actually did not occur to me. Doi.
Really, this took 3 minutes to make. I just found the bugger in Game_Troop and put it into another script so I didn't have to explain how to do it to people. :P
Thanks g_g.

Actually, if you put LETTER_TABLE as [], it gives you a tasty divzero error because the make_unique_names method in Game_Troop has the clause:
enemy.letter = LETTER_TABLE[n % LETTER_TABLE.size]
which of course is dividing by zero if the size of LETTER_TABLE is, well, zero. I've seen people work around these before, so I'll take a crack at fixing that. The most obvious solution is really just putting '' in the array.
So, if you don't want unique names, just put '' in the LETTER_TABLE array. Simple.
Title: Re: Troop Fix
Post by: pacdiggity on April 30, 2011, 04:49:10 PM
Disregard that post, for I offer a solution. 1.0a is up, adding the aforementioned choice via a boolean in line 46.
Title: Re: Troop Fix
Post by: modern algebra on April 30, 2011, 05:33:54 PM
What did I do? :P
Title: Re: Troop Fix
Post by: pacdiggity on May 01, 2011, 06:58:50 AM
Be awesome, duh.
Title: Re: Troop Fix
Post by: Infinate X on May 15, 2011, 09:20:20 PM
I accualy did that for a game before (Not to numbers just to blanks) and I didn't need another script...

All I did was go to the script Game_Troop and change all of the letters to blanks. I think your script makes it easier for lazy people but it also increases the size of a game for every script and image you add to it.

This was about 7 months ago (not sure if that's correct) and I haven't thought about it since so my first guess being Game_Troop means this edit is simple for everybody to make.

Im not trying to make you feel like time has been wasted but it is simple. At least with your script you don't need to figure anything out for yourself... that usually takes longer...
Title: Re: Troop Fix
Post by: pacdiggity on May 16, 2011, 07:51:10 AM
That is - exactly - what this script does. I even said it in the top post. The intention of this script is to help lazy people, as is a lot of the other PAC scripts.
Scripts don't add that much to the filespace, but you are right.
In fact, the way you described it is the exact way I made this script. Just trolling through the default scripts and saw the bugger laying there. I decided, "why not help others with my amazing discovery?"