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.

State-based "transformation"

I want my character to have skills available if they have a certain state "inflicted." Let me make a quick example.

For example, let's say Character 1 has a skill called "Bash." And if he has the "Power Up" state inflicted, his "Bash" skill turns into "Greater Bash." The skill "Greater Bash" returns to "Bash" when the state goes away. Think anyone can do it?

And I've been making a lot of requests, haven't I?
 
Is this for XP or VX?
Do you only want to have one state that changes the skills or many states that changes different skills?

Here is an example: State + skill = improved skill
Power up + bash = Greater bash
Frenzy + cross cut = omnislash

OR

Power up + bash = Greater bash
Power up + cross cut = omnislash


What i'm trying to say is, do you want to have one state change one skill, and another state change another skill?
oh, and should this be for all of the party members? or should it just be so that ONLY when actor 1 has power up, bash turns into "Greater Bash"?
Like this:

if Actor1 has state power up:  Bash = Greater Bash
if Actor2 has state power up: bash = bash

This may seem confusing, but i don't know how to explain.. :tongue:
 
Gando":5x9x2oxv said:
Is this for XP or VX?
Do you only want to have one state that changes the skills or many states that changes different skills?

Here is an example: State + skill = improved skill
Power up + bash = Greater bash
Frenzy + cross cut = omnislash

OR

Power up + bash = Greater bash
Power up + cross cut = omnislash


What i'm trying to say is, do you want to have one state change one skill, and another state change another skill?
oh, and should this be for all of the party members? or should it just be so that ONLY when actor 1 has power up, bash turns into "Greater Bash"?
Like this:

if Actor1 has state power up:  Bash = Greater Bash
if Actor2 has state power up: bash = bash

This may seem confusing, but i don't know how to explain.. :tongue:

It's for XP.

And just one state that changes different states. The second example. It can apply for all actors to make it simple.

Basically:

Actor 1:
Power Up + Bash = Greater Bash
Power Up + Cross Cut = Omnislash

Actor 2:
Power Up + Bash = Greater Bash
Power Up + Cross Cut = Omnislash

Like that.
 
You mean like the same as before, but without requiring a skill to begin with?
Should this be affected by the same state, "Power up" or should it have it's own state?

I've begun putting something together, and i'll try to get it done as soon as possible. :thumb:

Over and out - Gando
 
Gando":1a3m3wnx said:
You mean like the same as before, but without requiring a skill to begin with?
Should this be affected by the same state, "Power up" or should it have it's own state?

I've begun putting something together, and i'll try to get it done as soon as possible. :thumb:

Over and out - Gando

Yes, what you said. It can be affected by the same state.
 
Oh crap, sorry..  i forgot all about this :down:
Well, i came up with this rather quickly, and it works, although it DOES have it's limitations.. >.<
The "Transformed" skills should probably not be any skills that the party members can learn permanently, since they will be removed when the certain state inflicted is removed or if they don't have the state inflicted in the first place..
But if you make a skill transformation unique for a certain character then the rest of the characters in the party can have that "transformed" skill
learned permanently, like this :
Code:
    if $game_party.actors[0].state?(9) and $game_party.actors[0].skill_can_use?(7)
      $game_party.actors[0].learn_skill(9)
      $game_party.actors[0].forget_skill(7)
    end

    unless $game_party.actors[0].state?(9) and $game_party.actors[0].skill_can_use?(9)
      $game_party.actors[0].forget_skill(9)
      $game_party.actors[0].learn_skill(7)
    end

This will only affect the leader in the party. Don't worry, i have commented and explained everything inside the script so that you can understand how everything works.

