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
> Change Class/Skills With Weapon
Logan110
post Jan 18 2010, 12:46 AM
Post #1


Level 15
Group Icon

Group: Revolutionary
Posts: 271
Type: Event Designer
RM Skill: Advanced




I believe I can get this done with a common event using a conditional branch, but I'm not sure when to call the common event.


__________________________
Fishing Tutorial - Twitch Skill

[Show/Hide] Picture

Waiting for that event sub forum...

Go to the top of the page
 
+Quote Post
   
Ale Goth
post Jan 18 2010, 01:25 AM
Post #2


Darkness Is But A Good Thing. Use It wisely.
Group Icon

Group: Revolutionary
Posts: 138
Type: Writer
RM Skill: Advanced




Make an auto-run event to to turn a switch on...for example "Club On" <-Switch Name
Don't turn the switch off at anytime while using the Club or you'll keep the class regardless.
Make a Common Event and call it "Club On" (Or Whatever). Trigger=Parallel, Condition Switch= "Club On"
What to put in...
CODE
@>Conditional Branch([Character]=[Weapon] Equipped)
       @>Change Actor Class: [Character], [Class]
       @>
: Else
       @>Change Actor Class: [Character], [Normal Class]
       @>
: Branch End
@>


Now every time you equip the club you'll change class. No need to call the common event.
Class change won't occur until you exit the menu screen.
laugh.gif


__________________________
COMPLICATED is my middle name!
~I am formerly known as Hatredlust. My new name Is Ale Goth :)
Long live the...!


Go to the top of the page
 
+Quote Post
   
Logan110
post Jan 18 2010, 01:52 AM
Post #3


Level 15
Group Icon

Group: Revolutionary
Posts: 271
Type: Event Designer
RM Skill: Advanced




I thought having a lot of parallel process's running at once caused the game to run slow, thats why I thought I shouldnt use that. I'll have to have one of these running for each character.


__________________________
Fishing Tutorial - Twitch Skill

[Show/Hide] Picture

Waiting for that event sub forum...

Go to the top of the page
 
+Quote Post
   
Ale Goth
post Jan 18 2010, 02:12 AM
Post #4


Darkness Is But A Good Thing. Use It wisely.
Group Icon

Group: Revolutionary
Posts: 138
Type: Writer
RM Skill: Advanced




If this helps at all, you can have "Wait" for like 30-60 frames so it doesn't constantly update, but instead only update every second. That wouldn't really affect play unless you change class and start a battle in under a second. I highly doubt that though huh.gif
Yes you would need one for every character, so 4 characters would mean four pages of common events. Then just add a second or two of "Wait" and the lag won't happen most likely.
Hope that helps a little happy.gif


__________________________
COMPLICATED is my middle name!
~I am formerly known as Hatredlust. My new name Is Ale Goth :)
Long live the...!


Go to the top of the page
 
+Quote Post
   
Unka Josh
post Jan 18 2010, 07:16 AM
Post #5


Level 32
Group Icon

Group: Revolutionary
Posts: 771
Type: Developer
RM Skill: Skilled




You don't actually need one for every character-- you can put all the Conditional Branches on one page.

In theory, there's another way, if you don't mind not having access to the weapon-tied skills when you aren't in a fight. If that would work for you, let me know.
Go to the top of the page
 
+Quote Post
   
Logan110
post Jan 18 2010, 02:05 PM
Post #6


Level 15
Group Icon

Group: Revolutionary
Posts: 271
Type: Event Designer
RM Skill: Advanced




I'll take what ever you have to offer. I'm still debating if and how to use this.


__________________________
Fishing Tutorial - Twitch Skill

[Show/Hide] Picture

Waiting for that event sub forum...

Go to the top of the page
 
+Quote Post
   
Unka Josh
post Jan 18 2010, 03:20 PM
Post #7


Level 32
Group Icon

Group: Revolutionary
Posts: 771
Type: Developer
RM Skill: Skilled




Okay, make one common event that does the "If character X has weapon Y equipped, learn skill Z" bit. Don't make it parallel process.

Make it called on turn 0 of every battle by putting it in all the Troops sections.

Then, to remove them (and allow for characters to change equipment), have a common event remove all of the equipment skills from everyone by using this totally awesome, and very useful, script that Night_Runner made:

[Show/Hide] Nightrunner's work, not mine
CODE
#==============================================================================
# ** Night_Runner's After Battle Events script
#------------------------------------------------------------------------------
# Date Created: 15/Jan/09
# Created for: Unka Josh
# @> http://www.rpgrevolution.com/forums/index.php?showtopic=38572
#
# DESCRIPTION:
#  This script is designed to call a common event after every battle.
#
# USAGE:
#  To insert this script, go to Tools >> Script Editor. On the left
#   scroll down to Main, right click on Main and select insert. Paste this
#   code on the right.
#  To select which common event this script calls after battle, go down to
#   line 28. By default this script runs common event #20, change the 20 to
#   the common event number you want to call.
#  
#==============================================================================



#==============================================================================
# CUSTOMIZATION:
#==============================================================================

module NR_AFTER_BATTLE
  COMMON_EVENT_ID = 20       # The ID of the common event to call
  HIDE_RESULTS_WINDOW = true # Hide the results window while running
                             #   the common event?
end

#==============================================================================
# END OF CUSTOMIZATION.
#==============================================================================



#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  Edited to not call the battle_end until the interpreter has stopped running.
#  - Forces the interpreter to run a common event at the end of each battle
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Alias Methods
  #--------------------------------------------------------------------------
  alias nr_common_after_battle_battle_end     battle_end
  alias nr_common_after_battle_update_phase5  update_phase5
  #--------------------------------------------------------------------------
  # * Battle End Script
  #--------------------------------------------------------------------------
  # alias nr_common_after_battle_battle_end     battle_end
  def battle_end(cond)
    # Run as usual unless win
    return nr_common_after_battle_battle_end(cond) unless cond == 0
    # Set up event
    $game_temp.forcing_battler = nil
    common_event = $data_common_events[NR_AFTER_BATTLE::COMMON_EVENT_ID]
    $game_system.battle_interpreter.setup(common_event.list, 0)
    # Set a switch if the game has tried calling a battle end before.
    @tried_battle_ending = true
    # Dispose the result window (gold += ..., exp += ...)
    if NR_AFTER_BATTLE::HIDE_RESULTS_WINDOW
      @result_window.dispose
      @result_window = nil
    end
  end
  #--------------------------------------------------------------------------
  # * Update Phase 5
  #--------------------------------------------------------------------------
  # alias nr_common_after_battle_update_phase5  update_phase5
  def update_phase5(*args)
    # create the @tried_battle_ending switch
    @tried_battle_ending = false if @tried_battle_ending.nil?
    # If the game has tried sucessfully winnind
    if @tried_battle_ending
      # If battle event is running
      if $game_system.battle_interpreter.running?
        return
      end
      # Call the original battle end
      nr_common_after_battle_battle_end(0)
      return
    end
    # Call the original update_phase5
    nr_common_after_battle_update_phase5(*args)
  end
end


#==============================================================================
# END OF SCRIPT
#==============================================================================
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: 24th May 2013 - 07:47 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker