Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - ArcaneAlchemy

1
Okay, so I am pretty damned good with computers, but admittedly I am seriously stumped. From being on this site for a while, I know that there are some very clever people here and hopefully you guys and girls can help. I have an Acer Aspire 7750G-9810. It's the i7, AMD HD 7670 2gb vram, 6gb ddr3 ect laptop. There is a usb 3.0 port and 2 regular 2.0 ports. The 3.0 port will work perfectly fine for a few minutes and then it stops working. I've noticed that it thinks that it still has the same device plugged in that was in when it stopped working. I had originally thought that it was perhaps burnt out from using my external sound card and plugging in my guitar amplifier, but that would not explain the fact that it consistently works EVERY time when the computer is restarted.

This totally sounds like a software issue, but I am completely at a loss. I have done all of the obvious troubleshooting like updating drivers and reinstalling drivers so that's not gonna help me at all. Also, I have never reinstalled my OS or used any foreign OS unless it was with VMware or VirtualBox.

Man, if anyone figured this out I will owe you something because it's really really pissing me off. Thanks in advance.
2
Dynamic Lights by Fabien 3.0(English)
Authors: Fabien
Version: 3.0
Type: Custom Lights
Key Term: Custom Environment System



Introduction

So this is not my script, but I I translated it and man was it an undertaking. Following finalholyknight's suggestion, I went ahead and decided to post this as a new topic. finalholyknight did already contact Fabien and got his permission to share it here. Fabien's contact info is in the script if you would like to contact him. I can help with most questions though since I have been messing with this script pretty intensely for the past few days though.

Fabien's permission to finalholyknight:

Spoiler: ShowHide



Features


  • Multiple dynamic lights on single map

  • Automatic lights on tiles of your choice

  • Permanently uncover dark areas by walking around a map

  • Show a secret view of a hidden map under a "fake" one.

  • Some really nice light images

  • Protect tile areas from being effected by lights

  • Emulate sunrise/sunset with opacity change of darkness overlay




Screenshots

Spoiler: ShowHide

Spoiler: ShowHide

Spoiler: ShowHide

Spoiler: ShowHide




Demo

http://s000.tinyupload.com/?file_id=32887480091240890860


Script

Multiple Scripts inside Demo



Instructions
TUTORIALS BELOW

To light yourself a torch/flashlight:

1. Go ahead and locate your picture that you want to use for your flashlight. If using the demo as a ..well ... demo then go ahead and make a note of the location in your folder called Graphics/Pictures/lumieres (lumieres means "lights" btw since I've been reading French for the past f-cking hour). If using the demo, you'll see a whole bunch of names.

2. Go ahead and choose one. I chose "lampe2" for my little flashlight/torch thing. It will work just fine for you too. It kinda looks like a torch or something.

3. Make a parallel process triggered event on a new map and paste in the following script:

wallpaper_night(240)
lum("lampe2",0,255)

Actually what they mean by that is they are taking an image and overlaying it to a closer z index on the screen. The picture is overlapping what is on the map.
the (240) is the opacity. You can change this if you'd like the 'darkness' aka. wallpaper_night to be more or less opaque.

so what about the lum("lampe2",0,255) part? Well it's pretty simple.
the "lum" stands for light. So I just think of the word 'light' or like lumination.
Inside the parenthesis it goes as follows:

lum("name_of_image",event_id,opacity)

the image I used was lampe2. The event_id of 0 is the main character sprite. Opacity is at max(255)

So that's how you get yourself a nice little torch. But what about all the other cool shit with the lamps lighting at the same time?

Here's where it really confused me. So, apparently, if you try to use more than one parallel process to illuminate lamps, the game will shit all over itself for no apparent reason. No matter how much French you learn in one day, it will still be more confusing and less telling than a creepy mime on the corner of the wine bistro.

HOW WE SET UP LIGHTS AND TORCH AT THE SAME TIME:(This is good for a flickering torch-like effect)

Here's the meat and potatoes:

1. If you followed my last rant, then you should already have the torch on your player. You will want to use A SINGLE parallel process for all of this, so I will go ahead and post in the script for both the player torch AND the lamp torches. Add this to a SINGLE event on a blank map. I suggest using a map texture set that has something that resembles a light or torch for visual satisfaction purposes only. In this map, make an event for your parallel process, and make three more for your lamps. I did mine like so:

Spoiler: ShowHide


here's the script:


wallpaper_night(240)
lum("lampe2",0,255)
lum("lampe2",1,255-rand(50))
lum("lampe2",2,255-rand(50))
lum("lampe2",3,255-rand(50))


You will notice a few things. Firstly, you will see the code for the original stuff. The first two lines make it dark and give your player a lamp(player = event #0) But if you look above, you'll know this. The next three lines are similar. The numbers after the "lampe2" part are the event id numbers. The other thing you will notice is that in the opacity section, it's set to 255-rand(50). This will create a flickering effect, essentially subtracting a random value of 0-49 of opacity.

Anyway, when you're all said and done, run it and it'll look like this:

Spoiler: ShowHide



HOW TO ILLUMINATE A TILE TYPE AND REPEAT WITHOUT ADDITIONAL SCRIPTING(like in example 2 in demo)

Please use the provided demo here to make this easy for the both of us.

This one really confused me for a bit but I figured it out and man I'm so freaking excited!  :D

Spoiler: ShowHide


Step 2. Add in a couple of lamps(take note of the coordinates of one of the tops of your lamps is located)VERY IMPORTANT

Spoiler: ShowHide


The tip of my lamp in in the picture is at (003,006) x=3 and y=6 *remember this part

Step 3. Set up a parallel process event like so:

Spoiler: ShowHide


Here is the code to put in there:

wallpaper_night(220)
lum_tile("lampadaire",3,6,1,255,-60,-16)

Firstly, there is the wallpaper_night(220). This is just to set up the darkness at 220 opacity.

Secondly there is the lum_tile() part and I will break down each section.
The overview is: lum_tile("name_of_light_picture",x_coordinate_of_tile, y_coordinate_of_tile, i_tile, opacity, image_x, image_y)

Phew, so let's look at these:

lum_tile() is the function that will help us do this awesome trick.
the "name_of_light_picture" is the image you're using. Located in Graphics/Pictures/lumieres.
i_tile is the map layer that your tile is on. 0 = layer 1, 1 = layer 2, 2 = layer 3.
the x_coordinate_of_tile part is the x location of a tile on your map. For instance, if it has a picture of a torch or the top of a light post, this is what you want
y_coordinate_of_tile part is the same as the x above, but applies to the y. Notice my x,y coordinates were 3,6 just like in the code. Make your coordinates work properly to suit your map
opacity is pretty basic and is a value from 0-255 as you probably know already.
image_x is just the x coordinate of the image you're using. move as needed
image_y is same as image_x above but y coordinate

Phew.

Step 4. Now that you've figured out where one lamp tip or torch flame should be at, use a proper picture. I used the "lampadaire" image for the lamp post because that's what it's made for.

If all goes well, you'll be able to post lamps over and over with no additional scripting and they will automatically be lit up. This effect will be more like a solid light. For a flickering effect, use this in opacity

255 - rand(50)     You don't have to use 50 in the rand, use whatever you want. you could even wait a few frames in the event to change the effect as well.

Hopefully you ended up with this:

Spoiler: ShowHide


This took a while so you are welcome! Cool Enjoy.

Compatibility

May have Scene_Map or screen tinting issues.


Credits and Thanks


  • Fabien for the awesome Script

  • finalholylight for putting it here and getting permission

  • ArcaneAlchemy(myself) for my obsession to figure this out




Author's Notes
3
Conditional Troop Encounters
Authors: ArcaneAlchemy
Version: 1
Key Term: Player / Party / Troop Add-on



Introduction

This little script is helpful if you want to easily add, remove, clear, or change a group of troops on
and given map. Maybe monsters get stronger at night, they are there until a mission is done, ect.
Pretty basic, but helpful for random battle maps.


Features


  • Change the Troops on a map based on conditions

  • Use and access pre-defined troop groups easily

  • Add, Remove, or Clear troops on the fly




No Screenshots Available



No Demo



Script
Spoiler: ShowHide

module Troop_Swap
 
module_function
#===============================================================================
# By ArcaneAlchemy
#
# * SCRIPT CALLS
 
  # clears the troop array and replaces it with a user provided troop preset.
  #     Troop_Swap.swap(list_index)
  #
  # clears the troops on the current map
  #     Troop_Swap.no_troops
  #
  #adds a troop on current map if it is not already included.
  #     Troop_Swap.add_troop(troop_id)
  #
  #deletes a troop on current map if it is included in the list
  #     Troop_Swap.del_troop(troop_id)
  #
  #lists the troops currently on the map by Troop ID #
  #     Troop_Swap.list_troops
 
#-------------------------------------------------------------------------------
  #Configure your pre-defined troop lists below.
  #Make sure to use Troop ID and not Enemy ID
  #
  #EXAMPLE: I want the troops 1, 2, and 3 in my preset. Since I already have
  #"1" taken, I'll make my list as follows:
  #
  # 2 => [1,2,3]
  #
  #   Assuming I want to test this out...
  #I can then make an event that calls the script as follows:
  #
  #     Troop_Swap.swap(2)
  #
  #This will swap out our newly defined troop list on the current map.
  #This setting will only last until returning to the map. You can ofcourse
  #easily make this redundant if needed with events.
 
  ALTERNATE_TROOP_LIST = {
  1 => [10,11,12]
  }
 
#===============================================================================
  #clears the troop array and replaces it with a user provided troop preset.
  def swap(list_index)
    $game_map.encounter_list.clear
    for i in 0..ALTERNATE_TROOP_LIST[list_index].size - 1
      $game_map.encounter_list.push ALTERNATE_TROOP_LIST[list_index][i]
    end
  end
 
  #clears the troops on the current map
  def no_troops
    $game_map.encounter_list.clear
  end
 
  #adds a troop on current map if it is not already included.
  def add_troop(troop_id)
    if $game_map.encounter_list.include? troop_id
    else
      $game_map.encounter_list.push troop_id
      $game_map.encounter_list.compact!
    end
  end
 
  #deletes a troop on current map if it is included in the list
  def del_troop(troop_id)
    if $game_map.encounter_list.include? troop_id
      $game_map.encounter_list.delete(troop_id)
    else
    end
  end
 
  #lists the troops currently on the map by ID #
  def list_troops
  a = $game_map.encounter_list

  a.each { |x| print(x) }
  end

end



Really doesn't change much so it should be compatible with anything.



Thanks to Chaos Project for all of the great scripts I use. Just trying to give back a little.



4
Animated Battle Result Window
Authors: Arcane Alchemy, Atoa(for exp graphic and exp bar script)
Version: 0.9
Type: Animated Battle Results
Key Term: Battle Add-on



Introduction

WHAT IS IT? Well, it's pretty basic, but it animates the gaining of experience in an additional window that takes the place of the old Battle_Results window. Anyway, here's a youtube video for a look at it.



Features


  • Better Battle Result Window

  • Animated Results

  • With Sounds

  • Conditional Items Gained Status w/Icons




Screenshots

No Screenshots. See Youtube link.


Demo

No Demo Available


Script

Spoiler: ShowHide

#==============================================================================
# ■ Arcane Alchemy's Battle Result Window
#==============================================================================
#Version 0.9?
#This script should be pretty compatible with most others.
#No configuration yet, I'll get to that at some point.
#
#==============================================================================
# ■ Features
#
# * Animated Exp Bar
# * Conditional Items Dropped Section
# * Level up sound and text
# * Not much really, but I like it.
#
#==============================================================================
# ■ CONFIGURATION
#
# set to false by default. If not using ATOA_HP/SP bars, it will make
# your experience numbers just go apeshit so it's not suggested unless
# you're gonna code it yourself.
 USING_ATOA_HP_SP_BARS = false
 
# you can adjust this to your liking. The bigger the number, the faster
# the speed. This is pretty close to what you'd want it though but, yeah.
 EXP_GAIN_SPEED = 0.005
 
# if for some reason you don't want to press a button to make the exp points
# animate, then go ahead and set this to true.
 ANIMATE_WITHOUT_BUTTON = false
#==============================================================================
# * Work in progress. Need to do some more debugging to be sure.
#==============================================================================
# ■ This part is originally Atoa's EXPMeter
#==============================================================================
#Atoa should get credit for this part. I wasn't in the mood to make my own bars
#so these are his. If you are using his script, then this part down to
#END ATOA's EXP BAR can be omitted/commented out/deleted.

if USING_ATOA_HP_SP_BARS == false
 $exp_meter = 'EXPMeter'
 $exp_pos_adjust = [0, 8]
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
 #--------------------------------------------------------------------------
 def now_exp
   return @exp - @exp_list[@level]
 end
 #--------------------------------------------------------------------------
 def next_exp
   return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
 end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
 def draw_actor_exp(actor, x, y)
   bar_x = $exp_pos_adjust[0] + x
   bar_y = $exp_pos_adjust[1] + y + (Font.default_size * 2 /3)
   @skin = RPG::Cache.windowskin($exp_meter)
   @width  = @skin.width
   @height = @skin.height / 3
   src_rect = Rect.new(0, 0, @width, @height)
   self.contents.blt(bar_x, bar_y, @skin, src_rect)    
   @line   = (actor.now_exp == actor.next_exp ? 2 : 1)
   @amount = (actor.next_exp == 0 ? 0 : 100 * actor.now_exp / actor.next_exp)
   src_rect2 = Rect.new(0, @line * @height, @width * @amount / 100, @height)
   self.contents.blt(bar_x, bar_y, @skin, src_rect2)
 end
end

end #end if USING_ATOA_HP_SP_BARS contidition.
#==============================================================================
# ■ END ATOA's EXP BAR
#==============================================================================

class Window_Base < Window

 def draw_actor_level_up(actor, x, y)
   self.contents.font.color = Color.new(255, 50, 50)
   #cx = contents.text_size("Level Up!").width
   self.contents.draw_text(x + 160, y + 32, 64, 32, "Level Up!")
   Audio.se_play("Audio/SE/056-Right02", 90)
 end

end#endclass
#==============================================================================
# ** Window_BattleResult
#------------------------------------------------------------------------------
#  This window displays amount of gold and EXP acquired at the end of a battle.
#==============================================================================
class Scene_Battle
 $start_exp_animation = false
 $close_exp_anime_window = false
 $play_exp_sound = 0
 $draw_new_level = false
 $draw_level_up = [false, false, false, false]
 
 alias animate_exp_start_phase1 start_phase1
 def start_phase1
   animate_exp_start_phase1
   
   #pushing/storing exp values in an array at beginning of battle
   $anim_exp_old_value = []
   $current_level_old_value = []
   
   for i in 0...$game_party.actors.size
     actor = $game_party.actors[i]
     $anim_exp_old_value.push(actor.exp)
     $current_level_old_value.push(actor.level)
   end
 end

 alias custom_start_phase5 start_phase5
 def start_phase5
  custom_start_phase5

 
 #Figuring out the gained exp value for each character.
  $gained_exp = 0
  for enemy in $game_troop.enemies
    $gained_exp += enemy.exp
  end

    #Temporarily making the exp the old value
   for i in 0...$game_party.actors.size
     actor = $game_party.actors[i]
     actor.exp = $anim_exp_old_value[i]

   end
   
   #if using ATOA ATB Script, this will remove the bars in the battle result
   #window.
  if defined? self.remove_bars
  remove_bars#for removal of Atoa ATB bars in battle result window
  end

   @status_window.z = 0
   
end#end start_phase5
 
 def update_phase5

   # If wait count is larger than 0
   if @phase5_wait_count > 0
     # Decrease wait count
     @phase5_wait_count -= 1
     # If wait count reaches 0
     if @phase5_wait_count == 0
       # Show result window
       @result_window.visible = true
       # Clear main phase flag
       $game_temp.battle_main_phase = false
       @status_window.visible = false
       $game_party.clear_actions
       
     end
     return
   end
   for i in 0...$game_party.actors.size
     x = 64
     y = i * 110
     actor = $game_party.actors[i]
     @result_window.draw_actor_exp(actor, x + 60, y + 64)
       if actor.level == $current_level_old_value[i]
         if $draw_new_level == false
           $draw_old_level_once = true
         @result_window.draw_actor_level(actor, x + 60, y + 32)
         elsif $draw_old_level_once == true
         end
       elsif actor.level > $current_level_old_value[i]
         $draw_level_up[i] = true
         $draw_new_level = true
         @result_window.refresh
         $current_level_old_value[i] = actor.level
       end
     end
       if ANIMATE_WITHOUT_BUTTON == true
         $start_exp_animation = true
       elsif ANIMATE_WITHOUT_BUTTON == false
         # If C button was pressed
         if Input.trigger?(Input::C)
         $start_exp_animation = true
         end
       end
 
   if $start_exp_animation == true
   #animate the exp growth
       for i in 0...$game_party.actors.size
        actor = $game_party.actors[i]
          if actor.cant_get_exp? == false
            if @result_window != nil

              if actor.exp < ($anim_exp_old_value[i] + $gained_exp)
               actor.exp += ($gained_exp * EXP_GAIN_SPEED)
               $play_exp_sound += 1
                if $play_exp_sound == 10
                  $game_system.se_play($data_system.cursor_se)
                  $play_exp_sound = 0
                end
              end
            end
         
            if actor.exp >= ($anim_exp_old_value[i] + $gained_exp)
              actor.exp = ($anim_exp_old_value[i] + $gained_exp)
              $start_exp_animation = false
              $close_exp_anime_window = true
            end
          end
       end
   end
   
   if Input.trigger?(Input::C)
     if $close_exp_anime_window == true
       #Battle ends
       battle_end(0)
       $close_exp_anime_window = false
     $draw_new_level = false
     $draw_level_up = [false, false, false, false]
     end
   end
   
 end#end phase5 update
end#end of class here
class Window_BattleResult < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #     exp       : EXP
 #     gold      : amount of gold
 #     treasures : treasures
 #--------------------------------------------------------------------------
 def initialize(exp, gold, treasures)
   @exp = exp
   @gold = gold
   @treasures = treasures
   super(0,0,640,480)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.back_opacity = 200
   self.z = 101
   self.visible = false
   refresh
 end

 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------

 def refresh
   self.contents.clear
   
   x = 300
   self.contents.font.color = normal_color
   cx = contents.text_size(@exp.to_s).width
   self.contents.draw_text(x + 140, 0, cx, 32, @exp.to_s)
   x += cx + 4
   self.contents.font.color = system_color
   cx = contents.text_size("EXP").width
   self.contents.draw_text(x, 0, 64, 32, "EXP")
   #x += cx + 16
   self.contents.font.color = system_color
   self.contents.draw_text(x, 40, 128, 32, $data_system.words.gold)
   x += cx + 4
   self.contents.font.color = normal_color
   cx = contents.text_size(@gold.to_s).width
   self.contents.draw_text(x + 32, 40, cx, 32, @gold.to_s)
   y = 64  
   if @treasures.size > 0
   self.contents.font.color = Color.new(255, 255, 100)
   cx = contents.text_size("Dropped Items: ").width
   self.contents.draw_text(x - 30, y - 20, 128, 180, "Dropped Items: ")
   end
   for item in @treasures
     draw_item_name(item, 300, y + 90)
     y += 32
   end
   
   for i in 0...$game_party.actors.size
     x = 64
     y = i * 110
     actor = $game_party.actors[i]
       if $draw_level_up[i] == true
         #print($draw_level_up[i].to_s)
         draw_actor_level_up(actor, x, y)

       end
     draw_actor_graphic(actor, x - 40, y + 80)
     #draw_actor_face(actor, x - 40, y + 80)
     draw_actor_name(actor, x + 60, y)
     if $draw_new_level == true
       draw_actor_level(actor, x + 60, y + 32)    
     end

   end
 end
end



Instructions

Step 1. Just paste this script above main, below built-in scripts, and below other custom scripts that alter the battle_result window.

Step 2. Save the image below as EXP_Meter.png.
Place the EXP_Meter picture in the /Graphics/Windowskins folder.



If using ATOA HP/SP Bars script, make sure and set the USING_ATOA_HP_SP_BARS = true.
That's about all there is to configure for now. Also, if using face graphics in place of the characters, you can overwrite the draw_actor_graphic(actor, x - 40, y + 80) with a "draw_actor_face(actor, x - 40, y + 80)" method or any other graphic drawing method
that inherits the Window_Base class.


Compatibility

As far as compatibility, this script should be compatible with most scripts. If there are any that alter the appearance if Exp bars, then that could cause an issue.


Credits and Thanks:
Thanks to ATOA for the really cool exp_bar graphic.


  • This script uses ATOA's HP/SP script for the exp bar graphic.




Author's Notes

  • Added a ANIMATE_WITHOUT_BUTTON option for PhoenixFire

5
Resources / Cool Place for Public Domain SoundFX
December 07, 2013, 11:42:21 am
Note that not every sound on here is public domain, but there are more than enough for your whole game that are probably.
Just make sure and hover over a little area on the right of the sound to determine the rights associated with the file.

This link goes to some sword sounds. http://www.freesound.org/people/qubodup/packs/12143/
6
Express your Creativity / My best work yet
September 07, 2013, 10:33:18 am
This is a song for a character named Scarlett in my game. She is a virtuoso musician in a popular band. This is for the scene when she is playing for an audience. She uses a bow because she is a musician and she can pluck strings really well. Anyway, I thought it was a pretty cool idea. Surely my best yet. Let me know what you think.

http://www.youtube.com/watch?v=hkYEtEVZjss&feature=youtu.be
8
Express your Creativity / Ken Stage Guitar Song
July 27, 2013, 12:23:32 am
Ah, so I haven't messed around with any video game music covers in a while and thought I'd give it a shot. I figure everyone on here will know the song so give it a listen.
http://www.youtube.com/watch?v=kf_ay0op2Eg&feature=youtu.be
9
This is done with all guitars and it is one of my favorite RPG songs ever. The last part has strings and beat, but the rest is all done by hand :)

http://www.youtube.com/watch?v=g8KqbpqyCBI&feature=youtu.be

Tell me what you think about it.
10
Sorry, I know that I already put up a million songs, but this one deserves special attention. I really like this and I think it would be good for like an 'awakening' type thing. Maybe you get an airship, or you find some crystals or something. Anyway, this is a rough draft but please feel free to let me know what to do to make it better, thanks :)

