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.

Skill Stopping

I know it sounds a little weird, so let me explain.  I have this common event for summoning:

@>Conditional Branch: [Imp] is In the Party
  @>Recover All: [Imp]
  @>Change Party Member: Remove [Imp]
  @>Control Switches: [001] = OFF
:  Else
  @>Conditional Branch: Switch [001] == OFF
      @>Change Party Member: Add [Imp]
      @>Text: I'm at your service, master.
      @>Control Switches: [001] = ON
      @>
  :  Else
      @>Text: You can only have one summoned being out at a time.
      @>Change SP/MP: [Summoner], + 10
  :  Branch End
  @>
:  Branch End
@>

The only problem I have with it is that if a summoned being is already out and the player tries to summon another, they've wasted a turn.  I'd like a script that will detect if a switch is on and keep a player from taking the action so they can choose another action with no consequences.  Thanks for the help!

~Guardian1239
 
That's basically what I've been using the switch for.  The switch, Summoning, is in all of my summon skills so that there can only be one summoned being out at a time.  The only problem arises when the player tries to summon a different creature when another is out, but it's not that it still summons another one.  I have a message that says that there's already another summoned being out, but the player just wasted a turn for a message saying they can't take the action.

~Guardian1239
 
Put the proper ids/numbers in this code and place it just above main in the script editor.
This will disable the skill when the switch is true (the player won't be able to input the command at all).

Code:
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Determine if Skill can be Used
  #     skill_id : skill ID
  #--------------------------------------------------------------------------
  alias summon_skill_can_use? skill_can_use?
  def skill_can_use?(skill_id)
    if skill_id==<put the skill id here>
      if $game_switches[<put the switch id here>]==true
        return false
      end
    end
    # Perform the original call
    return summon_skill_can_use?(skill_id)
  end
end
 
Awesome!  Thank you!  I was also wondering if it's possible to display a text when the skill doesn't work.  Oh, and will this work with multiple skills?  I'm assuming I'd just replace the <put the skill ID here> with something like 31, 32, 33 to allow it to work for multiple skills, but I'd better ask.  Also, is this for XP, VX, or both?

~Guardian1239
 
For the text message i don't think it would be necessary, because the skill will appear in "disabled color" and the player will hear the typical "buzz" when trying to use it.
For multiple skills... you can use a condition like this:
Code:
if [id1,id2,id3,...].include?(skill_id)

This is for XP, but will probably work with VX as well. I haven't had the opportunity to check it out, but i heard that not much has changed between XP and VX.
 
Hm, there seems to be a problem.  Because I have summon/dismiss all in the same skill, the player would be unable to dismiss once they summoned.  It would have to check if the actor being summoned was out already.  If the certain actor linked the that skill is out, then the skill would have to be used still.  Also, the script doesn't work on VX for some reason.

This is all sounding really complicated.  It's not really a huge deal that I have this script; it's more of a luxury, really.  I suggest you test the script with the common event I provided so you can see what's happening if you still want to work on it.  I don't blame you if you're uninterested in continuing.

~Guardian1239
 
I see. Yes, keeping the common event as you designed it, i.e. with a single skill for summoning and for "re-calling" the summoned being, makes things too complicated.
May I suggest you to split the common event in two parts and use two skills? With minor modifications you could use the script i provided and have one of the skill disabled at a time, depending on the summon being out or not.

Do you need this for XP or VX? Because i couldn't find out reading the thread... in either case i will still offer you my support, but I can't work on it until April 1st. See you.
 
Yeah, I originally had it with 2 skills, but it seemed a little confusing.  Hm . . . let me think about it.  I may want to just drop the idea since it's gotten quite complicated.  Oh, and I was looking for something for both XP and VX, which is why I never specified.  I'll post again before April 1 to let you know what I decide.

~Guardian1239
 

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