Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Need some help adding new skills

Save-Point

Full Version: Need some help adding new skills
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So, I've finally gotten serious with RMXP and decided to make an RPG. In the process of making new spells I've come across a few problems, such as:

1. A spell that uses all of your SP.
2. A spell that revives and heals your entire party at the same time.
3. A spell that can only be used outside of battle and is used to get over a certain terrain tag, ignoring passage settings (levitation, swimming)

I'd also like to know if RMXP by default has a good system for stats, since there are lots of buff/debuff spells in my game.

Thanks,
Pia Carrot
I think those can be made with common events.
Just create the effects there and select them from the common event dropdown box.
Number 2 would be 'recover all' then.
Everything you could want to know about RPG Maker XP stats can be found here: http://rpgmaker.net/tutorials/532/

Is it a good system? Ehh.... Kind of! If you know how it works, and maybe change action_order to not be so random it can be very balanced. I don't like how the system is geared towards spell tiers, but some people do.
I figured it would use events, but I didn't see an event request forum.
1. For a skill that takes all of your SP, you want to create a common Event that changes Skill points to 0...


so in the skill, you make it point to your common event that you'll use.

Then in the common event, you want to set a variable to your character's SP and then Get rid of all that SP by changing SP Decrease by that variable. and whammo, your effect will occur and the common event will strip the SP, or add the HP or whatever you need.



and now for 3. Look into a change tileset script. This will allow you to determine passability of a tile on one tileset and not for another. Leon Westbrooke did a nice Tileset swap script online. you should be able to find it easily.
All of those effect can be done in either events or scripts! Let's go over a few.

If you want to be able to walk on certain terrain tags, all you have to do is replace Game_Player's '"passable?" with
Code:
#--------------------------------------------------------------------------
  # * Passable Determinants
  #     x : x-coordinate
  #     y : y-coordinate
  #     d : direction (0,2,4,6,8)
  #         * 0 = Determines if all directions are impassable (for jumping)
  #--------------------------------------------------------------------------
  def passable?(x, y, d)
    # Get new coordinates
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    # If coordinates are outside of map
    unless $game_map.valid?(new_x, new_y)
      # Impassable
      return false
    end
    #if walk-on skill has enabled switch
    if $game_map.terrain_tag(new_x, new_y) == WALKABLE_TAG &&
      $game_switches[WALKABLE_SWTCH] == true
      # Passable
      return true
    end
    # If debug mode is ON and ctrl key was pressed
    if $DEBUG and Input.press?(Input::CTRL)
      # Passable
      return true
    end
    super
  end
If you make a skill that runs a common event to turn on your switch, you can then walk on that terrain tag!


What else... Here is how you can make your skill shows that it uses all SP. Make an edit to "draw_item" in Window_Skill.
Change:
Code:
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
to:
Code:
    if skill.common_event_id == SP_ALL_EVENT_ID
      self.contents.draw_text(x + 232, y, 48, 32, "All", 2)
    else
      self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
    end


Revive and heal and SP All can be done completely through eventing. What I like to do is add this little script snippet to my project
Code:
class Scene_Battle
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :active_battler
  attr_reader :target_battlers
end
And then in you common event you can run a script on the user with
Code:
$scene.active_battler
.
similarly you can run script on all targets. Here is an example.
Code:
for target in $scene.target_battlers
p "Targetting: " + target.name
target.damage = 12
target.damage_pop = true
target.hp -= 12
end
With this code snippet, you can simply put
Code:
$scene.active_battler.sp = 0
in a skill's common event, and it will cost all of a battler's SP (even enemies, which is why I like to do it that way.)

...whew! Lots of words. If you need me to explain anything more in depth, feel free to ask.
Thank you all very much, this has helped a ton.

One more thing regarding spells, I found this "Blow Away" script when I looked at an internet archive of rmxp.org, the thing's old as hell but I'd like to use it, only problem is it seems rather buggy because when I use it, it will say "miss" and then the enemy is "Blown Away" from battle. It also seems to be unavoidable, even to bosses so it's very overpowered. If there's a more modern script that can do this or something that would be awesome.

The Script:
Content Hidden
Next time use the [ code ] [ /code ] tags, it preserves the tab spacing. Not sure how to fix resistances, maybe an elemental check? If it were my script I'd probably apply it as a state but....

Here is a fix for "miss" text.
Code:
class Game_Battler

Blow_Away_Skills = [33]

attr_accessor :hidden_skill

alias before_blow_away_initialize initialize
def initialize
before_blow_away_initialize
@hidden_skill = false
end


alias before_blow_away_skill_effect skill_effect
def skill_effect(user, skill)
if self.hidden
return false
end
if Blow_Away_Skills.include?(skill.id)
@hidden_skill = true
self.current_action.clear
end
result = before_blow_away_skill_effect(user, skill)
if @hidden_skill == true && self.damage.is_a?(String)
self.damage = ""
end
return result
end

end


class Scene_Battle

alias before_blow_away_update_phase4_step5 update_phase4_step5
def update_phase4_step5
before_blow_away_update_phase4_step5
for target in @target_battlers
if target.hidden_skill == true
target.hidden = true
end
end
end

alias before_blow_away_start_phase5 start_phase5
def start_phase5
for actor in $game_party.actors
actor.hidden = false
actor.hidden_skill = false
end
before_blow_away_start_phase5
end

end


class Game_Party

def all_dead?
# If number of party members is 0
if $game_party.actors.size == 0
return false
end
# If an actor is in the party with 0 or more HP
for actor in @actors
if actor.hp > 0 and actor.hidden == false
return false
end
end
# All members dead
return true
end

end
I added code tags to her script, and put in that it was by good ol' Fomar0153. :WINK:
wow, my answer didn't nearly touch the awesomeness of MechanicalPen. Somebody get this guy some points!!!