http://www.youtube.com/watch?v=Vw4WQ2I5BEQ&feature=youtu.be
11
Express your Creativity / A couple more songs
January 17, 2013, 10:45:54 am
Since I keep putting music on here, I think I'll just edit this one to save room. Anyway, here's a couple more for now for anyone who wants to listen.

http://www.youtube.com/watch?v=eit0EmQRkos Evil classical: Kinda like an intro made of a few little mini-themes. But it's fun.

http://www.youtube.com/watch?v=Mu6ROJJKa-E Love Coil: A rock song I wrote for my band a while back. Fruity Drums and Bass, real guitar and singing. (no robots.. :(  )

http://www.youtube.com/watch?v=7Jc2OFjBCm0: Port town? Not sure where this fits, but whatever here it is.

http://www.youtube.com/watch?v=_4yF94PGQwg&feature=youtu.be Zelda song minor rendition: Remember how when you lost a chocobo race in ff7 and it did the minor rendition of the fanfare?
This is like that but with the zelda song.

http://www.youtube.com/watch?v=57_wx1MR7wU "Classical Mullet" This is a baroque thing that I did, at the end there is another song idea. It's really cool. Think Shinra Tower song.
12
Express your Creativity / My RPG Farm theme on guitar
January 16, 2013, 09:41:21 am
Here is a farm/town theme on guitar. If anyone wants to use it, just let me know and I'll send you a copy. I might elaborate a bit more on it, but this
is just the basic progression with a nice peaceful melody.

http://www.youtube.com/watch?v=6Vatb5Kzc4U&feature=youtu.be
13
Just random, but I think you'll like the video/pic/song lol.

http://www.youtube.com/watch?v=63N-KTY2dis&feature=youtu.be

oh yeah, it's me playing. Don't hate because of the crap mic. This was like 2 years ago.
14
I am sure that I have seen something about a continuous BGM before but I was wondering if there was a good way to return to the BGM where it left off after a battle. I am a ruby programmer, so I would prefer a RGSS scripting based answer and I would imagine that in this case, it would probably have to be. Anyway, I am thinking of something like a pause feature, but I am not sure how to do that or how to initiate the music again as soon as the scene returns to the map. Anyway, I know there is a ninja on here that will figure it out faster than me so thanks in advance :). If I figure it out before that though, I'll go ahead and post it here
15
Welcome! / Hey everybody
January 11, 2013, 06:17:53 pm
I just posted my first script on here yesterday although I have been kinda hanging in the shadows for a while and just learning everything I can from some really smart and creative people. I am glad that I can finally give back to the community. So, this is my official hello to everyone and I am glad to be a part of this awesome site. :)
16
RPG Maker Scripts / Custom Low Stats Battle Algorithm
January 11, 2013, 09:56:10 am
#------------------------------------------------------------------------------
If you were looking for something similar to that of Final Fantasy IV or VI, then this is gonna get you pretty close without having to decrypt and encrypt the database which can be really taxing after while. The damage is based on player and enemy level, as well as a few other things which create a nice smooth dynamic while keeping the stats low. There are a few other features in this script that will help out or you might just use them on their own.

Features include:



  • Custom Algorithm

  • Static Evasion Setting per class

  • Magic Evasion

  • Stamina instead of retarded dexterity attribute

  • Fixed critical damage for enemies and players

  • Capped damage

  • Custom Hp/Sp curve generation

  • Set Static enemy levels

  • Enemies Adapt To Average Party Level(think Skyrim/Oblivion)

  • A few debug tools






Anyway, this is my first script on here, so let me know if I need to do more or help anything look better.

Static STATS

# There are a few important things to note about this script. The default  setup of this script will work well with static settings for str, int, dex, agi, and evade. This means that when you use the database, in the Actors tab, double-click on each of these attributes(except for evade, that comes later) and select the 'generate curve' option. From the ranges of level 1 to level 99,
you should set the values to be the same on both ends. This means that only  weapons, armor, items, and level will increase.

Spoiler: ShowHide


HP/SP Curve

The next point to note is that if you are using the HP/SP curve generation, you will want to note that your HP/SP inside the database
will be completely useless. This was based on FF6 and how every character started with a "bonus" hp/mp and progressed based on the same
curve for all characters. If this is shut off, then the database will take over this setting. You will find the array for each curve value inside the script.

Setting the Static EVA

Look familiar? Yeah, again based on FF6 algorithm...well except for that fact that this ACTUALLY WORKS. Can't win 'em all Square. So, you will just have to set these values statically in the array here. Each array index corresponds with the index of the classes. So, class 1(Fighter) has 20 evade%, class 2(Lancer) has 50% evade and class 3(Warrior) had 100% evade.

001: Fighter
002: Lancer
003: Warrior


   $static_eva_percentage = [20,50,100]


Setting Enemy Level

In order to keep from having to modify data files, I decided to let the user add the enemy level by appending it to the enemy name in the enemy list inside the database. Since there is no 'level' attribute, this seemed like the best way I could think of so that you don't have to encrypt/decrypt over and over and over. It's not that tricky, but it does need explaining.
So, for instance if you want to make a vampire at level 1, you would name it:

vampire_01

Spoiler: ShowHide


Notice the underscore between the name and the level number. Also take equal note of the zero before the 1.
You must put both an underscore and two decimal places. For level 1 it's _01 for level 6, it's _06 like the thief below:

Spoiler: ShowHide


Now, here is an example of a level 99 bat:

Spoiler: ShowHide


Well, that's about it. Everything else should be in the script. Enjoy!

Here is the code:


#------------------------------------------------------------------------------
#
#                  ***** Customized Battle Algorithm *****
#
#------------------------------------------------------------------------------
#
# There are a few important things to note about this script. The default
# setup of this script will work well with static settings for str, int, dex,
# agi, and evade. This means that when you use the database, in the Actors tab,
# double-click on each of these attributes(except for evade, that comes later)
# and select the 'generate curve' option. From the ranges of level 1 to level 99,
# you should set the values to be the same on both ends. This means that only
# weapons, armor, items, and level will increase. Also, by the default system,
# something like unarmed combat will be based on the static str value and level
# at the time. You can find the actual modification below, but it looks like
# this:
#
#   self.damage = atk * (20 + attacker.str) / 20 * attacker.level / 2
#
# As you might notice, this also applied to the enemy. The enemy does not have
# a level attribute by default, this is why when naming an enemy, it is VERY
# VITAL that you append the enemy's name with the level value. This will have
# a great bearing on how strong or weak the enemy will be. So, naming a few
# enemies would look like this:
#
#  ** (NOTICE LEVELS 1 - 9 NEED A "0" BEFORE THE SINGLE DIGIT) **
#
#   slime_01 <= Level one slime
#
#   vampire_09 <= Level 9 vampire
#
#   boss_23 <= Level 23 boss

#   ** Make sure and DON'T FORGET THE UNDERSCORE! "_" **
#
# How high you set the level is ultimately up to you, but keeping the levels
# close to your party average is a relatively good gauge because of the level's
# impact on the attacker's strength. Also, this will only read between levels
# 1 - 99. If you want to use 3 digit levels, it's a pretty easy fix. I wouldn't
# suggest the damage cap at 9999 for that however..

# One last thing, dexterity is stamina now if you want it to be. So, you can use
# it like FF6 stamina of you want to and make instant death spells and what not
# be effected by it. It is against a rand(127) number right now but you can
# easily change that.
#
#       I will give detailed step by step instructions below.
#------------------------------------------------------------------------------
#                             Compatibility
#------------------------------------------------------------------------------
#
# This script will be compatible with anything that hasn't changed the name
# of attributes on any of the data. So,

#
#------------------------------------------------------------------------------
#                             Debug
#------------------------------------------------------------------------------
# To view your evade run: Custom_Algo_Debug.show_player_evade
#
# To view your enemy level, make a common event and put this script inside it.
#
#   Custom_Algo_Debug.show_enemy_levels
#
# Then, create an item and call it "Debug". Have the item run the common event
# you just created during battle. This will list the enemy levels to make sure
# that everything is running smoothly.
#------------------------------------------------------------------------------
#                           Configuration
#------------------------------------------------------------------------------
# This is where you can customize the following elements:
#
# - Set enemy level
# - Set a Damage Cap
# - custom hp/sp growth curve
# - custom static evasion % attribute
# - custom static magic evade % attribute for starting char and armors
# - "stamina" attribute replaces retarded dexterity attribute.
# - Enemies Adapt To Average Party Level(think Skyrim/Oblivion)
#
#
#------------------------------------------------------------------------------
# SET ENEMY LEVEL BY NAME
#
# To set enemy level by name, put the enemy name in the database followed by
# an underscore and the two-digit level number. There is a detailed explanation
# above, but here is a quick example anyway.
# slime_09 = slime, level 9
# vampire_23 = vampire, level 23
#
  SET_ENEMY_LEVEL = true #use this to turn on and off.
  #CANNOT BE USED WITH ADAPTIVE ENEMY LEVEL!!!!!!!
#
# if set to false, the enemy level will default to 1. DO NOT MIX WITH
# ADAPTIVE_ENEMY_LEVEL switch!!! If so, you will see a warning and the game will
# not run properly and return to default settings.
#------------------------------------------------------------------------------
# ADAPTIVE ENEMY LEVEL
#
  ADAPTIVE_ENEMY_LEVEL = false #turn this on and off here.
  #CANNOT BE USED WITH SET_ENEMY_LEVEL!!!!!!!!!!!!
 
# This will make each enemy level adapt to your party average.
# I will be adding a random variance feature in the near future.
#------------------------------------------------------------------------------
# CAP DAMAGE
#
# To set a damage cap so that anything (< or = x) will be at a cap_damage_limit
#
CAP_DAMAGE = true  #set to false to turn off or true to turn on.

CAP_DAMAGE_LIMIT = 9999 # the number to cap the damage at.
#------------------------------------------------------------------------------
# CUSTOM BASE HP/SP and GROWTH CURVE

  SET_HP_SP_GAIN_CURVE = true #to turn this feature on and off.

#This is to set your starting HP/SP. The elements are referenced by class_id.
#There should be as many elements as there are classes in your game. You can
#easily add an element by adding a value and seperating it with a comma. I
#would suggest setting a base hp and mp at the same time, otherwise it will
#default to the database.
# If you choose to use this, it will override the
# database hp and sp values and they will be rendered useless.
 
  $custom_max_hp_base = [40, 50, 60,20,30,40,30,40]
 
  $custom_max_sp_base = [16, 50, 60, 20,30,40,30,20]
 
# This is to set the growth speed. Each element represents what is added to
# the max hp/sp after a level up. Each array element corresponds to its level.
# NOTICE the first element is a ZERO. KEEP THE FIRST ELEMENT A ZERO or you will
# possibly break stuff.
 
  $custom_level_growth_hp = [0,11,12,14,17,20,22,24,26,27,
  28,30,35,39,44,50,54,57,61,65,
  67,69,72,76,79,82,86,90,95,99,
  100,101,102,102,103,104,106,107,108,110,
  111,113,114,116,117,119,120,122,125,128,
  130,131,133,134,136,137,139,142,144,145,
  147,148,150,152,153,155,156,158,160,162,
  160,155,151,145,140,136,132,126,120,117,
  113,110,108,105,102,100,98,95,92,90,
  88,87,85,83,82,80,83,86,88]

  $custom_level_growth_sp = [0,5,6,7,8,9,10,11,12,13,14,15,16,17,17,17,17,16,16,16,15,15,15,14,14,14,14,13,13,13,13,12,12,12,12,11,11,11,11,11,11,10,10,10,10,10,10,10,10,9,9,9,9,9,9,9,9,9,9,10,8,8,8,8,8,8,8,8,8,8,10,10,7,6,5,4,5,6,7,8,9,8,7,6,5,6,7,5,6,7,8,9,10,8,8,9,10,11,13]
#------------------------------------------------------------------------------
# CUSTOM STARTING/STATIC EVA PERCENTAGE

  SET_STATIC_EVADE = true #put false to turn this feature off.
 
# This will set a constant eva value for each class that will be there without
# weapons or armor. Weapons and armor will still add a bonus accordingly.
# Each element in the array is referenced by class_id. To add an element,
# simply add another value seperated by a comma as shown below.

    $static_eva_percentage = [0,0,0,0,0,0,0,0]
   
#------------------------------------------------------------------------------
#Works the same way as Static EVA for setting by class
#
# to set the magic evade for armor, weapon, or item by id.. fill in the
#corresponding value in the array created for the value below. Armor with the
# id of 2 should have the 2nd array value filled with its mag eva amount.
SET_STATIC_MAGIC_EVADE = true

$static_mag_eva_percentage_for_actor_by_class_id = [0,0,0,0,0,0,0,0]

$set_mag_eva_for_armor_by_id = [0, #leave as is, refers to nothing. Filler num. 
90, 0, 0, 0, 0, 0, 0, 0, 0, 0, #  1 - 10
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 11 - 20
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 21 - 30
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 31 - 40
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 41 - 50
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 51 - 60
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 61 - 70
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 71 - 80
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 81 - 90
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 91 - 100
] #End mag evade for armor database entry.

$set_mag_eva_intf_for_skill_by_id = [0, #leave as is, refers to nothing. Filler num. 
0, 0, 0, 0, 0, 0, 100, 0, 0, 0, #  1 - 10
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 11 - 20
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 21 - 30
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 31 - 40
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 41 - 50
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 51 - 60
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 61 - 70
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 71 - 80
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 81 - 90
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 91 - 100
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 101 - 110
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 111 - 120
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 121 - 130
] #End mag evade for skill database entry.

$set_mag_eva_percentage_for_enemy_by_id = [0,
50, 0, 0, 0, 0, 0, 0, 0, 0, 0, #  1 - 10
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 11 - 20
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 21 - 30
0, 0, 0, 0, 0, 0, 0, 0, 0, 55, # 31 - 40
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 41 - 50
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 51 - 60
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 61 - 70
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 71 - 80
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 81 - 90
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, # 91 - 100
] #End mag evade for enemy database entry.
#------------------------------------------------------------------------------
#                         Suggestions / Notes
#------------------------------------------------------------------------------
#
# My notes/suggestions
#-------------------------------------------------------------------------------
# DEXTERITY IS POINTLESS - as of now, it is worth jack shit.
#
#Physical Attack Addition:
#
# Much like some FF games, the level plays a part in the progression.
#
# Here is the physical attack formula:
#
#      self.damage = atk * (20 + attacker.str) / 20 * attacker.level / 2
#
#
#-------------------------------------------------------------------------------
# PHYSICAL ATTACKS:

# Physical Attack vs. Physical Defense

# 1. Physical defense that is 200% of Attack yields   0% damage.
# 2. Physical defense that is 150% of Attack yields 25% damage.
# 3. Physical defense that is 100% of Attack yields 50% damage.
# 4. Physical defense that is   50% of Attack yields 75% damage.
# 5. Physical defense that is   1% of Attack yields 100% damage.
#------------------------------------------------------------------------------
# CRITICAL PERCENTAGES:

#Attacker Dexterity vs. Defender Agility

# 1. if agility is same as dex, critical% = 4
# 2. if agility is 1/2 of dex, critical% = 8
# 3. if agility is 1/4 of dex, critical% = 16
# 4. if agility is 1/8 of dex,  critical% = 32
# 5. and so on..
#------------------------------------------------------------------------------
# EVADE PERCENTAGES:

#Evade pretty much stays the same regardless of Dexterity.

# Evade value = rough percentage of chance to evade attack.
#------------------------------------------------------------------------------
# SKILL POWER BREAKDOWN:

#we are using:
# power * rate / 20 * user.level / 2

#Skill power with no -F(forces) added is exactly (power *  level / 2)
#------------------------------------------------------------------------------
# MAGIC BASED ATTACKING SKILLS:

#Attack Skills with INT-F added:

#For magic, I suggest using a INT-F setting of 50.

# 1. Skill power with INT-F of 100% yields a degradation of 1/6 per 10
#  attribute points.
# 2. Skill power with INT-F of 50% yields a degradation of 1/8 per 10
#  attribute points.
# 3. Skill power with INT-F of 25% yields a degradation of 1/10 per 10
#  attribute points.
#------------------------------------------------------------------------------
# PHYSICAL BASED ATTACKING SKILLS:

#For skills that slightly strenghthen attacks do the following, or something
#close to it:

#Power = 10
#ATK-F = 100
#EVA-F = ? If you want them to be evaded possibly, then set to 100.
#STR-F = 100
#DEX-F = 0
#INT-F = 0
#Hit Rate = ? This is useless if set_static_evade = true
#PDEF-F = 100
#MDEF-F = 0
#Variable = 15
# This type of setting is good for skills that grow with the player.
#  They will be a bit strong at first, but  they won't become obsolete quickly
#  or at all like in a lot of games.

# If you desire a more tier style layout, try laying off of the ATK-F and maybe
#  the PDEF-F as well...
#------------------------------------------------------------------------------
# HEALING BASED SKILLS
#
# Healing Skills will render almost exactly the same negative damage(Healing)
# as an attacking spell will render with positive damage(attack). This is
# obviously taking into account that the INT-F is the same in both cases.
#
#------------------------------------------------------------------------------
# INSTANT DEATH SKILLS
# Set the dextertity INT-F to anything above 100, it doesn't matter. This will
# take dexterity/"stamina" into account and run a lottery aganst the value of
# the recipient's dexterity/"stamina". Make sure you set this to something
# between 0 - 60 for any character. 60 = about 50% chance of being effected
# before any state efficiency has been added.
#
#
#-------------------------------------------------------------------------------
# Minimum and Maximum ranges for stuff:

#Mininum would be someone weaker with a certain attribute like INT for a knight
#or STR for a wizard.
#Max is opposite. I'm sure there's not much need for explanation here, but these
#are to be static values with the exception of ATK, Hitpoints, and Skill Points.

# Battler stats:

#Attack - min = 3 / max = 255 or more but 255 is pretty good.

#Str - min 12 / max = (maybe around 40 - 50)

#Def - min 1 / max = shoot for around 200 or so.

#Dex - min around 15 / max around 60 #will protect from instant death if that
#setting is used. 60 = about a 50% chance of success of instant death, ect.

#Agility - min around 20 / max around 40

#Evade - min around 3-5 / max around 15 to 21

#Intelligence - min around 25 / max around 40

#Hit points level 1 min - 40 - 60 / max 6000 - 8000(we could use accesories to
#add bonus at level up)

#Skill points level 1 min - 9 to 16  / max 400 - 600 (we could use accessory to
#add at level up)
#------------------------------------------------------------------------------
  #
  # Do not edit the code below unless you know what you're doing.
  #
###############################################################################
#                          **** CODE BELOW ****
###############################################################################

#------------------------------------------------------------------------------
#                Game Battler part 3
#------------------------------------------------------------------------------
class Game_Battler


  #--------------------------------------------------------------------------
  # * Applying Normal Attack Effects
  #     attacker : battler
  #--------------------------------------------------------------------------
  def attack_effect(attacker)
    # Clear critical flag
    self.critical = false
    # First hit detection
    hit_result = (rand(100) < attacker.hit)
    # If hit occurs
    if hit_result == true
      # Calculate basic damage
      atk = [attacker.atk - self.pdef / 2, 0].max
                                            ###### Mod by Level Here
      self.damage = atk * (20 + attacker.str) / 20 * attacker.level / 2
      # Element correction
      self.damage *= elements_correct(attacker.element_set)
      self.damage /= 100
      # If damage value is strictly positive
      if self.damage > 0
        ###################################################
        # Critical correction
        #if rand(100) < 4 * attacker.dex / self.agi ORIGINAL
       
        if (rand(32) + 1) == 1
          self.damage *= 2
          self.critical = true
        end
        ###################################################
        # Guard correction
        if self.guarding?
          self.damage /= 2
        end
      end
      # Dispersion
      if self.damage.abs > 0
        amp = [self.damage.abs * 15 / 100, 1].max
        self.damage += rand(amp+1) + rand(amp+1) - amp
      end
      # Second hit detection
      #eva = 100
      #############################################
      #eva = 8 * self.agi / attacker.dex + self.eva
      # evasion correction:
     
      eva = self.eva
      #############################################
     
      hit = self.damage < 0 ? 100 : 100 - eva #ternary operator if true 100, if
      #false, 100 - eva.
      hit = self.cant_evade? ? 100 : hit
      hit_result = (rand(100) < hit)
    end

    #######################################
    # Damage Cap #
    ##############
    if CAP_DAMAGE == true
     
      if self.damage >= CAP_DAMAGE_LIMIT
        self.damage = CAP_DAMAGE_LIMIT
      end
    end  #### End damage Cap
    ########################################
    # If hit occurs
    if hit_result == true
      # State Removed by Shock
      remove_states_shock
      # Substract damage from HP
      self.hp -= self.damage
      # State change
      @state_changed = false
      states_plus(attacker.plus_state_set)
      states_minus(attacker.minus_state_set)
    # When missing
    else
      # Set damage to "Miss"
      self.damage = "Miss"
      # Clear critical flag
      self.critical = false
    end
    # End Method
    return true
  end
 
 
# End Physical Attack mod






  #--------------------------------------------------------------------------
  # * Apply Skill Effects
  #     user  : the one using skills (battler)
  #     skill : skill
  #--------------------------------------------------------------------------
  def skill_effect(user, skill)
    ##########################
    stamina = self.dex
    #renaming skill.dex_f to stamina
    ##########################
   
   
    # Clear critical flag
    self.critical = false
    # If skill scope is for ally with 1 or more HP, and your own HP = 0,
    # or skill scope is for ally with 0, and your own HP = 1 or more
    if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
       ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
      # End Method
      return false
    end
    # Clear effective flag
    effective = false
    # Set effective flag if common ID is effective
    effective |= skill.common_event_id > 0
    # First hit detection
    hit = skill.hit
    if skill.atk_f > 0
      hit *= user.hit / 100
    end
    hit_result = (rand(100) < hit)
    # Set effective flag if skill is uncertain
    effective |= hit < 100
    # If hit occurs
    if hit_result == true
      # Calculate power
       power = skill.power + user.atk * skill.atk_f / 100
      if power > 0
        power -= self.pdef * skill.pdef_f / 200
        power -= self.mdef * skill.mdef_f / 200
        power = [power, 0].max
      end
      # Calculate rate
      rate = 20
      rate += (user.str * skill.str_f / 100)
      #######################################
      #rate += (user.dex * skill.dex_f / 100) #removed because it's pointless
      #rate += (user.agi * skill.agi_f / 100) #removed because it's pointless
      # and this would mess with the dexterity = stamina thing.
      #######################################
      rate += (user.int * skill.int_f / 100)
      # Calculate basic damage
      self.damage = power * rate / 20 * user.level / 2 ######## level mod
      # Element correction
      self.damage *= elements_correct(skill.element_set)
      self.damage /= 100
      # If damage value is strictly positive
      if self.damage > 0
        # Guard correction
        if self.guarding?
          self.damage /= 2
        end
      end
      # Dispersion
      if skill.variance > 0 and self.damage.abs > 0
        amp = [self.damage.abs * skill.variance / 100, 1].max
        self.damage += rand(amp+1) + rand(amp+1) - amp
      end
      # Second hit detection
     
      #########################################################
      #eva = 8 * self.agi / user.dex + self.eva
      #
      # MAG EVA AND EVA CORRECTION
      # Setting eva = eva % and mag_eva = mag_eva %
      eva = self.eva
      mag_eva = self.mag_eva
     
      if skill.eva_f > 0
        hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
       
      else
        hit = self.damage < 0 ? 100 : 100 - mag_eva * skill.mag_eva_int_f / 100
       
        ########################
        #dexterity = stamina. If this is the case, this is for attacks blocked
        #by stamina. This is for attacks that are like 'death' attacks and 'demi'
        # and such.
        if skill.dex_f > 0
          if rand(127) <= self.dex
            hit = 0
          end
        end
       
      end
      ###########################
     
      #hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100 #ORIGINAL
      ##########################################################
     

      hit = self.cant_evade? ? 100 : hit
      hit_result = (rand(100) < hit)
      # Set effective flag if skill is uncertain
      effective |= hit < 100
    end
    # If hit occurs
    if hit_result == true
     
      #######################################
    # Damage Cap #
    ##############
    if CAP_DAMAGE == true
     
      if self.damage >= CAP_DAMAGE_LIMIT
        self.damage = CAP_DAMAGE_LIMIT
      elsif self.damage < (CAP_DAMAGE_LIMIT * -1)
        self.damage = (CAP_DAMAGE_LIMIT * -1)
      end
    end  #### End damage Cap
    ########################################
   
      # If physical attack has power other than 0
      if skill.power != 0 and skill.atk_f > 0
        # State Removed by Shock
        remove_states_shock
        # Set to effective flag
        effective = true
      end
      # Substract damage from HP
      last_hp = self.hp
      self.hp -= self.damage
      effective |= self.hp != last_hp
      # State change
      @state_changed = false
      effective |= states_plus(skill.plus_state_set)
      effective |= states_minus(skill.minus_state_set)
      # If power is 0
      if skill.power == 0
        # Set damage to an empty string
        self.damage = ""
        # If state is unchanged
        unless @state_changed
          # Set damage to "Miss"
          self.damage = "Miss"
        end
      end
    # If miss occurs
    else
      # Set damage to "Miss"
      self.damage = "Miss"
    end
    # If not in battle
    unless $game_temp.in_battle
      # Set damage to nil
      self.damage = nil
    end
    # End Method
    return effective
   

   
  end #end skill effect method
 

   
  #End Skill Effect mod
 
