Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [YERD] Variable Encounter Rates, Change encounter rates through variables. Repel and lure battles, too.
Yanfly
post Apr 11 2009, 12:26 PM
Post #1


Level 19
Group Icon

Group: Revolutionary
Posts: 384
Type: None
RM Skill: Undisclosed




Variable Encounter Rates
Last Update: 2009.04.20
By: Yanfly

Introduction
I got tired of terrible encounter rates when you would set the average rate to roughly "30" steps and every 4 steps, the game would enter a battle so I made this to augment the rate battles would appear and to give me more control over them. The control that's given are the number of times the steps are rolled before making an average, the minimum number of steps that are free of battle, the percentage rate of the encounters that is free of battle, and if used, an event variable to modify the encounter rate. In addition to affecting the rolling system, I've modified the default reduction system from walking in a "bush” autotile. From the looks of things, anything that's at the center of an autotile is considered a bush, even if it doesn't look a bush. This means that the green plains you've been using on many many maps are considered bushes and reduce the steps remaining by 2 each time. Yeah, that's been changed, too (and modifiable if you wish to change it to something else).

In addition to that, I've recreated a system similar to the Pokemon Repel item which gets rid of encounters so long as the Repel item isn't spent. Note that this isn't anything too special, but it's something extra to stick into this script. Repel is bound to an event variable so that the player doesn't have to throw in extra coding to modify the Repel value. Just modify it through the event editor. Simple as that. Also, for the opposite of Repel, there is a lure variable. Although rather than initiating a battle every step, lure will cut down the encounter count by a certain amount, which can be controlled from within the game.

Screenshots


Script
Click here.

Instructions
Using this script isn't too difficult. First off, I strongly suggest that you name your variables under the variable control menu. If you're using the default values, then the variables should be named as such:
  1. Variable 61: Encounter Addition
    This adds steps to the encounter creation and adds a control to encounter randomization. If you set this to 10 for example, it'll add 10 bonus steps to the randomization process every time.
  2. Variable 62: Steps Remaining
    This determines the steps remaining before you fight a battle. Used only for debugging.
  3. Variable 63: Repel Steps
    Used like in Pokemon. Once this is set to anything above zero, it'll prevent Steps Remaining from dropping. This lowers by 1 point every step.
  4. Variable 64: Lure Steps
    Similar to the Repel Steps except this actually alters Steps Remaining. Every step, it'll lower the Steps remaining using the following variables.
  5. Variable 65: Lure Division
    Each step taken will have Steps Remaining divided by this variable's value. If you have it set to 2 and you have 20 steps remaining, the next step will drop it to 10, then 5, then 2, then 1, then 0.
  6. Variable 66: Lure Subtraction
    Like Lure Division except this is a subtraction modifier. If this is set to 3 and you have 30 steps remaining, it'll go down to 27, then 24, then 21, etc.

And that's it for variable renaming. To actually use this, you can do it anywhere that allows you to modify variables. Primarily in the event editor.



That's an example of how it'll be used in the event editor. It's not difficult at all.

Notes
Some ideas that can expanded upon this script is an actual Repel Potion. Create an item in your item list that calls upon a specific common event. In that common event, you can create an event that'll raise Repel Steps to 100 or whatever you wish it to be. And with just that, you have an easy as pie Repel Potion made.

Compatibility Updates to Other YERD scripts
- None so far.

Terms and Conditions
Just give credit where due.

Credits and Thanks
-Pokemon. And when are they going to fix Nintendo Pokemon Wifi from trading hacked Pokemon?

Originally Found Here: Pockethouse

This post has been edited by Yanfly: Apr 20 2009, 06:36 AM


__________________________
Go to the top of the page
 
+Quote Post
   
mega456789
post Apr 12 2009, 07:37 AM
Post #2


Level 3
Group Icon

Group: Member
Posts: 44
Type: Event Designer
RM Skill: Intermediate




seems like a nice script, good work.


__________________________
Join

Today

Go to the top of the page
 
+Quote Post
   
Enurta
post Apr 20 2009, 01:29 AM
Post #3



Group Icon

Group: Member
Posts: 1
Type: None
RM Skill: Undisclosed




Seems that you made a mistake when that is easily fixed. From lines 164 to 173 need to be replaced.
[Show/Hide] Original Part

return if $game_variables[YF::EVENT::REPEL_VARIABLE] > 0

# The default stuff
return if $TEST and Input.press?(Input::CTRL)
return if in_vehicle?
if $game_map.bush?(@x, @y)
@encounter_count -= YF::EVENT::BUSH_REDUCTION
else
@encounter_count -= YF::EVENT::NORM_REDUCTION
end



All you have to do is replace that with this below.

[Show/Hide] New Part
return if $game_variables[YE::EVENT::VARIABLE::REPEL_VARIABLE] > 0

# The default stuff
return if $TEST and Input.press?(Input::CTRL)
return if in_vehicle?
if $game_map.bush?(@x, @y)
@encounter_count -= YE::EVENT::VARIABLE::BUSH_REDUCTION
else
@encounter_count -= YE::EVENT::VARIABLE::NORM_REDUCTION
end

Go to the top of the page
 
+Quote Post
   
Yanfly
post Apr 20 2009, 06:35 AM
Post #4


Level 19
Group Icon

Group: Revolutionary
Posts: 384
Type: None
RM Skill: Undisclosed




Thanks for notifying me. I'll update it right away!


__________________________
Go to the top of the page
 
+Quote Post
   
luigi400000
post Sep 20 2011, 06:36 PM
Post #5


Level 2
Group Icon

Group: Member
Posts: 27
Type: Mapper
RM Skill: Intermediate




The download doesent work? Can you fix it?
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 18th June 2013 - 08:08 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker