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.

Newbie Alert! Need Script!

Hi. I'm a noob, in case you didn't know, and I can't script to save my life. @_@ I came here recently and looked at the scripts. Basically, when it comes to scripting, I'm dead last place in that race (Yay, rhyming power!).

For the game I'm making, I need a script that will allow a character to, when self-inflicted with certain status, changes his skill list to something different. For example: He uses a spell that infuses him with fire-elemental power, and learns fire-related spells and attacks. I would use events, but it creates lag in the game on one of my computers (Pentium Three Processor, its ancient...)... I also need the script to allow the character to regain the infusion of element power skills back as soon as the battle is over. Any help is greatly appreciated, and you'll receive full credit, whether you like it or not! XD

Thank you for reading this, by the way. Kinda long-winded, but I love what ideas I came up with...
 
Well, to make things clearer...

1. What characteristics of skills do you want to infuse? Maybe X-elemental skills, healing skills, and so on, or mixture that you want to define on your own?

2. Are the actor's original skills gone temporarily until the status depletes (i.e. you want the status to deplete when the battle is over) or new skills are added instead?

3. After the status depletes, are the infused skills gone for good (until s/he is inflicted that status again) or are added for the rest of the game?
 
It goes without saying, I'm a noobie...

Anyway, to answer your questions:

1. I'd like him to have skills, as long as under the Infusion, that represent the qualities that each element has. (I'm using the eight ones provided for me, they seemed to be a good choice.) For four of the Infusions, he doesn't change into a single element; rather, he becomes two or four of them.

2. Yes, the skills (Infusion ones) disappear and are replaced with new ones. Once the status is gone, the skills should come back. This is the part I can't work, personally. It gets aggravating failing over and over again.

3. The infusion skills come back afterwards.

Sorry about not being too clear... Hopefully this clears up anything. I'm new to RPG Maker XP. I don't know a lot about it, but I appreciate the post. Thanks.
 
Actually though, I still don't understand what you mean (silly me ^_^"). Could you instead give me an example?

Maybe let's use Arshes as an example. Say he has these initial skills: Cross Cut and Heal. We also have a Trance status which will give this Infuse skills as you want. The Infuse skills are Fire and Water. Here's the case:

1. When Arshes is inflicted with Trance status, how will his skill list be? Cross Cut + Heal + Fire + Water, or just Fire + Water (his initial skills disappear temporarily)? I expect this to be the last one.

2. After Arshes has recovered from Trance status, how will his skill list be? So far, I expect it to be Cross Cut + Heal only (Fire + Water disappear).

If my example is wrong, just give another example (clearer one, maybe?). I might want to do it after I have the best understanding of your needs.

Thanks.
 
Its way too obvious that I'm new at this...

Okay, well, lets use Arshes again. He has those skills like you said, and also Trance. He gives himself the status (where he gains the fire and water skills) and his old skills disappear (including Trance). After the battle is done, the status is removed, and he regains the skills he had: Cross Cut, Heal, and Trance, and fire and water disappear. In other words, like you had it, but instead of being inflicted with it from an outside source, he does it himself.

Hope that clears anything up for you. Sorry if I wasn't too clear. To tell you the truth, I didn't think anyone would help me. Thanks.
 
Almost like FF IX's Trance, except that in FF IX Trance is gained by being attacked until a bar fills up. You want it via skill that target one self, don't you?

I got now what you asked for. If I got time, I would do it for you (but unfortunately I'm currently working on my final project on my college; it's due at June this year). I'm really sure you can't wait that long enough...
 
Well, you're lucky, today I have a national holiday so I have more leisure time, and I decided to work on your request. I hope it's correct by your explanations so far; if not, please tell me and I'll work on it again. It's really incredible that it's finished in just 15 minutes! (Now why others wouldn't do it for you for that amount of time? ;))

Just paste this code into a new page in your Script Editor just above Main (instructions are there):

Code:
# -------------------
# SETTINGS BEGIN HERE
# -------------------
# Define here the actor ID and skills that s/he'll gain by infusing
# Follow this format:
#
#                     actor_id => [skill_ids]
#
# where [skill_ids] are skill IDs you want to infuse (separate by comma)
# as example:
INFUSE_SKILLS =
{
1 => [1, 7, 10],
2 => [2, 8, 11]
}
# In the game database,
# make a new skill to inflict Infuse status (name it as you wish)
# Note the skill ID and change the ID below:
INFUSE_SKILL_ID = 81
# Still in the game database,
# make a new state (name it as you wish)
# Note the state ID and change the ID below:
INFUSE_STATE_ID = 17
# -----------------
# SETTINGS END HERE
# -----------------
# Code by Èxsharaèn (2007-03-31)
# Enjoy!

class Game_Actor < Game_Battler
  def skills=(skills)
    @skills = skills
  end
end

class Scene_Battle
  alias infuse_main main
  def main
    # initialize actor's skill
    @skills = Hash.new
    infuse_main
  end
  
  alias infuse_make_skill_action_result make_skill_action_result
  def make_skill_action_result
    infuse_make_skill_action_result
    # actor using Trance skill?
    if @active_battler.current_action.skill_id == INFUSE_SKILL_ID
      if @active_battler.is_a?(Game_Actor)
        # Infuse state inflicted? (In case s/he used that skill but missed
        if @active_battler.state?(INFUSE_STATE_ID)
          # reserve actor's skill
          @skills[@active_battler] = @active_battler.skills
          # remove all skills in active battler
          # and replace them with infuse skills
          @active_battler.skills = INFUSE_SKILLS[@active_battler.id]
        end
      end
    end
  end
  
  alias infuse_battle_end battle_end
  def battle_end(result)
    # change back all actor's skills to original states
    @skills.each { |actor, skills|
      actor.skills = skills
    }
    infuse_battle_end(result)
  end
end

I aliased all methods so it should not interfere with other scripts; tested it and works. But should in any case there are errors, tell me so I can fix it.

Enjoy! :)
 
Thank you so very much. I'm gonna test it ASAP, as soon as I can get on a faster computer... I find it shocking that it was finished in 15 minutes! I'm gonna learn to script now...

In the meantime, thank you. ::tries to test script::

EDIT: It works PERFECT! Thank you. Good luck with college. Thanks again!
 

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