end ##end game battler class
#------------------------------------------------------------------------------
#               End of Game Battler part 3
#------------------------------------------------------------------------------

  class Game_Enemy < Game_Battler
   
    def is_a_character
      return false
    end
   
  end
 
  class Game_Actor < Game_Battler
   
    def is_a_character
      return true
    end
   
  end


#------------------------------------------------------------------------------
#                           SET ENEMY LEVEL
#------------------------------------------------------------------------------

if SET_ENEMY_LEVEL == true and ADAPTIVE_ENEMY_LEVEL == false
  #if SET_ENEMY_LEVEL switch is on do this below as long as Adaptive isn't on.
 
  class Game_Enemy < Game_Battler

    def level #sets enemy level based on value that appends to the enemy name.
 
    first_num = $data_enemies[@enemy_id].name[-2].chr #add first number after name
    second_num = $data_enemies[@enemy_id].name[-1].chr #now add second number
    one_and_two = first_num.to_s + second_num.to_s #display numbers as a string
    return one_and_two.to_i #convert the number into an integer
   
    end
 
    def name #show enemy name but remove the underscore and level numbers from
      #display.
    return $data_enemies[@enemy_id].name[0..-4]
    end
 
  end #end Game_Enemy class here

else #if enemy switch is not on, make level = 1 so things will be back to normal.
class Game_Enemy < Game_Battler
  def level
    return 1
  end
end
end #end if SET_ENEMY_LEVEL statement
#------------------------------------------------------------------------------
#                      End of SET ENEMY LEVEL
#------------------------------------------------------------------------------
#
#
#------------------------------------------------------------------------------
#                      ADAPTIVE ENEMY LEVEL
#------------------------------------------------------------------------------
if ADAPTIVE_ENEMY_LEVEL == true and SET_ENEMY_LEVEL == false
  class Game_Enemy < Game_Battler

    def level_average
     
      i = 1
      x = 0
      for i in 1..$game_party.actors.size
        x += $game_actors[i].level
      end
      average = x/i # setting average party level
   
      return average

    end
 
    def level_variance
     
    positive_or_negative = [1,-1]
   
    variance_max = 15
   
    variance_calculation = rand(variance_max) * positive_or_negative[rand(2)]
   
    return variance_calculation
   
    end

  ############
  def level
 
    return level_average #+ level_variance
 
  end


  end #end Game_Enemy class here
 
  elsif SET_ENEMY_LEVEL == false and ADAPTIVE_ENEMY_LEVEL == false #if conditions are not met for ADAPTIVE_ENEMY_LEVEL...
 
  class Game_Enemy < Game_Battler
  def level
    return 1
  end
  end

end
#------------------------------------------------------------------------------
#                    END OF ADAPTIVE ENEMY LEVEL
#------------------------------------------------------------------------------
#
#
#------------------------------------------------------------------------------
#                Game Actor Class (Actor Evade Attribute)
#------------------------------------------------------------------------------

  #--------------------------------------------------------------------------
  # * Get Basic Evasion Correction
  #--------------------------------------------------------------------------
if SET_STATIC_EVADE == true
 
  class Game_Actor < Game_Battler
 
    def base_eva
      armor1 = $data_armors[@armor1_id]
      armor2 = $data_armors[@armor2_id]
      armor3 = $data_armors[@armor3_id]
      armor4 = $data_armors[@armor4_id]
      eva1 = armor1 != nil ? armor1.eva : 0
      eva2 = armor2 != nil ? armor2.eva : 0
      eva3 = armor3 != nil ? armor3.eva : 0
      eva4 = armor4 != nil ? armor4.eva : 0
   
    return eva1 + eva2 + eva3 + eva4 + $static_eva_percentage[@class_id - 1]#static_evasion_value
                                        #adding custom evade value bonus
    end

  end #end this class

else #if SET_STATIC_EVADE == false
end #end if statement

#------------------------------------------------------------------------------
#             End of Game Actor Class (Actor Evade Attribute)
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
#             Creating Magic Evade for Armors Class
#------------------------------------------------------------------------------
module RPG
  class Armor
    alias custom_armor_initialize initialize
    #aliasing old initialize and adding in my mag_eva here.
    def initialize
      @mag_eva = 0
    end
    attr_accessor :mag_eva #same with this attr_accessor
   
    def mag_eva
        return $set_mag_eva_for_armor_by_id[@id]
    end
   
   
  end
end


#------------------------------------------------------------------------------
#             END Creating Magic Evade for Armors Class
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
#                Game Actor Class (Actor MAGIC Evade Attribute)
#------------------------------------------------------------------------------


  #--------------------------------------------------------------------------
  # * Get Basic MAGIC Evasion Correction
  #--------------------------------------------------------------------------
if SET_STATIC_MAGIC_EVADE == true
 
  class Game_Actor < Game_Battler
   
    def base_magic_eva
      armor1 = $data_armors[@armor1_id]
      armor2 = $data_armors[@armor2_id]
      armor3 = $data_armors[@armor3_id]
      armor4 = $data_armors[@armor4_id]
      mag_eva1 = armor1 != nil ? armor1.mag_eva : 0
      mag_eva2 = armor2 != nil ? armor2.mag_eva : 0
      mag_eva3 = armor3 != nil ? armor3.mag_eva : 0
      mag_eva4 = armor4 != nil ? armor4.mag_eva : 0
   
    return mag_eva1 + mag_eva2 + mag_eva3 + mag_eva4 + $static_mag_eva_percentage_for_actor_by_class_id[@class_id - 1]#static_magic_evasion_value
                                                       #adding custom magic evade value bonus
    end

  end #end this class

else #if SET_STATIC_MAGIC_EVADE == false
end #end if statement

#------------------------------------------------------------------------------
#             End of Game Actor Class (Actor MAGIC Evade Attribute)
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
#             Setting up Magic Evade for Game Actor
#------------------------------------------------------------------------------
if SET_STATIC_MAGIC_EVADE == true
 
  class Game_Actor < Game_Battler
   
    def mag_eva
      return base_magic_eva
    end
   
  end
 
end #end if statement
#------------------------------------------------------------------------------
#             END OF Setting up Magic Evade for Game Actor
#------------------------------------------------------------------------------


#------------------------------------------------------------------------------
#             Setting up Magic Evade for Game Enemy
#------------------------------------------------------------------------------

  class Game_Enemy < Game_Battler
   
    def mag_eva
      return $set_mag_eva_percentage_for_enemy_by_id[@enemy_id]
    end
   
  end

#------------------------------------------------------------------------------
#             END OF Setting up Magic Evade for Game Actor
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
#             Setting up Skill Int-F for Magic Evade
#------------------------------------------------------------------------------

module RPG
 
  class Skill
   
    alias custom_mag_eva_skill_initialize initialize
    def initialize
      @mag_eva_int_f = 0
    end
   
    attr_accessor :mag_eva_int_f
   
    def mag_eva_int_f
      return $set_mag_eva_intf_for_skill_by_id[@id]
    end
   
  end
 
end



#------------------------------------------------------------------------------
#             END OF Setting up Skill Int-F for Magic Evade
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
#                      Custom HP/MP Gain Curve System
#------------------------------------------------------------------------------
if SET_HP_SP_GAIN_CURVE == true # if HP/SP gain switch is on..

  class Game_Actor < Game_Battler
 
#####  HP Gain CURVE  ####
 

      def level_hp_bonus_sum
       
        i = 0
        add_level_bonus_array_elements_together = 0
       
        while i < @level
          add_level_bonus_array_elements_together += $custom_level_growth_hp[i]
          i += 1
        end 
        return add_level_bonus_array_elements_together
      end

      def base_maxhp
       
        if @class_id > $custom_max_hp_base.size or @level > $custom_level_growth_hp.size
       
          return  $data_actors[@actor_id].parameters[0, @level]
        else
          return $custom_max_hp_base[@class_id - 1] + level_hp_bonus_sum
        end

     
      end #### END HP Gain CURVE
     
     
#####  sp Gain CURVE  ####
 

      def level_sp_bonus_sum
       
        i = 0
        add_level_bonus_array_elements_together = 0
       
        while i < @level
          add_level_bonus_array_elements_together += $custom_level_growth_sp[i]
          i += 1
        end 
        return add_level_bonus_array_elements_together
      end

      def base_maxsp
       
        if @class_id > $custom_max_sp_base.size or @level > $custom_level_growth_sp.size
       
          return  $data_actors[@actor_id].parameters[0, @level]
        else
          return $custom_max_sp_base[@class_id - 1] + level_sp_bonus_sum
        end

     
      end #### END sp Gain CURVE
   
  end #end Game Actor Class

else #if hp/sp swtich is off, then do nothing and resume to normal.
end
   
#------------------------------------------------------------------------------
#                     END OF Custom HP/MP Gain Curve System
#------------------------------------------------------------------------------


#------------------------------------------------------------------------------
#
#                A Little HP/MP Growth Helper Module
#
#------------------------------------------------------------------------------
#
# This will give you a text file of either hp or mp growth that you can put
# inside your data file or manually input the values into your hp/sp array above.
# The second option is suggested for use of this script. You can simply skip this
# and modify the array in the configuration setting, but you can use this tool
# to modify the values in your own way. For instance, if you wanted to gain 5
# points per level, the you could just do starting_hp += 5 to show those results.
# This tool was mainly for me, but you might be able to make use of it for you.
#
# To request results, make a map event and give one of the two following
# commands:
#   
#   Give_Results.give_hp_results(PUT_STARTING_VALUE_HERE_AS_AN_INTEGER)
#
#   Give_Results.give_mp_results(PUT_STARTING_VALUE_HERE_AS_AN_INTEGER)

module Give_Results
 
module_function

  def give_hp_results(starting_hp) #please give me starting hp value
 
    print "*HINT* It is a good idea to make it between 35 and 60."

    $level_growth_hp = [0,11,12,14,17,20,22,24,26,27,28,30,35,39,44,50,54,57,61,65,67,69,72,76,79,82,86,90,95,99,100,101,102,102,103,104,106,107,108,110,111,113,114,116,117,119,120,122,125,128,130,131,133,134,136,137,139,142,144,145,147,148,150,152,153,155,156,158,160,162,160,155,151,145,140,136,132,126,120,117,113,110,108,105,102,100,98,95,92,90,88,87,85,83,82,80,83,86,88]

    i = 0
    File.open('hp_results.txt', 'w') do |f1|
      while i < 99
        starting_hp += $level_growth_hp[i]
        f1.print starting_hp
          if i < $level_growth_hp.size - 1
          f1.print ','
          end
        i += 1
      end
    end
  end

  def give_mp_results # please give me starting mp value

    print "*HINT* It is a good idea to make it between 35 and 60."
 
    starting_mp = gets.to_i
    $level_growth_mp = [0,5,6,7,8,9,10,11,12,13,14,15,16,17,17,17,17,16,16,16,15,15,15,14,14,14,14,13,13,13,13,12,12,12,12,11,11,11,11,11,11,10,10,10,10,10,10,10,10,9,9,9,9,9,9,9,9,9,9,10,8,8,8,8,8,8,8,8,8,8,10,10,7,6,5,4,5,6,7,8,9,8,7,6,5,6,7,5,6,7,8,9,10,8,8,9,10,11,13]

    i = 0
    File.open('hp_results.txt', 'w') do |f1|
      while i < 99
        starting_mp += $level_growth_mp[i]
        f1.print starting_mp
          if i < $level_growth_mp.size
            f1.print ','
          end
        i += 1
      end
    end
  end

end
#------------------------------------------------------------------------------
#                  END OF Little HP/MP Growth Helper Module
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
#                           Debug Windows/Tools
#------------------------------------------------------------------------------
module Custom_Algo_Debug
 
  module_function
 
      def char_test
        for i in 0...$game_troop.enemies.size
      print $game_troop.enemies[i].is_a_character
        end
      end
   
  def show_enemy_levels
      Enemy_Level_Window.new
  end
 
  def show_player_evade
    i = 1
    for i in 1..$game_party.actors.size
      print "Name: " + $game_actors[i].name.to_s + "\nEvade: " + $game_actors[i].eva.to_s
    end
  end
 
  def average_player_levels
    i = 1
    x = 0
    for i in 1..$game_party.actors.size
      x += $game_actors[i].level
    end
    average = x/i
    print average.to_s
  end
 
end

class  Enemy_Level_Window < Window_Base

  #BLOCK 1
  def initialize
    super(0, 0, 440,380)
    self.contents = Bitmap.new(width-32, height-32)
    self.contents.font.name = "Arial" 
    self.contents.font.size = 24
   
    #BLOCK 2
       for i in 0...$game_troop.enemies.size
        enemy_index = i + 1
        x = 0
        y = i * 30
         if i >= 2
          x=250
          y -= 300
         end       
        enemy = $game_troop.enemies[i]
        self.contents.font.color = text_color(6)
        self.contents.draw_text(x, y, 200, 32, enemy_index.to_s + ". " + enemy.name.to_s + " Level: " + enemy.level.to_s)

      end
    end
 
end
 

def show_enemy_mag_eva
  Enemy_Mag_Def_Window.new
end
 


class  Enemy_Mag_Def_Window < Window_Base

  #BLOCK 1
  def initialize
    super(0, 0, 440,380)
    self.contents = Bitmap.new(width-32, height-32)
    self.contents.font.name = "Arial" 
    self.contents.font.size = 24
   
    #BLOCK 2
       for i in 0...$game_troop.enemies.size
        enemy_index = i + 1
        x = 0
        y = i * 30
         if i >= 2
          x=250
          y -= 300
         end       
        enemy = $game_troop.enemies[i]
        self.contents.font.color = text_color(6)
        self.contents.draw_text(x, y, 200, 32, enemy_index.to_s + ". " + enemy.name.to_s + " MagEVA: " + enemy.mag_eva.to_s)

      end
    end
 

end
 
 
################################################################################