RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
VX "When skill is used X times..." battle script

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 57
RPG VX - Project Moonhunter
Dear all,

I hit a bit of a snag in my game. As a feature I would like an enemy to transform only after certain skills are used a number of times. My method so far:
- skill would call upon a common event;
- common event would add +1 to a variable;
- battle event would have conditional branch: if variable reaches x enemy transforms.

 :-\ Unfortunately, it doesn't work. This leads me to conclude that a skill used in battle can't add to variables, OR that even though the variable count is reached, it has no effect on the battle in which it happens.

Hence my question for any of you out there. Is there a way to have certain skills add to a variable/counter - resulting in an enemy transformation after x times used skill?

(bonus points if I can set how many numbers are added to the variable per skill)

I hope to hear from any of you wizards out there. Thank you in advance!
~ Geoff

« Last Edit: September 22, 2012, 11:42:01 AM by Geokoer »
My project:

*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
Events should handle this fine, but VX is known to be a bit glitchy with variable handling.

http://forums.rpgmakerweb.com/index.php?/topic/32-game-interpreter-fix/

This Game Interpreter fix supposedly resolves the glitches, give it a whirl and see if it fixes your issue. If not, post a demo and I'll see what scripting magic I can do :)
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

***
Rep:
Level 57
RPG VX - Project Moonhunter
I replaced the Game Interpreter with the fix; unfortunately it has had no effect.

Considering the file size of my game (50mb+) I've quickly whipped up a new game with the events set as how I use it.

In the original game I use Tankentai sideview with ATB, but this does not interfere with event-processed data. The Transform Test 'game' uses the game's original battle system, and in this it also fails to work.

I've attached the Transform Test file. I didn't add RTP, as I figure you've already got RPG VX 8).

Thank you very much in advance!
My project:

*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
Alright, well your common event is working fine.
The troop event files don't actually use conditional branches like that, so you need to set it at the top.

Unfortunately this doesn't allow variables input, so my workaround is for your common event to turn on a switch if your variable count is equal to three.


So in your common event, do this



And in your troop event do this:




Obviously you can change the event switch :P
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

***
Rep:
Level 57
RPG VX - Project Moonhunter
Hmm. Not a bad idea, this does allow me to control after how many skill uses the enemy transforms.

However, this method prevents me from individually setting when individual enemies transform.
Example: a weak enemy 1 would transform when variable =3, but enemy 2 would transfer when the variable =5; enemy 3 transforms when variable =13, etc.

With the event set as per your example every enemy (reacting to that switch) will transform after a set amount of x points.

In a common event I cannot make a conditional branch saying "if in battle with enemy x, switch on after variable reaches x. Do you think it's possible to set the x individually per enemy?
My project:

*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
Code: [Select]
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#             Transform Enemies based on Variables
#             Version: 1.0
#             Author: DiamondandPlatinum3
#             Date: September 25, 2012
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Description:
#
#    This script allows you to use multiple variables to differentiate when
#    an enemy transforms. The usual method is quite heavy on Game Switches if
#    you wish to use it that way, so this alternative has been created.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#------------------------------------------------------------------------------
#  Instructions:
#     
#     ~  In your Enemy noteboxes input these codes
#           ~TransVarID: ?
#           ~TransReqAmount: ?
#           ~TransNextEnemyID: ?
#           ~TransBattleAnimID: ?
#
#        Replacing the ?'s with a number.
#
#
#         ~TransVarID         = The Variable ID you want to check
#         ~TransReqAmount    = The Required Amount (or above) that the Variable must hold for the conditions to be met
#         ~TransNextEnemyID  = The ID of the enemy you want this enemy to transform into
#         ~TransBattleAnimID = The ID of the Battle Animation you want to see when this enemy transforms (this is not required)
#
#
#        A Visual Explanation can be found
#        Here: http://img4host.net/upload/242013385060a2d2f1c7c.png
#
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
#
#                  THERE IS NO EDITABLE REGION TO THIS SCRIPT
#
#==============================================================================











class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * Basic Update Processing
  #     main : Call from main update method
  #--------------------------------------------------------------------------
  alias dp3_enemynote_transformchecker_ojne832 update_basic
  def update_basic(main = false)
    # Call Original Method
    dp3_enemynote_transformchecker_ojne832(main)
   
    # Call New Function
    dp3_check_enemy_note_for_transform_commands
  end
  #--------------------------------------------------------------------------
  # * Check Enemy Note For Transform Commands
  #--------------------------------------------------------------------------
  def dp3_check_enemy_note_for_transform_commands
    $game_troop.members.each do |game_enemy|
      note = $data_enemies[game_enemy.enemy_id].note
   
      var_id                  = nil
      amount_req              = nil
      transform_id            = nil
      tranform_battle_anim_id = nil
   
     
      note[/~TransVarID: ([-0-9]+)/]
      var_id = $1.to_i if $1
     
      note[/~TransReqAmount: ([-0-9]+)/]
      amount_req = $1.to_i if $1
     
      note[/~TransNextEnemyID: ([-0-9]+)/]
      transform_id = $1.to_i if $1
     
      note[/~TransBattleAnimID: ([-0-9]+)/]
      tranform_battle_anim_id = $1.to_i if $1
     
     
      if var_id && amount_req && transform_id
        if $game_variables[var_id] >= amount_req
          game_enemy.animation_id = tranform_battle_anim_id if tranform_battle_anim_id
          game_enemy.transform(transform_id)
        end # if $game_variables
      end # If not nil
    end # Loop
  end # Function
end # Class

Lets see if this does what you need.
« Last Edit: September 24, 2012, 06:21:17 PM by D&P3 »
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

***
Rep:
Level 57
RPG VX - Project Moonhunter
DiamondandPlatinum3, You are a wizard indeed!  :lol:

I've play-tested your script various times with various settings, and this works like a charm. I'm especially grateful for your addition of which animation to play upon transformation.

Allow me to show a little insight in the mechanics in-game:
One of the characters uses a special kind of magic, which just by being used can destroy the protective 'hide' of demons. Basically, almost every enemy has two forms: a black hide version, and (when it transforms) the true form, with weakened defense.

Your script will allow me to make the battle system a tad bit more interesting. Boss foes will take longer to 'lose' their defense, and some demons may be able to grow it back. This is a core element of my game, both story wise and for the battles.

Thank you so much for creating this. With your permission I'll name you in the credits as a script writer.
My project:

*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
Sure thing ^-^
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3