Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Script Request to make Skill work

Noru

Member

I just edited this topic from my old request for a Temporary skill effect to a Script Request. Well anyways, I requesting a script that will allow the autorun and parallel triggers in Common Events to work in battles as well. Thanks to Guardian1239, I got the skill working using events but the problem is when the timer hits 0:00, the whole battle ends and need a script to stop that from happening. If you do not follow, heres my old request:

I wasn't sure where to post this since I'm not sure if you need a script for it or if it can be done with common events.

Anyways there has been something I have been trying to do. (RPG Maker XP) I have tried Common Events but I guess I  didn't set it up right, but anyways I have been trying to create a Skill that increases all stats, changes the battlers graphic and last for 2 minutes. After 2 minutes everything should go back to the way it was before the skill was used.

Anyways can anyone help me with this. Maybe create a Demo with a skill that can do what I asked, the Common Events set up (If Needed) and etc...
Any help would be great and sorry if this is the wrong forum for this

And heres the reply I got to it which worked but with that timer problem:
Guardian1239":2q8r47rp said:
OK, here's what you do.  This involves states, skills, switches, and common events, so it takes a little while to set up.

1. Add two new common events.  The first will activate with the skill and the second will run parallel to change the character back.  I changed him to the thief 3 graphic, but you can use whatever graphic you want.  You'll need to create a switch in this.

Common Event 1:
Trigger: None
@>Conditional Branch: Switch [0001: Skill Used] == OFF
  @>Change Actor Graphic: [Aluxes], 018-Thief03, 0, 018-Thief03, 0
  @>Control Timer: Startup (2 min. 0 sec.)
  @>Control Switches: [0001: Skill Used] = ON
:  Else
  @>Text: You're already powered up!

2. Next you'll need to create a state.  Besides being useful for the event, the state will increase the character's stats.  Go into the state tab and create a new one, calling it whatever you want.  Set the restriction to None and check Nonresistance.  Then, you can change the percentages to whatever amount you want to increase each stat.  I'm assuming you wanted the state and graphic to go back after battle, so you should check Release at End of Battle.

3. Again, I'm assuming you want him to change back after battle.  If not, you can remove the first conditional branch.  [Super] is the state you made, but you don't have to use that name.

Common Event 2:
Trigger: Parallel, Condition Switch: 0001: Skill Used
@>Conditional Branch: [Aluxes] is [Super] inflicted
  @>Conditional Branch: Timer 0 min 0 sec or less
      @>Change State: [Aluxes], - [Super]
      @>Change Actor Graphic: [Aluxes], 001-Fighter01, 0, 001-Fighter01, 0
      @>Control Switches: [0001: Skill Used] = OFF
      @>Control Timer: Stop
      @>
  :  Branch End
  @>
:  Else
  @>Change Actor Graphic: [Aluxes], 001-Fighter01, 0, 001-Fighter01, 0
  @>Control Switches: [0001: Skill Used] = OFF
  @>Control Timer: Stop
  @>
:  Branch End
@>

4. Now, create the skill.  Set the scope to The User, set the occasion to Only in Battle if you so desire, and attach the first common event to the skill.  Then, under State Change, add Super.  You can change the rest, like the SP, name, etc.

~Guardian1239
This idea works well but like I said earlier, when the timer hits 0:00, The battle ends because both autorun and parallel operation are valid only on the map screen. This means it will try to run on the map, which cancels the battle.

If you get what I'm trying to say any help would be great.
 
OK, here's what you do.  This involves states, skills, switches, and common events, so it takes a little while to set up.

1. Add two new common events.  The first will activate with the skill and the second will run parallel to change the character back.  I changed him to the thief 3 graphic, but you can use whatever graphic you want.  You'll need to create a switch in this.

Common Event 1:
Trigger: None
@>Conditional Branch: Switch [0001: Skill Used] == OFF
  @>Change Actor Graphic: [Aluxes], 018-Thief03, 0, 018-Thief03, 0
  @>Control Timer: Startup (2 min. 0 sec.)
  @>Control Switches: [0001: Skill Used] = ON
