Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Modifiy combat step rate command

This script adds a lost feature from old rpgmakers: the changue combate rate command. It also lets you restart it.

You can ask for bugs, suggerences, compatibilitzations and any other things.

You can get the code in this simple web. Im going to use it on now because it saves alot of time updating posts and other things.

http://usuarios.multimania.es/kisap/english_list.html

Code:
#==============================================================================

# Modifiy combat step rate command

# By gerkrt/gerrtunk

# Version: 1

# License: GPL, credits

# Date: 4/1/2011

# For the latests updates or bugs fixes of this script check here:

# [url=http://usuarios.multimania.es/kisap/english_list.html]http://usuarios.multimania.es/kisap/english_list.html[/url]

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

 

=begin

 

---------INTRODUCTION----------

 

This script adds a lost feature from old rpgmakers: the changue combate rate 

command. It also lets you restart it.

 

--------INSTRUCTIONS------------

 

modify_step_count(new_step_count, map_id): This lets you changue the basic value

of step counts calculation. You have to pass first the new steps value.

If you dont pass a map id value it will use the map where you are.

 

restart_step_count(map id): This restarts the actual step count, putting it

in a similar initital value. If you dont pass a map id value it will use the

map where you are.

 

-Note that the script tries to save the actual steps of the player and add

that in the new step count. You can anulate that calling the restart method

before modifing it.

 

-The information is saved when you save the game and its permanent. 

 

----------EXAMPLES--------------

 

modify_step_count (56)   --> This changues the steps count of the actual map

to 56.

 

modify_step_count (5, 34)  --> This changues the map 5 to 34 steps count.

 

=end

 

 

class Interpreter

  #--------------------------------------------------------------------------

  # * Restart Encounter Count

  # alias gameplayer method and check map id

  #--------------------------------------------------------------------------

  # If you want to not save the actual steps, use it

  def restart_step_count(map_id=-1)

    # If the map id is -1, mark of actual default map, use actual map_id

    if map_id == -1

      map = $game_map.map_id

    # If not, changue the id specified

    else

      map = map_id

    end

    

    # Call the real method

    $game_player.restart_step_count(map)

  end

  

  #--------------------------------------------------------------------------

  # * Modify Step Count

  #  add or update a new step count in list and call apply in gameplayer

  #-------------------------------------------------------------------------- 

  def modify_step_count(value, map_id=-1)

    

    # If the map id is -1, mark of actual default map, use actual map_id

    if map_id == -1

      map = $game_map.map_id

    # If not, changue the id specified

    else

      map = map_id

    end

    

    # Add or update value.

    $game_system.moded_steps_counts[map] = value

    

    # Apply it

    $game_player.apply_step_count(value, map)

 

  end

 

end

 

 

 

class Game_System

  

  attr_accessor :moded_steps_counts      # List of new steps counts pushed

  alias gs_init_wep_msc initialize 

  

  def initialize

    @moded_steps_counts = []

    gs_init_wep_msc

  end

  

end

 

 

 

class Game_Player

  

  #--------------------------------------------------------------------------

  # * Get Encounter Count

  #--------------------------------------------------------------------------

  def encounter_count

    return @encounter_count

  end

  

  #--------------------------------------------------------------------------

  # * Restart Encounter Count

  # 

  #--------------------------------------------------------------------------

  def restart_step_count(map)

    

    # If exist a modified rate use it 

    if $game_system.moded_steps_counts[map] != nil

      n = $game_system.moded_steps_counts[map]

      

    # If not use bd one. It needs to load it. 

    else

      bdmap = load_data(sprintf("Data/Map%03d.rxdata", map))

      n = bdmap.encounter_step

    end

    @encounter_count = rand(n) + rand(n) + 1

    

  end

  

  #--------------------------------------------------------------------------

  # * Apply Step Count

  #--------------------------------------------------------------------------

  def apply_step_count(value, map)

      

      # First calculate the number of steps using base map/moded array - actual

      # If exist a modified rate use it 

      if $game_system.moded_steps_counts[map] != nil

        n = $game_system.moded_steps_counts[map]

        

      # If not use bd one

      else

        bdmap = load_data(sprintf("Data/Map%03d.rxdata", map))

        n = bdmap.encounter_step

      end

      

      # Rest it, and make that cant be negative.

      c = (@encounter_count - n).abs

      

      # Create the new count adding the actual steps

      @encounter_count = rand(n) + rand(n) + 1 + c

      # Make sure that its at less 0

      @encounter_count.abs

      

  end

  

  #--------------------------------------------------------------------------

  # * Make Encounter Count

  # moded to check for moded steps rates

  # no es reseteja cuan surts del mapa x ho pot ser x una altre cosa

  #--------------------------------------------------------------------------

  def make_encounter_count

    

    # Image of two dice rolling

    if $game_map.map_id != 0 

      

      # If exist a modified rate use it 

      if $game_system.moded_steps_counts[$game_map.map_id] != nil

        n = $game_system.moded_steps_counts[$game_map.map_id]

      # If not use bd one

      else

        n = $game_map.encounter_step

      end

      #p 'encounter fet, n', n

      @encounter_count = rand(n) + rand(n) + 1

    end

  end  

  

end

 
 
This is terribly written and hard to understand. I'll rewrite this for you.

gerrtunk":39ycbs8g said:
This script adds a lost feature from old RPG Makers: the "Change Combat Rate" command. It also lets you restart the combat rate.

You can contact me about bugs, suggestions, script compatibility or any other thing.

You can get the code in this simple webpage. I will be using this webpage from now on because it saves me a lot of time updating posts and other things.

http://usuarios.multimania.es/kisap/english_list.html

That being said, you are not following the posting template, hence, breaking the rules of this forum. Please refer to the following webpage to learn how to post a script properly (and not like a lazy bastard).

viewtopic.php?f=11&t=4113

EDIT: Also, it's a nice script and it seems well-enough documented.
 
thanks, im not english.
I didnt know about the template, i have posted 10 scripts without a word about it.

And im not lazy, i try to use my time in scripting rather tan doing teplates
 
gerrtunk":39nlwfv9 said:
And im not lazy, i try to use my time in scripting rather tan doing teplates
Oh, that's a good one! It's along the lines of "I'm paying attention to other cars instead of speed limit signs for safety!", or "No no, baby, I was with the other girl to figure out how to make YOU feel better! :grin: "

Lies. Also, your presentation is 75% of your script's success... that applies for everything, anywhere. The template is meant to help you with that, as it tries to create a standart that everyone knows how to read, which you are meant to design according to your own ideas if you have improvement suggestions.
Or, you can keep this style up and pretend to think that people will like it better.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top