iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

Keep an eye out for the upcoming 3rd Quarter Contest!
4 Pages V  < 1 2 3 4 >  
Reply to this topicStart new topic
> State Parameters PLUS (v 1.4b), Now modify targeting odds, elemental rates, actor skills and more!
Rating 5 V
Mr. Bubble
post Feb 11 2009, 03:08 AM
Post #21



Group Icon


Type: Undisclosed
Alignment: Unaligned




Wow, you're fast. laugh.gif Thanks for the quick fix, Mithran.

You can F12 reset in a normal game too. There's also F2 FPS and the F9 switch/variable panel, but you probably already knew about those.

Oh yeah, you said somewhere you didn't like making comment lines. You can hit Ctrl+Q in the script editor to comment out selected or highlighted lines with "#~". If you hit Ctrl+Q again, it'll remove "#~" if lines start with it.


--------------------
I no longer support Tankentai.
Go to the top of the page
 
+Quote Post
   
CrimsonPride
post Feb 11 2009, 03:35 AM
Post #22



Group Icon


Type: Designer




Mithran, thank you for making such excellent scripts. Can I make a quick request for an addon of another one of your scripts? It will be in the appropriate thread >.>

And Mr. Bubble, thank you because now I can test much more easily with that F12 reset.
Go to the top of the page
 
+Quote Post
   
Mithran
post Feb 11 2009, 06:16 AM
Post #23


Scripter
Group Icon


Type: Coder
Alignment: True Neutral




@Mr.Bubble
Did not know about the F2 one, actually. I noticed both were mentioned in the helpfile afterwards when I was researching a fix. F9 Debug menu is actually in the coding (theres a whole Window Class for it). The Input module itself must trap the F12 and F2 keypresses, because they are nowhere to be found in the script editor or the disclosed base code for RGSS2. Thanks for bringing them to my attention.

I did know about the 'comment out/ uncomment' feature. It works fine on blocks of code, but it just doesn't mesh with my style for writing instructions. Paragraph style writing means a lot of work preventing the comments from running off the page. Currently, I write most my instructions before I even begin the coding.huh.gif Yeah, that often means frequent changes before its finished. I also do 95% of my script writing in the full SciTE editor, which has a compeltely different page width and a different character width for comment lines.

@CrimsonPride
Your request has been noted and commented on in the appropriate thread wink.gif


--------------------
Go to the top of the page
 
+Quote Post
   
Mithran
post Feb 24 2009, 02:58 PM
Post #24


Scripter
Group Icon


Type: Coder
Alignment: True Neutral




Oh no, a double post!

Update

v 1.4
- Added Functionality: Actor Skills. Add, subtract, or set the selected actor's skills for the duration of the state only.
- Added Change Log to the script instructions
- Fixed case sensitivity on some of the note tags. The only case sensitve note tag is now <STATE PARAMETERS PLUS>.

Previous changes:
» Click to show Spoiler - click again to hide... «


Modified script is in original post.


--------------------
Go to the top of the page
 
+Quote Post
   
Orteil
post Mar 1 2009, 01:59 AM
Post #25



Group Icon


Type: Undisclosed




Halp, my skills won't work !
I mean, I'm using this code for that exact feature (adding/removing skills through states), andit doesn't seem to work : the skills do appear in my Skills screen with the selected states, but they're grayed out. Same during fights.
I checked, it's not linked to the skills themselves, it does that with every skill.
Plz fix, or explain what I did wrong !
Go to the top of the page
 
+Quote Post
   
Mithran
post Mar 1 2009, 04:33 AM
Post #26


Scripter
Group Icon


Type: Coder
Alignment: True Neutral




Sorry about that. I''ve updated to fix the problem.

Update

v 1.4b
- Bugfix: Fixed a bug with state learned skills not enabling correctly.

Previous changes:
» Click to show Spoiler - click again to hide... «


Modified script is in original post. If it still doesnt work, you need to move this script below any other skill learning systems (KGC_SkillCP system, skill learn shop, etc).


--------------------
Go to the top of the page
 
+Quote Post
   
Mr. Bubble
post Mar 10 2009, 07:16 PM
Post #27



Group Icon


Type: Undisclosed
Alignment: Unaligned




Hey Mithran, I've made a script for myself similar to how stat parameters are drawn, but it's for an actor's elemental rate instead. Here's a small piece of it so you know the context I'm talking in:

CODE
class Window_Status < Window_Base
  def draw_actor_element_rate(actor, x, y, type)
    case type
    when 0 # Melee
      parameter_icon = 132
      parameter_value = actor.element_rate(1)


I've just tested it with the State Parameters+ script and it's working well. Though, with this, I realized that rate stacking isn't additive. Let's say I have two states applied on an actor at the same time. Each of these states provide 20% element resist to Melee. The result would be 36% resist. I know that this kind of rate stacking is like this by default and I'm going to go with that. smile.gif It should be simple, but I'm having trouble figuring out the stacking formula.

Also, stat rate stacking multiplicative (120% * 120% = 144%). Again, not a problem for me, but putting it out there in case anyone is wondering.


--------------------
I no longer support Tankentai.
Go to the top of the page
 
+Quote Post
   
Mithran
post Mar 11 2009, 05:44 AM
Post #28


Scripter
Group Icon


Type: Coder
Alignment: True Neutral




QUOTE (Mr. Bubble @ Mar 10 2009, 11:16 AM) *
Hey Mithran, I've made a script for myself similar to how stat parameters are drawn, but it's for an actor's elemental rate instead. Here's a small piece of it so you know the context I'm talking in:

CODE
class Window_Status < Window_Base
  def draw_actor_element_rate(actor, x, y, type)
    case type
    when 0 # Melee
      parameter_icon = 132
      parameter_value = actor.element_rate(1)


I've just tested it with the State Parameters+ script and it's working well. Though, with this, I realized that rate stacking isn't additive. Let's say I have two states applied on an actor at the same time. Each of these states provide 20% element resist to Melee. The result would be 36% resist. I know that this kind of rate stacking is like this by default and I'm going to go with that. smile.gif It should be simple, but I'm having trouble figuring out the stacking formula.

Also, stat rate stacking multiplicative (120% * 120% = 144%). Again, not a problem for me, but putting it out there in case anyone is wondering.


All in all, I also do much perfer rate application and only included the direct/additive application for special circumstances or for people who want that sort of system. Direct application is a lot less balanced for a base system, because you can stack to complete immunity and weaknesses dont get covered as well by resists.

If you wanted to use direct resist stacking rather than multiplicitave stacking, you just need to omit the percent (%) sign in the note tag. In other words, instead of:

CODE
/element 1 resist + 20%

(subtract 20% of whatever the calcualted element rate is, each appiled in turn)
(one of these would multiply the total rate by 0.8, two would multiply by 0.8 * 0.8, three would multiply the total rate by 0.8 * 0.8 * 0.8, etc)

You would type:

CODE
/element 1 resist + 20

(subtract 20 from the element rate directly)
(1 would subtract 20 from the rate, 2 would sutract 40, 3 would subtract 60, etc)

Dont use the equal sign without a percent though, because that is a special case that sets the base value instead.

CODE
/element 1 resist = 20

(base element rate becomes 20, only the highest display priority state value applies, this happens before other values are applied)

In the code, its about lines 1302 through 1337, divided into three methods. The seperate methods resolve each indiviudal value before applying them to the result. In hindsight, its probably a bit more confusing because you are applying element 'resists' instead of adding or subtracting directly from the rate, but I thought the language would be easier at the time. I'll probably eventually add the other language in addition to this (/element 1 rate + 20, etc) but its not a priority right now.

The formula for element rates goes pretty much like this:

initial = the letter value resist
initial becomes -100 if absorb is set (overriding the above)
initial becomes the new letter value if a new letter value is set (overriding both the above)
if the element absorbs (any negative element rate), no additional resists are applied. (this becomes the final result)
subtract the total additive resist rate (values without the percent sign)
calculate the multiplicative resist rate. Initial value is 100 (100% of the previous rate) and is each is applied in turn by the formula
"new value = last value * (100 - resist) / 100.0"
apply the rate to the above result
the minimum of the above result is capped at 0, therefore, adding resists in this way can never make an absorb value, the best they can do is immunity

