Open HimeWorks opened 10 years ago
That's what I am doing. Its easy and allows the non scripter simple access to it via events. I have several game variables that I add together to get the total troop level just prior to starting battle.
However, it would be nice to be able to have multiple level ranges in a single troop. But not a priority. I think I have a plugin/patch for 70% of all the scripts I am using now... :p
If you think the patches can be merged into the main script without causing compatibility issues I can add them.
Or post them up as add-on scripts.
Not sure what you mean by multiple level ranges, or how that is determined.
Just that if I had a troop of multiple enemies, they might each be a different level, determined randomly somehow, within different ranges based on some variables.
In my current iteration, troop levels are still a direct reflection of the areas level, and the player is always aware of what that level is, if they want to be. But I don't see why that can't simply become a minimum level, were the actual level has a chance of being >=
the minimum.
As for the plugins I've made for others scripts, I intend to share all of them once I get around to finalizing my build in some fashion. At the moment I am adding and subtracting to, or outright abandoning, parts so often that I am trying to avoid the added work required of keeping all those alterations straight, so others could use them without confusion.
I have altered so many scripts, I have to search my own collection to make sure I haven't already made a plugin for whatever script I am about to mess with. ;)
Well, it could. You could just say
$game_variables[1] + rand(10)
or something. Now the variable acts as a minimum...
True but that would be applied to the entire troop rather than individual troop members.
It wouldn't be difficult to plugin if I wanted. I just mentioned it as a suggestion to your OP. ;)
Couldn't you just do that for each member then? Currently the only way you can set levels is inside a troop event.
Unless you mean there are multiple minimum levels.
Sure, it would be best IMO to make the variable values $game_variables in any regard.
If the minimum value is stored in $game_variables you can use that to determine each troop member's level right?
Sure. The way I am currently assigning the value is on map entry (or transition for multi-area maps).
Also, the player has a bias slider in the game options menu to add as many levels as they like to the world (minimum) level (or remove any added). But the worlds actual level rarely goes down once it goes up.
I am going to take some time to create a plugin today (after some errands) and post it here. All this back and forth has given me some ideas. :)
Ah... I see now what you were eluding to. It has been a while since I looked at your code. I forgot that there were already formulas for min/max level. Which can be assigned via $game_variables already. ;)
/facepalm
edit: Of course, that leaves the levels truly random. And I am sort of a control freak. So I'll have to make a pseudo-random scale for it. :)
Here is what I threw together just now... may have some holes...
#RogueDeus 14_0808
#RDeus - Himes Enemy Level Plugin
module RDeus
module EnemyLvl
#RDeus::EnemyLvl::PSEUDO_RAND
PSEUDO_RAND = {
:default_b => [-2,-1,-1,-1,0,0,0,0,1,1], #10% = -2 30% = -1 40% = 0 20% = +1
:default_a => [-1,-1,-1,0,0,0,0,1,1,1], #30% = -1 40% = 0 30% = +1
:default => [0,0,0,0,0,0,1,1,1,2], #60% = 0 30% = +1 10% = +2
:default_1 => [0,0,0,1,1,1,1,2,2,3], #30% = 0 40% = +1 20% = +2 10% = +3
:default_2 => [0,1,1,1,1,2,2,2,3,3], #10% = 0 40% = +1 30% = +2 20% = +3
}
end
end
#===============================================================================
#
#===============================================================================
class RPG::Enemy
#-----------------------------------------------------------------------------
# new: <level_group: default>
# Returns the level group symbol of the enemy for applicable randomization.
#-----------------------------------------------------------------------------
def level_group
return @level_group if @level_group
@note =~ /<level[-_ ]?group:\s*(.*)\s*>/i
@level_group = $1.to_sym if $1
return @level_group
end
#-----------------------------------------------------------------------------
# new:
#-----------------------------------------------------------------------------
def pseudo_rand_range
RDeus::EnemyLvl::PSEUDO_RAND[self.level_group]
end
end
#===============================================================================
#
#===============================================================================
class Game_Enemy < Game_Battler
#-----------------------------------------------------------------------------
# overwrite:
# Applies level group randomization.
#-----------------------------------------------------------------------------
def setup_level(enemy_id)
if enemy.level_group
set_level(enemy.level(self), true)
else
set_level(enemy.level(self))
end
end
#-----------------------------------------------------------------------------
# overwrite:
# Applies level group randomization.
#-----------------------------------------------------------------------------
def set_level(amount, pseudo_rand = false)
if pseudo_rand && enemy.level_group
range = enemy.pseudo_rand_range
rand = range[rand(range.length)]
@level = [[amount + rand, max_level].min, min_level].max
else
@level = [[amount, max_level].min, min_level].max
end
end
end
Ya, controlled randomness is not something I'm too experienced with so I'm not sure what kind of things would provide devs more control.
I am so bad at math that I often just settle for bounded pseudo random arrays rather than formulas. :) I blame my pen and paper RPG roots... Table, in tables... etc...
The enemy levels script provides the ability to modify enemy levels during battle, but it doesn't allow you to initialize those levels outside of battle.
So for example, you have an event that starts a battle with a slime, but you would like to set the slime's level.
One workaround is to set a variable outside of battle, and then once you begin the battle, the troop will read the variable and set the level appropriately.
Not sure which would be better.