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 needs help to modify

Im trying to get the second character in my party to change after a certian level and its not working with this script... also i would like to add and take away skills at the levels two, and i would like to change class of this character. can you help???

heres the script:
#----------------
# Level: Character Graphic Change
#----------------
class Scene_Map
# This is for aliasing the code to Scene_Map
alias levelgraphicchange_update update
def update

# $game_actors[ACTOR ID].level.between?(MIN LEVEL, MAX LEVEL)
if $game_actors[1].level.between?(6, 15)
# $game_party.actors[ACTOR ID].set_graphic("CHARSET FILE NAME", HUE, BATTLER, HUE)
$game_party.actors[0].set_graphic("002-Fighter02", 0, "002-Fighter02", 0)
# Update the graphic
$game_player.refresh
end

# $game_actors[ACTOR ID].level.between?(MIN LEVEL, MAX LEVEL)
if $game_actors[1].level.between?(16, 30)
# $game_party.actors[ACTOR ID].set_graphic("CHARSET FILE NAME", HUE, BATTLER, HUE)
$game_party.actors[0].set_graphic("003-Fighter03", 0, "002-Fighter02", 0)
# Update the graphic
$game_player.refresh
end

# $game_actors[ACTOR ID].level.between?(MIN LEVEL, MAX LEVEL)
if $game_actors[1].level.between?(31, 50)
# $game_party.actors[ACTOR ID].set_graphic("CHARSET FILE NAME", HUE, BATTLER, HUE)
$game_party.actors[0].set_graphic("004-Fighter04", 0, "002-Fighter02", 0)
# Update the graphic
$game_player.refresh
end

# $game_actors[ACTOR ID].level.between?(MIN LEVEL, MAX LEVEL)
if $game_actors[1].level.between?(51, 77)
# $game_party.actors[ACTOR ID].set_graphic("CHARSET FILE NAME", HUE, BATTLER, HUE)
$game_party.actors[0].set_graphic("005-Fighter05", 0, "002-Fighter02", 0)
# Update the graphic
$game_player.refresh
end
levelgraphicchange_update
end
end
 
Well, let's see...

You defined a :change_hero_name => "My new name here" in every minimum level you want to change name (e.g. level 2). Now, in def check_actor_for_changes, within if ACTOR_TO_CHANGE[pos].has_key?(actor.level) block, you should check, at that level, if ACTOR_TO_CHANGE[pos][actor.level], which I've shortened it to temp, has a key named :change_hero_name. You can check if a hash has a key or not by using temp.has_key?(key_to_be_searched) syntax.
If temp has that key, it means the actor needs name change. You can simply change his/her name by using actor.name = temp[:change_hero_name].

Try to do that first. If you still can't do it, open up the spoiler below.

Code:
            # Need name change?
            if temp.has_key?(:change_hero_name)
              actor.name = temp[:change_hero_name]
            end
or you can simplify it to one line like this:
Code:
 actor.name = temp[:change_hero_name] if temp.has_key?(:change_hero_name)

Using the same method, actually you can clean up my code a little bit so you won't need :change_chara_graph, :change_class, and :change_skill anymore. I'll leave that to you ;)
 
Sorry it took so long for me to get back to you... wasn't able to test it... i love it!!! works like a charm now!!!

now i just need to do the animation to show on the second character... im gonna look into 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