Ray Administrador
Mensagens : 119 Data de inscrição : 15/03/2010 Idade : 28 Localização : in your nightmare!
| Assunto: Update Encounter Percentage 11/5/2010, 9:39 am | |
| IntroduçãoEste script permite que você altere dinâmicamente a taxa de encontro de inimigo no mapa. É particularmente útil para a criação de habilidades que reduzam a taxa de aparição (exemplo: Repel), ou mesmo para aumentar tambem. O que esse script faz é simplesmente permitir que você altere a porcentagem da taxa de encontro definindo no mapa através de uma variável.Características
- Permite definir a taxa várias vezes em um mesmo mapa
- Pode ser usado pra fazer areas de um mesmo mapa com diferentes taxas de
encontro.
- Pode ser facilmente usado com eventos comuns tornando fácil a criação de
itens e habilidades com este efeito.
- Tudo é controlado através de uma unica variável definida
por você.
ScreenshotsNão possui efeitos visuais perspectiveis por screenshots.Como usarApenas cole o script acima do Main. As outras instruções estão no próprio script. (em inglês)DemoNão necessita de demo.Script - Código:
-
#============================================================================== # Update Encounter Percentage # Version: 1.0 # Author: modern algebra (rmrk.net) # Date: April 29, 2010 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Description: # # This script allows you to dynamically alter the rate at which encounters # happen. It is useful particularly for making items or skills that can # reduce or increase the rate of encounters. What this script does is allow # you to specify a variable to control encounter rate, so you can use events # and common events to change the percentage of the default at which # encounters occur. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Instructions: # # Paste this script into its own slot in the Script Editor (F11) above Main # but below Materials. # # To set up which variable you want to control Encounter Rate, go to line 38 # and set UEP_CONTROL_VARIABLE_ID to the ID of the variable you want. # # The in-game value of the variable that you set will be the modified # percentage of encounters. # EX: If that variable is set to 100, then the encounter rate will not # change at all. If it's set to 50, then encounters will occur half as # frequently. If it's set to 200, then encounters will occur twice as # frequently. As a default measure, when that variable is set to 0, then it # will not alter encounter rate in any way. If you set the variable to # anything below 0 then no encounters will occur at all. #==============================================================================
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ # EDITABLE REGION #|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| # The ID of the variable that controls how the encounter rate is updated UEP_CONTROL_VARIABLE_ID = 1 #|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| # END EDITABLE REGION #////////////////////////////////////////////////////////////////////////////// #============================================================================== # ** Game Variables #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # aliased method - []= #==============================================================================
class Game_Variables #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Set Variable #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias malg_upep_setvar_7uj1 []= def []= (var_id, *args) old_val = self[var_id] malg_upep_setvar_7uj1 (var_id, *args) # Scale Encounter percentage if this is the control variable if var_id == UEP_CONTROL_VARIABLE_ID && old_val != self[var_id] $game_player.calc_encounter_percent (old_val) end end end
#============================================================================== # ** Game Player #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # aliased method - update_encounter, make_encounter_count # new method - calc_enc_percent #==============================================================================
class Game_Player #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Make Encounter Count #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias modern_ueper_mkencnt_5fv1 make_encounter_count def make_encounter_count (*args) modern_ueper_mkencnt_5fv1 (*args) calc_encounter_percent end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Update Encounter #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias malg_uep_updenc_6yj2 update_encounter def update_encounter (*args) variable = $game_variables[UEP_CONTROL_VARIABLE_ID] return if variable.nil? || variable < 0 malg_uep_updenc_6yj2 (*args) # Run Original Method end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Calculate Encounter Percentage #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def calc_encounter_percent (old_mod = 100) variable = $game_variables[UEP_CONTROL_VARIABLE_ID] return if variable.nil? || variable < 0 || old_mod < 0 old_mod = 100 if old_mod == 0 variable = 100 if variable == 0 @encounter_count = (@encounter_count*(old_mod.to_f / variable.to_f)).to_i end end
Perguntas frequentes - Citação :
- P: Funciona no RPGXP?
R: Creio que não. Créditos e agradecimentos
Última edição por Ray em 14/5/2010, 1:13 pm, editado 1 vez(es) | |
|
LuKo Membro
Mensagens : 1 Data de inscrição : 14/05/2010
| Assunto: Re: Update Encounter Percentage 14/5/2010, 1:09 pm | |
| Você praticamente copiou o meu tópico no srm, e a unica coisa que você tirou foi os meus créditos por ter traduzido o script.
Eu não ligo, o script nem é meu, mas ainda acho isso uma falta de respeito.
See ya | |
|
Ray Administrador
Mensagens : 119 Data de inscrição : 15/03/2010 Idade : 28 Localização : in your nightmare!
| Assunto: Re: Update Encounter Percentage 14/5/2010, 1:13 pm | |
| @LuKo Cara, foi mal... '-' Pensei que havia postado o script normal, sem tradução. Desculpa aí! e-e Já atualizei o post, agora com o script em inglês. | |
|
Conteúdo patrocinado
| Assunto: Re: Update Encounter Percentage | |
| |
|