And yes, the formula for rate based stat progression is exactly like the one used in the database. 120% rate on one and 120% rate on a second state is a 144% total rate (44% bonus). The plus and minus options here is are just different ways of writing it (/atk + 20% is the same as /atk = 120%; /atk - 20% is the same as /atk = 80%). Using exact values on base parameters (equal sign without the percent) however, makes them ignore all other states. I havent found a really useful application for this, so I am thinking about changing it to the same methods used in element/state resist rates, where if an exact value is set is simply overrides the base, allowing for other states to still modify it.

Understanding the difference between using rate and using direct/additive application is key to using this script, so if anyone has any further questions, please let me know.


--------------------
Go to the top of the page
 
+Quote Post
   
Mr. Bubble
post Mar 11 2009, 08:14 PM
Post #29



Group Icon


Type: Undisclosed
Alignment: Unaligned




CODE
(one of these would multiply the total rate by 0.8, two would multiply by 0.8 * 0.8, three would multiply the total rate by 0.8 * 0.8 * 0.8, etc)

Ok, that was stupid of me. I should've figured that out myself. x_x

I didn't know leaving the % off the value would be additive to the rate rate. I must've misread because I thought "/element 1 resist + 20" meant that it reduced element 1 damage by 20.

Thanks for explaining everything Mithran. smile.gif It's good to know how everything works when designing the game.

This post has been edited by Mr. Bubble: Mar 11 2009, 08:15 PM


--------------------
I no longer support Tankentai.
Go to the top of the page
 
+Quote Post
   
arcaeus
post May 30 2009, 02:39 AM
Post #30



Group Icon


Type: Undisclosed




Is there anything in there that allows someone to change the elemental efficiencies of characters? Meaning, if they get bonuses when using those elements.
Go to the top of the page
 
+Quote Post
   
Mithran
post May 30 2009, 03:57 AM
Post #31


Scripter
Group Icon


Type: Coder
Alignment: True Neutral




QUOTE (arcaeus @ May 29 2009, 07:39 PM) *
Is there anything in there that allows someone to change the elemental efficiencies of characters? Meaning, if they get bonuses when using those elements.


Thanks for the suggestion. I did another simple script allowing this for single-element systems:

Spoiler:
CODE
# Simple Element Damage Boost
# By Mithran
# Please do not redistribute!
# Add the following to the note tag of any weapon, armor, enemy, or state
# <element boost 1 : 50>
# <element decay 1 : 50>
# replace the 1 in either of the above with the element id of the element you
# are modifying
# replace the 50 with how much you want to add or subtract from the element's damage rate
# Damage will be boosted by percent specified, then the decay percent will be subtracted
# afterward

# if more than one boost or decay is present at a given time, only the highest
# value will be used.  The rest are discarded.

# This works best with single element systems.  If the element is anywhere in the
# attack the damage boost/decay will be triggered.

class Game_Battler
  alias make_obj_damage_value_mith_eb_QF make_obj_damage_value
  def make_obj_damage_value(user, obj)
    make_obj_damage_value_mith_eb_QF(user, obj)
    elemental_boost_damage(user, obj)
  end
  
  alias make_attack_damage_value_mith_eb_QF make_attack_damage_value
  def make_attack_damage_value(user)
    make_attack_damage_value_mith_eb_QF(user)
    elemental_boost_damage(user, user)
  end
    
  def elemental_boost_damage(user, obj = nil)
    eboost = 0
    edecay = 0
    return if obj == nil
    for element_id in obj.element_set
      boost = user.element_boost(element_id)
      eboost = boost if eboost < boost
      decay = user.element_decay(element_id)
      edecay = decay if edecay < decay
    end
    if eboost > 0
      @hp_damage += @hp_damage * eboost / 100
      @mp_damage += @mp_damage * eboost / 100
    end
    if edecay > 0
      edecay = 100 if edecay > 100
      @hp_damage -= @hp_damage * edecay / 100
      @mp_damage -= @mp_damage * edecay / 100
    end
  end
  
  def element_boost(element_id)
    objs = []
    if actor?
      objs = self.equips + self.states
    else
      objs = [self.enemy] + self.states
    end
    eboost = 0
    for obj in objs.compact
      boost = obj.element_boost(element_id)
      eboost = boost if eboost < boost
    end
    return eboost
  end
  
  def element_decay(element_id)
    objs = []
    if actor?
      objs = self.equips + self.states
    else
      objs = [self.enemy] + self.states
    end
    edecay = 0
    for obj in objs.compact
      decay = obj.element_decay(element_id)
      edecay = decay if edecay < decay
    end
    return edecay
  end
  
