RPG Maker Forums

Descriptiont

Introduce my first script, so this script can count enemy killed as variable. So you not again add variable at troop events.

Prerequisites
None

How to Use

In the script. Just add above main section

Terms of Use
Free to use for both commercial and non-commercial games. Please give credit.

Credits
Sandy

FAQ
None so far

Changelog
- 0.1: First version.

The Script

#-----------------------------------------------------------------------------
#                        ENEMY KILL COUNT AS VARIABLE
#                             AUTHOR : SANDY
#                             VERSION : 0.1
#                            DATE : 9/6/2015
#-----------------------------------------------------------------------------
# EXAMPLE :
# I want to create monster type like insect as MONSTER_TYPE1
# so add the monster you want to MONSTER_TYPE1 = [1,4] and the variable store at
# VARIABEL_1 = 2
#
# So you can make quest-killing or something like that
# Feel free to modify this script
# It's my first script ^^
# Enjoy!!
#-------------------------------------------------------------------------------
module SANDY
  #MONSTER TYPE
  MONSTER_TYPE1 = [1,4]
  MONSTER_TYPE2 = [5,6,7,8]
  MONSTER_TYPE3 = [9,10,11]
  MONSTER_TYPE4 = [12,13,14]
  MONSTER_TYPE5 = [15]
  MONSTER_TYPE6 = [16,17]
  MONSTER_TYPE7 = [18,19,20,21]
  MONSTER_TYPE8 = [21,22,23,24]
  MONSTER_TYPE9 = [25]
 
  #VARIABLE_TO STORE
  VARIABLE_1    = 1
  VARIABLE_2    = 2
  VARIABLE_3    = 3
  VARIABLE_4    = 4
  VARIABLE_5    = 5
  VARIABLE_6    = 6
  VARIABLE_7    = 7
  VARIABLE_8    = 8
  VARIABLE_9    = 9
 
end

class Game_Enemy < Game_Battler
 
  def perform_collapse_effect
  $game_variables[sANDY::VARIABLE_1] +=1 if SANDY::MONSTER_TYPE1.include?(@enemy_id)
  $game_variables[sANDY::VARIABLE_2] +=1 if SANDY::MONSTER_TYPE2.include?(@enemy_id)
  $game_variables[sANDY::VARIABLE_3] +=1 if SANDY::MONSTER_TYPE3.include?(@enemy_id)
  $game_variables[sANDY::VARIABLE_4] +=1 if SANDY::MONSTER_TYPE4.include?(@enemy_id)
  $game_variables[sANDY::VARIABLE_5] +=1 if SANDY::MONSTER_TYPE5.include?(@enemy_id)
  $game_variables[sANDY::VARIABLE_6] +=1 if SANDY::MONSTER_TYPE6.include?(@enemy_id)
  $game_variables[sANDY::VARIABLE_7] +=1 if SANDY::MONSTER_TYPE7.include?(@enemy_id)
  $game_variables[sANDY::VARIABLE_8] +=1 if SANDY::MONSTER_TYPE8.include?(@enemy_id)
  $game_variables[sANDY::VARIABLE_9] +=1 if SANDY::MONSTER_TYPE9.include?(@enemy_id)
 
   case collapse_type
    when 0
      @sprite_effect_type = :collapse
      Sound.play_enemy_collapse
    when 1
      @sprite_effect_type = :boss_collapse
      Sound.play_boss_collapse1
    when 2
      @sprite_effect_type = :instant_collapse
    end
end
end

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,037
Messages
1,018,464
Members
137,821
Latest member
Capterson
Top