Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 2,646
» Latest member: Asticon
» Forum threads: 7,779
» Forum posts: 57,044

Full Statistics

Latest Threads
KEquipSkills XP + VX
Forum: Scripts Database
Last Post: kyonides
2 hours ago
» Replies: 11
» Views: 4,136
What's up, RMers?
Forum: Development Discussion
Last Post: Steel Beast 6Beets
6 hours ago
» Replies: 2,656
» Views: 1,837,820
Birthday Thread
Forum: Occasions
Last Post: DerVVulfman
Yesterday, 04:50 AM
» Replies: 3,554
» Views: 2,150,970
BlueSkies 3
Forum: Upcoming Projects
Last Post: Starmage
04-23-2024, 07:32 AM
» Replies: 6
» Views: 3,936
The Weekly Gazette 04-21-...
Forum: Announcements and Updates
Last Post: DerVVulfman
04-22-2024, 04:59 AM
» Replies: 0
» Views: 98
What are YouTubing?
Forum: General Chat
Last Post: DerVVulfman
04-21-2024, 11:51 PM
» Replies: 834
» Views: 561,631
Terra Blocks: Terraria S...
Forum: Scripts Database
Last Post: DerVVulfman
04-21-2024, 11:02 PM
» Replies: 0
» Views: 82
Chinese Hackers
Forum: Tech Talk
Last Post: kyonides
04-21-2024, 06:11 AM
» Replies: 63
» Views: 31,149
News of the Cyber World
Forum: Tech Talk
Last Post: kyonides
04-21-2024, 06:06 AM
» Replies: 327
» Views: 118,433
News of the World
Forum: General Chat
Last Post: kyonides
04-21-2024, 04:21 AM
» Replies: 1,076
» Views: 376,757

 
  Multi-Equip
Posted by: Trickster - 03-02-2008, 06:15 AM - Forum: Scripts Database - No Replies

Multi-Equip
Version: 3.1.4


Introduction
This script allows you to configure the equipment slots for each actor or class. This script tweaks the Equip menu to show all stats and changes color depending on the change in stats. Also comes ready merged with my Multi-Attack script.


Screenshots
Yeah just look at Arshes but with two swords Oooh. How about two rings wow.

But Well Here are your screenshots
[Image: multiequip1ol8.png]
[Image: multiequip2mc3.png]
[Image: multiequip3ll9.png]
[Image: multiequip4ns3.png]


Demo
Download Here


Script
The families are still sobbing...


Instructions

Okay I am going to make this as clear as possible

Initial Directions
  • First Download the Demo via the Download Manager
  • Get Winzip, Ultimatezip, or some other crazy program to open zip files, and install it.
  • Find the downloaded file
  • Right Click on the file and select Extract or Open your Unzipping program and Extract the files from the archive
  • Open RPG Maker XP if you haven't already
  • Open the Project File
  • Copy Each Script from the demo or paste them all into one script and add that, I only have it in multiple script form for organization.
  • Find the Setup Portion of the Multi Equip Script
  • Get yourself a snack

Setup and Customization
Now I am going to explain this a second time, the code in the setup is already commented once with the instructions, but I'm going to explain it again code by code
  • The Loading of Data System This Line
    Code:
    $data_system = load_data("Data/System.rxdata")[/list]
          Is one of those "Do Not Touch Lines unless you know what you are doing" lines, but FYI it is used to get the defaults at the end of the setup.
    [*][code]        #--------------------------------------------------------------------------
            # * How Many Weapon Slots Needed (Maximum)
            #--------------------------------------------------------------------------
            Weapon_Slots = 2
    This is the Maximum Number of weapon slots needed, if you don't set this value correctly you will receive an error (probably a NilClass error)
  • Code:
    #--------------------------------------------------------------------------
            # * How Many Armor Slots Needed (Maximum)
            #--------------------------------------------------------------------------
            Armor_Slots = 6
    This is the Maximum Number of armor slots needed, if you don't set this value correctly you will receive an error (probably a NilClass error)
  • Code:
    #--------------------------------------------------------------------------
            # * Equip Names For Slots for Actors
            #     syntax - actor_id => [names] or %w( names )
            #--------------------------------------------------------------------------
            Actor_Names = {
            1 => %w( Sword Sword Shield Helm Armor/Plate Ring Ring ),
            2 => %w( Spear Shield Helm Armor/Plate Ring ),
            7 => ['Mace','Hat','Robe','Ring'],
            8 => ['Rod','Hat','Robe','Ring']
            }
    These are the slot equip names per actor. This is a hash using actor ids as keys and a array of strings as a value. Take the actor ids from the database without leading zeroes, now choose the names of each equip slot now type this (whatever actor id) => %w( name name name name ) or (whatever actor id => ['name', 'name', 'name'] the %w( ) is just a fancy easier way to create an array of strings you don't need the ' ' or " " or commas just use a space to separate elements if you need a space however just type \s
  • Code:
    #--------------------------------------------------------------------------
            # * Equip Names For Slots Classes
            #     syntax - class_id => [names] or %w( names )
            #--------------------------------------------------------------------------
            Class_Names = {
            1 => %w( Sword Sword Shield Helm Armor/Plate Ring Ring ),
            2 => %w( Spear Shield Helm Armor/Plate Ring ),
            7 => ['Mace','Hat','Robe','Ring'],
            8 => ['Rod','Hat','Robe','Ring']
            }
    See above and subsitute actor_id for class_id and actor with class. I'm not typing all of that again
  • Code:
    #--------------------------------------------------------------------------
            # * Equip Types For Slots
            #     syntax - actor_id = [types]
            #     note - w = weapon an = armor kind n
            #--------------------------------------------------------------------------
            Actor_Types = {
            }
    This is the Equip Types for each slot. It is setup in the same manner as the Actor_Names and Class_Names except this time you are deciding what can be equipped in each slot. This must correspond to the Slot Names defined. Now if you want to equip a weapon in the slot type w if you want a shield type a1 helmets a2 body armor a3 accessories a4 Hidden feature Other an where n is greater than 4 now I remember a script that lets you configure the database further now if you edit the armor's kind to be another value then maybe you make use of this feature.
  • Code:
    #--------------------------------------------------------------------------
            # * Equip Types For Slots
            #     syntax - class_id = [types] or %( types )
            #     note - w = weapon an = armor kind n
            #--------------------------------------------------------------------------
            Class_Types = {
            1 => %w( w w a1 a2 a3 a4 a4 ),
            2 => %w( w a1 a2 a3 a4 ),
            7 => ['w', 'a2', 'a3', 'a4'],
            8 => ['w', 'a2', 'a3', 'a4']
            }
    See Actor Types replace actor id with class id and actor with class also reread Actor Names and Class Names on the hash setup
    [*][code]        #--------------------------------------------------------------------------
            # * Initial Equipment
            #     syntax - actor_id => {slot id => equip id}
            #--------------------------------------------------------------------------
            Init_Equip = {
            1 => {0=>1, 2=>1, 3=>5, 4=>13},
            2 => {0=>5, 1=>1, 2=>5, 3=>17},
            7 => {0=>25, 1=>9, 2=>21},
            8 => {0=>29, 1=>9, 2=>21}
            }
    Now Let me tell you something important, the database equipment functions fail with this script added to your project, so you will have to redefine your initial equipment here. Again this is a hash with the actor ids as the key, but the inner values are also hashes as well with their key being the slot id (refer to the Names and Slot types Defined), if you do not define a slot then it is assumed that nothing is equipped in it when you start the game.
  • Code:
    #--------------------------------------------------------------------------
            # * Battle Test Equipment
            #     syntax - actor_id => {slot id => equip id}
            #--------------------------------------------------------------------------
            BT_Equip = {
            1 => {0=>4, 1=>2, 2=>1, 3=>5, 4=>13},
            2 => {0=>5, 1=>1, 2=>5, 3=>17},
            7 => {0=>25, 1=>9, 2=>21},
            8 => {0=>29, 1=>9, 2=>21}
            }
    See Init_Equip but replace at the start of game with when battletesting.
  • Code:
    #--------------------------------------------------------------------------
            # * Fixed Equipment
            #     syntax - actor_id => {slot_id => bool}
            #--------------------------------------------------------------------------
            Equip_Fix = {
            }
    This is the Fixed Equipment Option, again the database equipment functions fail after you add this script, and here you can define which slots are fixed again a hash (see a connection here?) with the actor ids as keys and with the value being another hash with the slot id (refer to Names and Slot Types)
  • Now Reaching the Do Not Touch Section
    Code:
    #--------------------------------------------------------------------------
            # * Set Class Types Default to Corresponding words for each slot
            #--------------------------------------------------------------------------
            Class_Names.default = $data_system.words.weapon, $data_system.words.armor1,
            $data_system.words.armor2, $data_system.words.armor3, $data_system.words.armor4
    Remember that line I pointed out at the beginning well here is where its needed. Its just the lame old Weapon, Shield, Helmet, Body Armor, and Accessory.
  • Code:
    #--------------------------------------------------------------------------
            # * Set Class Names Default to The Normal Five Slots
            #--------------------------------------------------------------------------
            Class_Types.default = %( w a1 a2 a3 a4 )
    Just the normal five slots here. nothing else.

Sidesteps
I mentioned that the Database's equipment functions fail after adding this script. This means that you can not use the Starting Equipment section in the actor tab in the database, in the battle test menu the Equipment Section, The Event Command Change Equipment, Conditional Branch Section Actor conditions weapon equipped and armor equipped.

Now the first two you can sidestep by the script setup

Now for Changing Equipment use the call script event command
.equip(slot_id, id)
is an instance of Game_Actor (ex $game_party.actors[0], $game_actors[2])
slot_id is the slot id refer to equip slot_types
id is the id of the weapon or armor to equip see slot_types

Now for Conditional Branch Weapon Equipped

Use the Script Condition of the Conditional Branch
.weapon_ids.include?(id)
is an instance of Game_Actor (ex $game_party.actors[0], $game_actors[2])
id is the id of the weapon to check if equipped

Now for Conditional Branch Armor Equipped

Use the Script Condition of the Conditional Branch
.armor_ids.include?(id)
is an instance of Game_Actor (ex $game_party.actors[0], $game_actors[2])
id is the id of the armor to check if equipped


FAQ
Note: Permission granted by Trickster to post:
Quote:And if you post what you have now of my stuff then you don't have the latest versions. I'm too lazy/busy to post stuff.
As this is his material, it is deletable upon his request. Due to his current absense, no support is available. Please do not PM or eMail him for support.


Compatibility
Increased Compatibility with all of my other scripts.
May not be compatible with your CMS, I may merge the two if you ask.
Will be compatible with the next version of Seph's Equipment Skills script. *looks at Seph*
Incompatible with my equipment weights script NOW A PATCH IS INCLUDED
Incompatible with RTAB (don't ask for me to merge)
SDK compliant (don't ask to remove dependancy)
Requires Method and Class Library V1.5 or higher


Credits and Thanks
All Betatesters who tested this script, I forget if anyone tested it *coughRavencough*


Terms and Conditions
Hey, I posted this publicly. You can use it. What do you expect? But if you do use it, I do expect you to spell my name correctly in your game. And yes you can use it in commercial games too.

Print this item

  Multi-Attack
Posted by: Trickster - 03-02-2008, 06:13 AM - Forum: Scripts Database - Replies (4)

Multi-Attack
Version: 4.0


Introduction
This script allows for skills/weapons/enemies/items to hit multiple times. This script is similiar to the KGC script of the same name, but isn't the same as it.


Demo
Download Here


Instructions
All you have to do is edit the animation and add blank Timing events (no SE and no Flashes) (if you don't get what this is there are examples given in the demo) at the frame where you want damage to show if it is just one hit and you want it to show at the last frame of the animation don't do anything the script automatically takes care of it, but If you want two or more hits then and you want it to show damage at the last frame then you have to add a Blank Timing event at the end of the animation. You don't have to do any mods to anything else the script takes care of that for you.


Compatibility
SDK 2.x compliant

Requires Method and Class Library V1.5 or greater


Patches
Sg's Counter Attack Script (Outdated)
Script


FAQ
Note: Permission granted by Trickster to post:
Quote:And if you post what you have now of my stuff then you don't have the latest versions. I'm too lazy/busy to post stuff.
As this is his material, it is deletable upon his request. Due to his current absense, no support is available. Please do not PM or eMail him for support.


Credits and Thanks
Raziel for what little betatesting he did (lol just kidding Raz :P you did a great job helping)

Kurisu and Raven for betatesting as well.


Author's Notes
Enjoy


Terms and Conditions
Hey, I posted this publicly. You can use it. What do you expect? But if you do use it, I do expect you to spell my name correctly in your game. And yes you can use it in commercial games too.

Print this item

  Moving Windows
Posted by: Trickster - 03-02-2008, 06:10 AM - Forum: Scripts Database - No Replies

Moving Windows
Version: 1.0


Introduction
This scriptlet adds a few functions to the Window_Base class that allows windows to move.


Script
Code:
class Numeric
  def sign
    return 0 if self.zero?
    return (self / self.abs).to_i
  end
end

class Window_Base
  #--------------------------------------------------------------------------
  # * Move the sprite
  #   x     : x coordinate of the destination point
  #   y     : y coordinate of the destination point
  #   speed : Speed of movement
  #--------------------------------------------------------------------------
  def move(x, y, speed = 1)
    # Set Destination Points speed and move count set moving flag
    @destination_x = x
    @destination_y = y
    @move_speed = speed
    @moving = true
    # Get the distance + (negative if to left or up positive if down or right)
    @distance_x = (@destination_x - self.x).to_f
    @distance_y = (@destination_y - self.y).to_f
    # Get slant distance (hypotenuse of the triangle (xf,yi) (xi,yf) and (xf,yf))
    @distance = Math.sqrt(@distance_x ** 2 + @distance_y ** 2)
    # Calculate angle of movement which is later used to determine direction
    # If X distance is 0 (Prevent Infinity Error)
    if @distance_x == 0
      # The Angle is sign(distance_y) * - ? / 2 (90° or 270°)
      @angle = @distance_y.sign * Math::PI / 2
    # If Y distance is 0 (Prevent Incorrect Direction for later)
    elsif @distance_y == 0
      # The Angle is sign(distance_x) - 1 * ? / 2 (0° or 180°)
      @angle = (@distance_x.sign - 1) * Math::PI / 2
    else
      # The Angle is the Arctangent of @distance_y / @distance_x (slope)
      # Returns [-?,?]
      @angle = Math.atan2(@distance_y, @distance_x.to_f)
    end
    # Convert the angle to degrees
    @angle *= 180 / Math::PI
  end
  #--------------------------------------------------------------------------
  # * Update Move
  #--------------------------------------------------------------------------
  alias moving_window_update update
  def update
    moving_window_update
    update_move
  end
  #--------------------------------------------------------------------------
  # * Moving?
  #--------------------------------------------------------------------------
  def moving?
    return @moving
  end
  #--------------------------------------------------------------------------
  # * Update Move
  #--------------------------------------------------------------------------
  def update_move
    # If not moving
    if (self.x == @destination_x and self.y == @destination_y) or not @moving
      @moving = false
      return
    end
    # move increase x = the cosine of the arctangent of the dist x over dist y
    # move increase x = cos(arctan(disty/distx)) simplified by trigonometry
    # to distance_x / slant_distance, the sprite moves (move speed)
    # along the slanted line (if it is slanted)
    movinc_x = @move_speed * @distance_x.abs / @distance
    # same reasoning with y increase except it is the sine of the arctangent
    # move increase y = sin(arctan(disty/distx)) simplified by trigonometry
    # to distance_y / slant_distance
    movinc_y = @move_speed * @distance_y.abs / @distance
    # Move the sign of the distance left + move increase or the remaining distance
    # left if it will go past that point
    if @move_speed != 0
      # Get distance remaining
      remain_x = (@destination_x - self.x).abs
      remain_y = (@destination_y - self.y).abs
      self.x += (@destination_x - self.x).sign * [movinc_x.ceil, remain_x].min
      self.y += (@destination_y - self.y).sign * [movinc_y.ceil, remain_y].min
    end
    # If Destination Reached stop moving
    if self.x == @destination_x and self.y == @destination_y
      @moving = false
      return
    end
  end
end


Instructions
Add in a new script above main

to move a window just call
.move(x, y, speed)

where x is the destination x coordinate
y is the destination y coordinate
speed is the speed of the movement

Other functions are
.moving? => True if window is moving false otherwise

Within the Window Class
@angle => returns the angle of the movement in degrees


FAQ
Note: Permission granted by Trickster to post:
Quote:And if you post what you have now of my stuff then you don't have the latest versions. I'm too lazy/busy to post stuff.
As this is his material, it is deletable upon his request. Due to his current absense, no support is available. Please do not PM or eMail him for support.


Compatibility
Should be compatible with any script


Credits and Thanks
J-Street for requesting.


Terms and Conditions
Hey, I posted this publicly. You can use it. What do you expect? But if you do use it, I do expect you to spell my name correctly in your game. And yes you can use it in commercial games too.

Print this item

  Maximum Skill Limits
Posted by: Trickster - 03-02-2008, 06:07 AM - Forum: Scripts Database - No Replies

Maximum Skill Limits
Version: 1.1


Introduction
As soon as an actor gains a fifth skill (if set), it will promptly take you to Scene_Max where you can delete one of your skills The actual Scene_Max was spawned out of the Scene_Skill code and now for what was updated Create an element named undeletable give skills you want to be unable to delete with this element checked remember the id change the part in this script to the element id you created now Undeletable Skills will appear in red


Script
Maximum Skill Limits


Note
Be warned because using this in the wrong way could leave the player unable to delete a skill and thus trapped and unable to continue playing (The script doesn't check if all of the skills are undeletable)

Limitations of this script:
  • If a character gains a level to where two skills are learned and the player already has 4 skills only one will be deleted this will give them 5 skills
  • Doesn't check to see if all of the skills are undeletable


FAQ
Note: Permission granted by Trickster to post:
Quote:And if you post what you have now of my stuff then you don't have the latest versions. I'm too lazy/busy to post stuff.
As this is his material, it is deletable upon his request. Due to his current absense, no support is available. Please do not PM or eMail him for support.


Terms and Conditions
Hey, I posted this publicly. You can use it. What do you expect? But if you do use it, I do expect you to spell my name correctly in your game. And yes you can use it in commercial games too.

Print this item

  Map Infos
Posted by: Trickster - 03-02-2008, 06:06 AM - Forum: Scripts Database - Replies (1)

Map Infos
Version: 1.2


Introduction
This mini-script, loads data from RPG::Map into RPG::MapInfo. I wasn't pleased to see that you have to load a file just to get data that should have been in RPG::MapInfo, so I scripted this up pretty quickly to load all information (except event data and tileset data, I may add event data in a future update)


Screenshots
ok visualize the copying of data to one memory location to another memory location there is your screenshot


Demo
See next topic by me for a demo


Script
I despise the families...

Code:
=begin
=============================================================================
? Map Info
=============================================================================
Trickster
Version 1.2
3.21.07
=============================================================================
=end

#--------------------------------------------------------------------------
# * Begin SDK Log
#--------------------------------------------------------------------------
SDK.log('Map Info', 'Trickster', 1.2, '3.21.07')
#--------------------------------------------------------------------------
# Begin SDK Requirement Check
#--------------------------------------------------------------------------
SDK.check_requirements(2.0, [1, 2, 3])
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.enabled?('Map Info')
  
#--------------------------------------------------------------------------
# * Save RPG::MapInfo Data
#   Set to To True to Save MapInfo Data this moves the RPG::Map stuff to
#   RPG::MapInfo so maps will not be loaded frequently to get the map info.
#   Set it to True run project at least once then set to false, set to
#   true again if you changed any of your maps
#--------------------------------------------------------------------------
Save_MapInfoData = false

#--------------------------------------------------------------------------
# * Update RPG::MapInfo Data
#   Set this to true if you changed any of your maps
#--------------------------------------------------------------------------
Update_MapInfoData = false

  
class RPG::MapInfo
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :tileset_id
  attr_accessor :width
  attr_accessor :height
  attr_accessor :autoplay_bgm
  attr_accessor :bgm
  attr_accessor :autoplay_bgs
  attr_accessor :bgs
  attr_accessor :encounter_list
  attr_accessor :encounter_step
end

class Scene_Title
  #--------------------------------------------------------------------------
  # * Main Database
  #--------------------------------------------------------------------------
  alias_method :trick_mapinfo_title_main_database, :main_database
  def main_database
    # The Usual
    trick_mapinfo_title_main_database
    # Create $data_mapinfos object
    $data_mapinfos = load_data("Data/MapInfos.rxdata")
    # Setup encounter info
    setup_map_info
  end
  #--------------------------------------------------------------------------
  # * Battle Test Database
  #--------------------------------------------------------------------------
  alias_method :trick_mapinfo_title_battletest_database, :battletest_database
  def battletest_database
    # The Usual
    trick_mapinfo_title_battletest_database
    # Create $data_mapinfos object
    $data_mapinfos = load_data("Data/MapInfos.rxdata")
    # Setup encounter info
    setup_map_info
  end
  #--------------------------------------------------------------------------
  # * Setup Map Info
  #--------------------------------------------------------------------------
  def setup_map_info
    # Return if test value is not nil or updating info
    return if $data_mapinfos[1].width != nil and !Update_MapInfoData
    # Begin
    begin
      # Do from 1 to 999 (Maximum number of maps)
      1.upto(999) do |map_id|
        # Load Map
        map = load_data(sprintf("Data/Map%03d.rxdata", map_id))
        # Set Map Info Object
        $data_mapinfos[map_id].tileset_id = map.tileset_id
        $data_mapinfos[map_id].width = map.width
        $data_mapinfos[map_id].height = map.height
        $data_mapinfos[map_id].autoplay_bgm = map.autoplay_bgm
        $data_mapinfos[map_id].bgm = map.bgm
        $data_mapinfos[map_id].autoplay_bgs = map.autoplay_bgs
        $data_mapinfos[map_id].bgs = map.bgs
        $data_mapinfos[map_id].encounter_list = map.encounter_list
        $data_mapinfos[map_id].encounter_step = map.encounter_step
      end
    rescue Errno::ENOENT
      # If Save Map Info Data Save Data
      save_data($data_mapinfos, "Data/MapInfos.rxdata") if Save_MapInfoData
    end
  end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end


Instructions
Add above main that's it, It also has a save data feature so you will only have to set it to true once, load your project and set it to false. you will have to set it to true again if you edit your maps or else...


FAQ
Note: Permission granted by Trickster to post:
Quote:And if you post what you have now of my stuff then you don't have the latest versions. I'm too lazy/busy to post stuff.
As this is his material, it is deletable upon his request. Due to his current absense, no support is available. Please do not PM or eMail him for support.


Compatibility
Requires SDK Part 3


Author's Notes
The first person who posts "What does this script do?" will get a surprise from me (and it won't be a good surprise) if you don't know what this does then you won't have a use for it


Terms and Conditions
Hey, I posted this publicly. You can use it. What do you expect? But if you do use it, I do expect you to spell my name correctly in your game. And yes you can use it in commercial games too.

Print this item

  Loading Data from File
Posted by: Trickster - 03-02-2008, 06:04 AM - Forum: Scripts Database - No Replies

Loading Data from File
Version: 1.0


Introduction
This script will allow a scripter to load data from a text file. Great for scripts that require large amounts of data and you don't want to define things using the database or the script editor. The script will catch many different errors while reading from the file (Syntax Errors, Missing } for hashes and Missing ] for arrays) and tells the line(s) and data where the error was found. Also This Tool can load data on multiple lines. And Organizes the information loaded.


Screenshots
Yeah that will help.


Script
Code:
module Trickster
  class File_LoadRxdata < File
    attr_accessor :line
    
    def format_readline
      data = self.readline
      @line = data.dup
      data = data.split(/\s/)
      data.delete("")
      return data
    end
    
    def requirements(data, required, properties)
      for i in required
        if data[i].nil? and i < properties.size
          s1 = "Error Loading Data"
          s2 = "\n#{properties[i]} is undefined"
          Kernel.print(s1+s2)
          exit
        end
      end
    end
      
    def error_incorrect_name
      s1 = "Error Loading Data at Line number #{file.lineno}"
      s2 = "\nIncorrect defining name"
      s3 = "\nLine data: #{self.line}"
      Kernel.print(s1+s2+s3)
      exit
    end
      
    def error_array(extra)
      s1 = "Error Loading Data at Line number#{extra}"
      s2 = "\nMissing ']' for Array"
      s3 = "\nLine data: #{self.line}"
      Kernel.print(s1+s2+s3)
      exit
    end
      
    def error_hash(extra)
      s1 = "Error Loading Data at Line number#{extra}"
      s2 = "\nMissing '}' for Hash"
      s3 = "\nLine data: #{self.line}"
      Kernel.print(s1+s2+s3)
      exit
    end
          
    def error_syntax(extra)
      s1 = "Error Loading Data at Line number#{extra}"
      s2 = "\nSyntax Error"
      s3 = "\nLine Data: #{self.line}"
      Kernel.print(s1+s2+s3)
      exit
    end
    
    def load_next_line
      return false if self.eof?
      data = self.format_readline
      return true if data == [] or data[0].include?("#")
      return data
    end
    
    def test_type(data, line, lineno, multi = 0)
      # make a copy of the data
      temp = data.dup
      # set extra text if an error is found
      extra = (multi > 0) ? "s #{lineno}-#{lineno+multi}" : " #{lineno}"
      if temp == "nil" #If a nil reference
        data = nil
      elsif temp.slice(0..0) == "[" #if an array
        if !temp.include?("]")
          self.error_array(extra)
        end
        begin
          data = eval(data)
        rescue SyntaxError
          self.error_syntax(extra)
        end
      elsif temp.slice(0..0) == "{" #if a hash      
        if !temp.include?("}")
          self.error_hash(extra)
        end
        begin
          data = eval(data)
        rescue SyntaxError
          self.error_syntax(extra)
        end
      elsif test_int(temp) #If a number or "0"
        data = data.to_i
      end
      #else it is a string so just return
      return data
    end
      
    def test_int(data)
      flag = true
      for i in 0...data.length
        test = data.slice(i..i)
        if test == "0" or test.to_i != 0
          flag = flag && true
        else
          flag = false
        end
      end
      return flag
    end
  end
    
  
  #loading data from a text file
  #inputs:  file_name  = file name to load
  #         properties = defining values (see example)
  #         required   = required values to be loaded
  #         multi_lined = defining values that accept multiple lines (strings only)
  #returns: an array with the data from text file
  def self.load_data_from_txt(file_name, properties, required = [0], multi_lined = [])
    # Initialize local variables
    final_data = []
    data_txt = []
    index = 1
    # Load File
    file = Trickster::File_LoadRxdata.open(file_name)
    # Loop until End of File (EOF)
    until file.eof?
      # Get line data
      data = file.format_readline
      # Get Line
      line = file.line
      # Next if no data or commented line
      next if data == [] or data[0].include?("#")
      # Get id from the properties
      id = properties.index(data[0])
      # If a new id
      if id == 0 and data_txt != []
        # Check requirements and return error if not fulfilled
        file.requirements(data_txt, required, properties)
        # Finished reading a piece of data
        final_data[index] = data_txt.dup
        # Increase index and reset data
        index += 1
        data_txt = []
      elsif id == nil
        # Incorrent Defining name error message
        file.error_incorrect_name
      end
      # Remove defining name and join together
      data.delete_at(0)
      data = data.join(' ')
      # Get line number
      lineno = file.lineno
      # Start multi line information checking
      multi = 1
      if multi_lined.include?(id)
        # Load next line
        next_line = file.load_next_line
        # Get first data
        first = next_line.is_a?(Array) ? next_line[0] : ""
        # Reset flag
        flag = false
        # While an invalid property and the file is not eof? or data loaded
        while (properties.index(first) == nil and (next_line != false or next_line.is_a?(Array)))
          # While was excuted once
          flag = true
          position = file.pos
          # add to data if an array
          if next_line.is_a?(Array)
            # Get property data
            first = next_line[0]
            if properties.index(first) == nil
              data += ' ' + next_line.join(' ')
            end
          end
          # Load next line and reset first
          next_line = file.load_next_line
          first = ""
          # increase multi line count
          multi += 1
          # break if file.eof? continue if line was a comment
          break if next_line == false
          next if next_line == true
          first = next_line[0]
        end
        if flag
          file.pos = position
        end
        if next_line.is_a?(Array)
          if properties.index(first) == nil
            data += next_line.join(' ')
          end
        end
      end      
      data = file.test_type(data, line, lineno, multi)
      data_txt[id] = data
    end
    # Reached End of File Get last data if any
    if data_txt != []
      # Check requirements and return error if not fulfilled
      file.requirements(data_txt, required, properties)
      # Finished reading a piece of data
      final_data[index] = data_txt
      # Increase index and reset data
      index += 1
      data_txt = []
    end
    # return all data compacted
    return final_data.compact
  end
end

Instructions

To call just use use

data = Trickster.load_data_from_txt(file, properties[, required, multi_lined])
file is the file to load for reading
properties are the defining names of the data you want to load
required is the names that must be defined (by default the first item is required)
multi_lined are the defining names whose data can be defined on multiple lines

An Example Call
Code:
Scene_Title method main additions
load_mission_info
if @load_mission
  if Mission::Constants::SAVE_DATA
    save_data($data_missions, "Data/Missions2.rxdata")
  end
else
  $data_missions        = load_data("Data/Missions2.rxdata")
end

  def load_mission_info
    properties = []
    properties[0] = "id"
    properties[1] = "name"
    properties[2] = "icon"
    properties[3] = "cost"
    properties[4] = "rank"
    properties[5] = "switch"
    properties[6] = "area"
    properties[7] = "skills"
    properties[8] = "items"
    properties[9] = "mission"
    properties[10] = "random"
    properties[11] = "cancel"
    properties[12] = "penalty"
    properties[13] = "reward"
    properties[14] = "description"
    filename = "Data\\Missions.rxdata"
    @load_mission = true
    begin
      $data_missions = [nil]
      missions = Trickster.load_data_from_txt(filename,properties,[0,1],[14])
      for mission in missions
        $data_missions[mission[0]] = RPG::Mission.new(mission)
      end
    rescue
      #project is encrypted the file can't be found
      @load_mission = false
    end
  end

and the corresponding text file will look like this
Code:
id        1
name        Ghosts!?!
icon        battle_icon
cost        200
rank        1
switch        1
description    A C[C0C0C0]GhostC[N] has been spotted near the lake can someone please
get rid of him. Meet me outside this building if you take this request.
N[]T[]~Some random guy
area        [1]
skills        nil
items        nil
mission        nil
random        nil
cancel        false
penalty        nil
reward        {'gold' => 500,'combat' => 10, 'weapons' => 2}

id        2
name        Help Me!!
icon        note_icon
cost        150
rank        1
switch        2
area        [1]
skills        {'negotiate' => 1}
items        nil
mission        [1]
random        nil
cancel        true
penalty        {'gold' => 50}
reward        {'negotiate' => 3, 'weapons' => 2, 'items' => 3}
description    Can someone please buy this item off of me. My shop is going out of business
and I need the money to feed my family. Meet me near the river if you choose to take this request.
N[]T[]~Shop owner


FAQ
Note: Permission granted by Trickster to post:
Quote:And if you post what you have now of my stuff then you don't have the latest versions. I'm too lazy/busy to post stuff.
As this is his material, it is deletable upon his request. Due to his current absense, no support is available. Please do not PM or eMail him for support.


Compatibility
Compatible with everything


Terms and Conditions
Hey, I posted this publicly. You can use it. What do you expect? But if you do use it, I do expect you to spell my name correctly in your game. And yes you can use it in commercial games too.

Print this item

  Limit Breaks
Posted by: Trickster - 03-02-2008, 06:03 AM - Forum: Scripts Database - No Replies

Limit Breaks
Version: 3.2


Introduction
This script allows you to break the limits set by the default scripts. This script goes quite well when used by my stats that level up script. Note:: This is not my overdrive-skills type script if you were looking for that instead then see my Advanced IP skills script.


Demo
Download Here


Script
The Script was here?!!? how did that happen?!?! Well the families will not be breaking any limits today


Instructions
Add above main but below SDK


FAQ
Note: Permission granted by Trickster to post:
Quote:And if you post what you have now of my stuff then you don't have the latest versions. I'm too lazy/busy to post stuff.
As this is his material, it is deletable upon his request. Due to his current absense, no support is available. Please do not PM or eMail him for support.


Compatibility
Requires SDK Part 1


Credits and Thanks
Twilight for requesting


Author's Notes
Update/repost


Terms and Conditions
Hey, I posted this publicly. You can use it. What do you expect? But if you do use it, I do expect you to spell my name correctly in your game. And yes you can use it in commercial games too.

Print this item

  Level Up Notice
Posted by: Trickster - 03-02-2008, 06:00 AM - Forum: Scripts Database - No Replies

Level Up Notice
Version: 2.0


Introduction
This script Adds a Level up window for when you level up. Pretty Simple....


Screenshots
Feeling Generous today...
...not


Introduction
Download Here


Script
Seriously I have nothing to say, you don't really know how hard it is to come up with what to say here since I am not in anyway going to post the script because I am lazy, download the demo and get over it. THERE'S YOUR MESSAGE SOMEHOW RELATED TO THE FAMILIES!!!


Instructions
Just add above main


FAQ
Note: Permission granted by Trickster to post:
Quote:And if you post what you have now of my stuff then you don't have the latest versions. I'm too lazy/busy to post stuff.
As this is his material, it is deletable upon his request. Due to his current absense, no support is available. Please do not PM or eMail him for support.


Compatibility
The Phase5 methods of Scene_Battle were rewritten for this script.

SDK 2.x compliant
Uses MACL 2.0


Credits and Thanks
ME


Author's Notes
Scripted in less than an hour


Terms and Conditions
Hey, I posted this publicly. You can use it. What do you expect? But if you do use it, I do expect you to spell my name correctly in your game. And yes you can use it in commercial games too.

Print this item

  Item Limits and Rarity Colors
Posted by: Trickster - 03-02-2008, 05:58 AM - Forum: Scripts Database - No Replies

Item Limits and Rarity Colors
Versions: 1.3 and 1.1


Introduction
Two for one deal, the first sets up a limit for items, and the second makes rarer items in a different color


Screenshots
I'll be up front this time. No screenshots.


Demo
Download Here


Script
Scripts are rare. they are in a color Color.new(0, 0, 0, 0) in case you don't know that is clear invisible if you will :p


Instructions
Instructions given in the setup section of both scripts.


FAQ
Note: Permission granted by Trickster to post:
Quote:And if you post what you have now of my stuff then you don't have the latest versions. I'm too lazy/busy to post stuff.
As this is his material, it is deletable upon his request. Due to his current absense, no support is available. Please do not PM or eMail him for support.


Compatability
requires SDK Part I


Author's Notes
Scripted in less than an hour

5 scripts in one day :p!

Note that Item colors may not come up in all scenes


Terms and Conditions
Hey, I posted this publicly. You can use it. What do you expect? But if you do use it, I do expect you to spell my name correctly in your game. And yes you can use it in commercial games too.

Print this item

  Individual Turns Battle System
Posted by: Trickster - 03-02-2008, 05:56 AM - Forum: Scripts Database - No Replies

Individual Turns Battle System
Version: 2.5


Introduction
This script transforms the DBS (Group Turns System) Into an Individual Turns Battle System. This Battle System lets actions be selected individually and they are performed immediately.


Demo
Download Here


Script
Script? there was never a script here if you are a family member then you must be surely seeing things get the demo. The FAMILIES MUST DECIDE IN A GROUP


Instructions
Add the SDK and the Method and Class Library if not present
There are no options or customizations as this script is plug and play


FAQ
Note: Permission granted by Trickster to post:
Quote:And if you post what you have now of my stuff then you don't have the latest versions. I'm too lazy/busy to post stuff.
As this is his material, it is deletable upon his request. Due to his current absense, no support is available. Please do not PM or eMail him for support.


Compatibility
May not be compatible with some Battle Addons (I know for a fact it is not compatible with my Ally AI script) if you happen to find incompatibility ask me nicely and I may merge them (Depends though)

SDk 2.x compliant


Credits and Thanks
Me


Author's Notes
Scripted in less than an hour :)


Terms and Conditions
Hey, I posted this publicly. You can use it. What do you expect? But if you do use it, I do expect you to spell my name correctly in your game. And yes you can use it in commercial games too.

Print this item