end

module Mithran
  module EBoostQF
    
    module_function
    def element_boost(element_id)
      if self.note =~ /<element\s?boost\s?#{element_id}\s?\:\s?(\d+)>/i
        return $1.to_i
      else
        return 0
      end
    end
    
    def element_decay(element_id)
      if self.note =~ /<element\s?decay\s?#{element_id}\s?\:\s?(\d+)>/i
        return $1.to_i
      else
        return 0
      end
    end
    
  end
end

class RPG::BaseItem
  include Mithran::EBoostQF
  public (:element_boost)
  public (:element_decay)
end

class RPG::State
  include Mithran::EBoostQF
  public (:element_boost)
  public (:element_decay)
end

class RPG::Enemy
  include Mithran::EBoostQF  
  public (:element_boost)
  public (:element_decay)
end


I wouldn't use it with any kind of multi-element system, though, because if the element is anywhere present in the attack the boost or decay will be triggered - this even goes for cases where the elemental rate is not used in the final calculation. This can either work to your advantage or against you, depending on how you want it set up. The original requestor only wanted to increase or decrease the damage if an attack had the element. Also, the values dont stack - the biggest boost is applied, then the biggest decay. If you like, I'll consider updating this to a multi-element friendly version with some stacking options. Work should be slowing by next week, so I'll hopefully be getting some scripts out soon.


--------------------
Go to the top of the page
 
+Quote Post
   
arcaeus
post May 30 2009, 06:41 AM
Post #32



Group Icon


Type: Undisclosed




I used the script by itself (Not placing it inside the old script), but it didn't work. Now if it's dependent on the main script, then that's my fault.

But I put <elemental boost 9 : 100> on a weapon, to boost fire, and made the weapon fire elemental itself.
Neither did the attack of the weapon nor the skill "fire" increase in damage.

There also seems to be a problem with the battle tester in the original script. You can enter the tester, and change the party configuration, but when you start the battle, the party reverts back the party before you changed it; then when you exit and reenter the menu for the battler, it shows you that you have the new configuration, but when you start the battle again, it's still that original party before you changed.

This post has been edited by arcaeus: May 30 2009, 06:49 AM
Go to the top of the page
 
+Quote Post
   
Mithran
post May 30 2009, 07:08 AM
Post #33


Scripter
Group Icon


Type: Coder
Alignment: True Neutral




QUOTE (arcaeus @ May 29 2009, 11:41 PM) *
I used the script by itself (Not placing it inside the old script), but it didn't work. Now if it's dependent on the main script, then that's my fault.

But I put <elemental boost 9 : 100> on a weapon, to boost fire, and made the weapon fire elemental itself.
Neither did the attack of the weapon nor the skill "fire" increase in damage.

Another problem lies with the main script. It has some sort of corrupting influence on the test battler. Once I enter the battler, I can change the party in the menu, but when I start the battle up, it has the party configurations from before I changed the party. I can't bypass this problem unless I shut down the game and restart it, and, even then, the problem persists after the first party change.


Ugh, I never posted the battletest fix. Find this line in the script:

CODE
  alias load_bt_database_orig_mith_state_parameters_plus load_database


replace it with

CODE
  alias load_bt_database_orig_mith_state_parameters_plus load_bt_database


Basically, because I missed that second 'bt' there, its loading the party from the save file and not the database memory.

The small script is not dependent in any way on state parameters plus. It seems I put the wrong note tag in the instructions - it should be <element boost 9 : 100>, no 'al' in there. That should work.


--------------------
Go to the top of the page
 
+Quote Post
   
thunderblood
post May 30 2009, 07:48 AM
Post #34



Group Icon






Wow. Not only did you solve my problem, but you tackled Arcaeus's problem at practically the same time. "Skill: Pretty Good" is an understatement, no?

Also, thanks for the battletest fix. My only qualm about your State Parameter thing was that and now, no more qualms!
Go to the top of the page
 
+Quote Post
   
arcaeus
post May 30 2009, 07:53 AM
Post #35



Group Icon


Type: Undisclosed




Wow, good job. Both problems are solved. I commend you for your quick coding.

With these problems solved, these are definitely premier scripts in my database.

You sir, have made by day.
Go to the top of the page
 
+Quote Post
   
McDohl
post Jun 25 2009, 12:00 AM
Post #36



Group Icon


Type: Undisclosed




Love the script. It's so awesome. I've been looking for something like this for a while now.

Just as a sidenote: in the Usage -> Parameters section, it says "/cri - sets critical rate".

/cri doesn't work when setting the crit hit rate, but /critical does.


--------------------
--McDohl
#rm2k@irc.dynastynet.net
http://www.rpgmaker.net/
Go to the top of the page
 
+Quote Post
   
Mithran
post Jun 25 2009, 12:54 AM
Post #37


Scripter
Group Icon


Type: Coder
Alignment: True Neutral




Thanks smile.gif

/cri does work by the way, I just tested it again. The code allows for /cri or /critical to be matched. If its not registering, its usually because you included a space before the percent sign or an extra character between one of the operators.

For example:
CODE
/cri + 10 %

would not generate a match

CODE
/critical + 10%

would work.

Other than that, the matching code is fairly liberal with extra spaces in the lines.


--------------------
Go to the top of the page
 
+Quote Post
   
McDohl
post Jun 25 2009, 02:49 AM
Post #38



Group Icon


Type: Undisclosed




QUOTE (Mithran @ Jun 24 2009, 08:54 PM) *
Thanks smile.gif

/cri does work by the way, I just tested it again. The code allows for /cri or /critical to be matched. If its not registering, its usually because you included a space before the percent sign or an extra character between one of the operators.

For example:
CODE
/cri + 10 %

would not generate a match

CODE
/critical + 10%

would work.

Other than that, the matching code is fairly liberal with extra spaces in the lines.


Ah, you're right. It turns out the error was completely unrelated.

Sorry. Still love the script. biggrin.gif


--------------------
--McDohl
#rm2k@irc.dynastynet.net
http://www.rpgmaker.net/
Go to the top of the page
 
+Quote Post
   
aba3k
post Aug 12 2009, 12:23 AM
Post #39



Group Icon


Type: Undisclosed
Alignment: Chaotic Good




bug: in the battle test, if i change the number of enemies or make any change (add a slime in a group of rats for example), the change don't occur unless i save the project.


--------------------
Go for the eyes Boo, go for the eyes!
Go to the top of the page
 
+Quote Post
   
Mithran
post Aug 12 2009, 01:34 AM
Post #40


Scripter
Group Icon


Type: Coder
Alignment: True Neutral




QUOTE (aba3k @ Aug 11 2009, 05:23 PM) *
bug: in the battle test, if i change the number of enemies or make any change (add a slime in a group of rats for example), the change don't occur unless i save the project.


Scroll up six posts... http://www.rpgmakervx.net/index.php?s=&...st&p=128632

I can't fix it in the OP without completely reformatting the post as the new spoiler tags no longer support anything near the size of the script (I'll have to move it to an attachment if I edit the post at all). I'm not chaning it until at least version 2.0, if ever.


--------------------
Go to the top of the page
 
+Quote Post
   

4 Pages V  < 1 2 3 4 >
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: 29th July 2014 - 07:50 AM

RPGMakerVX.net is an Privacy Policy, Legal.