Well anyways, here is the script:
Code:
#==============================================================================
# ** State-Skill Transformation
#------------------------------------------------------------------------------
#  By:Gando
#  27/4 2008
#------------------------------------------------------------------------------
# Introduction: First i would like to say that this can be scripted WAY better,
#               but i'm not sure how to do it. And secondly, the "transformed"
#               skills, should probably not be any skills that the Actor(s) 
#               can learn permanently, since they will be removed whenever the
#               Actor(s) state is removed.
#-----------------------------------------
# 
#  $game_party.actors[id] - Replace "id" with the id of the characters in your
#                           party. 0-3, 0 = first member, 1 = second member etc.
#
#
#  $game_actors[id] - Replace "id" with the id of the actor in the database,1-?.
#                     At default, 1 is Aluxes, 2 is Basil etc.
#
#
#  for actor in $game_party.actors - This will make it so that every actor in 
#                                    the party will learn the skill.
#         
#            Example: actor.learn_skill(4) will make all actors learn "Remedy".
#
#
#  state?(id) - this will check if a certain state is inflicted. Replace "id"
#               with the id of the state in the database.
#
#  $game_party.actors[0].state?(9) - This will check if the first actor in the 
#                                    party has state 9.
#
#  skill_can_use?(id) - this will check if an actor has a certain skill. This  
#                       is used when you want to "transform a skill. if the 
#                       actor has that certain skill and a certain state is 
#                       inflicted, the the skill will "transform". Replace "id"
#                       with the id of the skill in the database.
#
#  $game_party.actors[0].skill_can_use?(7) - This will check if the first actor
#                                            in the party has learned skill 
#                                            number 7 in the database. You can use this
#                                            when you want to "Transform" a skill.
#                                            If the actor can't use the skill,
#                                            then nothing will happen when he is
#                                            inflicted with the state.
#
# if $game_party.actors[0].state?(9) and $game_party.actors[0].skill_can_use?(7)
# 
# This line will check if the first actor has state 9 inflicted AND if he has skill number
# 7 in the database learned, and if both of the statements are true, the skill will 
# "transform". (look further down at my example skills transformations)
#
# unless $game_party.actors[0].state?(9) and $game_party.actors[0].skill_can_use?(9)
# 
# This line will check if the first actor DOESN'T have state 9 AND if he has skill number
# 9 in the database learned, and if both of the statements are true, the skill will 
# "turn back to normal". (look further down at my example skills transformations)
#
#
#  learn_skill(id) - This will make the actor learn the skill. Replace "id" 
#                    with the id of the skill in the database.
#
#  forget_skill(id) - This will make the actor forget the skill. Replace "id"
#                     with the id of the skill in the database.
#
#
#  I've made some example transformations for you. You can take a look at what
#  i've done further down, and maybe you'll understand better on how to set it
#  all up so that it suits you!
#
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Skill effect
  #--------------------------------------------------------------------------
  def skill_effect(user, skill)
    skill_effect = super(user, skill)
    # Skill-Transform 1 transform
    if $game_party.actors[0].state?(9) and $game_party.actors[0].skill_can_use?(7)
      $game_party.actors[0].learn_skill(9)
      $game_party.actors[0].forget_skill(7)
    end
    # Skill-Transform 1 return
    unless $game_party.actors[0].state?(9) and $game_party.actors[0].skill_can_use?(9)
      $game_party.actors[0].forget_skill(9)
      $game_party.actors[0].learn_skill(7)
    end
    
      # Skill-Transform 2 learn
    if $game_actors[2].state?(10) 
      $game_actors[2].learn_skill(58)
    end
      # Skill-Transform 2 return
    unless $game_actors[2].state?(10)
      $game_actors[2].forget_skill(58)
    end
    
      # Skill-Transform 3 
    for actor in $game_party.actors
      unless actor.state?(11)
        actor.forget_skill(59)
      end
      if actor.state?(11)
        actor.learn_skill(59)
      end
    end
    
    #ADD YOUR SKILLS HERE!!!!
    return skill_effect
  end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#
#  Here you add the same things as you did in the class "Game_Actor".
#  If you don't then the skill(s) won't be learned/removed whenever a
#  state is changed on the map.
#
#------------------------------------------------------------------------------
class Scene_Map
  alias gando_update update
  alias gando_main main
  #--------------------------------------------------------------------------
  # * Update
  #--------------------------------------------------------------------------
  def update
    # Skill-Transform 1 return
  unless $game_party.actors[0].state?(9) and $game_party.actors[0].skill_can_use?(9)
    $game_party.actors[0].forget_skill(9)
    $game_party.actors[0].learn_skill(7)
  end
    # Skill-Transform 1 transform
  if $game_party.actors[0].state?(9)
    $game_party.actors[0].learn_skill(9)
    $game_party.actors[0].forget_skill(7)
  end
    # Skill-Transform 2 return
  unless $game_actors[2].state?(10)
    $game_actors[2].forget_skill(58)
  end
    # Skill-Transform 2 transform
  if $game_actors[2].state?(10) 
    $game_actors[2].learn_skill(58)
  end
  for actor in $game_party.actors
    unless actor.state?(11)
      actor.forget_skill(59)
    end
    if actor.state?(11)
      actor.learn_skill(59)
    end
  end
  
  #ADD YOUR SKILLS HERE!!!!
    gando_update
  end
end

Well, as i said, this does have it's limitations and can be done WAAAAAY better.
But maybe someone else will see this and decide to help you out by writing a better script, if not, i guess you'll have to stick with my crappy one :tongue2: :thumb:
And if you have any questions, don't hesitate to ask.

Over and out - Gando
 
Haven't been working for a while. Anyway, it works the way I wanted it. Except for the fact that it doesn't check if the skill is learned.

And, dammit, I forgot to ask to make it level-compatible.

I'm no scripting expert, but using my moderate Visual Basic skills, if I just know how to make a if statement with levels and skill learned, I think I can handle it.
 

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