:  Else
  @>Text: You're already powered up!

2. Next you'll need to create a state.  Besides being useful for the event, the state will increase the character's stats.  Go into the state tab and create a new one, calling it whatever you want.  Set the restriction to None and check Nonresistance.  Then, you can change the percentages to whatever amount you want to increase each stat.  I'm assuming you wanted the state and graphic to go back after battle, so you should check Release at End of Battle.

3. Again, I'm assuming you want him to change back after battle.  If not, you can remove the first conditional branch.  [Super] is the state you made, but you don't have to use that name.

Common Event 2:
Trigger: Parallel, Condition Switch: 0001: Skill Used
@>Conditional Branch: [Aluxes] is [Super] inflicted
  @>Conditional Branch: Timer 0 min 0 sec or less
      @>Change State: [Aluxes], - [Super]
      @>Change Actor Graphic: [Aluxes], 001-Fighter01, 0, 001-Fighter01, 0
      @>Control Switches: [0001: Skill Used] = OFF
      @>Control Timer: Stop
      @>
  :  Branch End
  @>
:  Else
  @>Change Actor Graphic: [Aluxes], 001-Fighter01, 0, 001-Fighter01, 0
  @>Control Switches: [0001: Skill Used] = OFF
  @>Control Timer: Stop
  @>
:  Branch End
@>

4. Now, create the skill.  Set the scope to The User, set the occasion to Only in Battle if you so desire, and attach the first common event to the skill.  Then, under State Change, add Super.  You can change the rest, like the SP, name, etc.

~Guardian1239
 
Ah, I found the problem.  When you right click What's this? on trigger, it says at the bottom, "Both autorun and parallel operation are valid only on the map screen."  This means it will try to run on the map, which cancels the battle.  The only way to fix this would be to implement a script.  I tried my best with events.  If you want to implement it without the graphic change for now, you can just use the state, which you can set to terminate after a number of turns.

~Guardian1239
 

Noru

Member

Yeah, I can do it that way for now. I guess I can request a script to make it possible to work. Thing is, should I make a new topic for just edit this one with a new title? Anyways Thanks
 
What if.....

we implement a second "super_timer"

Code:
class Game_System
  attr_accessor :super_timer
  alias super_timer_init initialize
  
  #--------------------------------------------------------------------------
  # Initialize the super_timer
  #--------------------------------------------------------------------------
  def initialize
    super_timer_init
    @super_timer = 0
  end
  #--------------------------------------------------------------------------
  # * reset_hero - Configure your hero here
  #--------------------------------------------------------------------------
  def reset_hero
    ###
    # Reset the char & battler graphics to their database settings.
    # Change to 
    # char = "001-Fighter01"
    # to specify an explicit filename. Same for btlr.
    ###
    char = $data_actors[1].character_name
    btlr = $data_actors[1].battler_name
    $game_party.actors[0].set_graphic(char, 0, btlr, 0)
    ###
    # remove the state. Set '17' to the state # you are using
    # NOTE: in battle the state change will not appear until the
    # battle status window refreshes. (after you choose actions)
    ###
    $game_party.actors[0].remove_state(17)
    $game_player.refresh
  end
  #--------------------------------------------------------------------------
  # * Frame Update - with super_timer added
  #--------------------------------------------------------------------------
  def update
    # reduce timer by 1
    if @timer_working and @timer > 0
      @timer -= 1
    end
    if @super_timer > 0
      @super_timer -= 1
    end
    if @super_timer == 1
      reset_hero
    end
  end  
  #--------------------------------------------------------------------------
  # Set the super timer. Converts seconds to frames
  #--------------------------------------------------------------------------
  def super_timer=(seconds)
    @super_timer = seconds * Graphics.frame_rate
  end
end

Instead of the "@>Control Timer: Startup (2 min. 0 sec.)", use
$game_system.super_timer = 120      # in seconds.
to start the super_timer

Be Well

Ref: Junk2
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top