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.

Executing common event before skill execution

McP

Member

Hi
in the settings for the skills, you can check if you want a common event executed or not.
My problem is, the common event starts after the the skill is performed.
I need my event starting before the skill.
I think i basically just need to put some script part somewhere else..

Help would be highly appreciated
edit: If you could tell me the script part that is responsible for the event execution it would help me a lot too.
 
Insert above Main

Code:
class RPG::Skill
  Pre_Common_Event_ID = {}
  Pre_Common_Event_ID.default = 0
  def pre_common_event_id
    return Pre_Common_Event_ID[@id]
  end
end

class Scene_Battle
  alias_method :seph_preskillcommonevents_scnbtl_msar, :make_skill_action_result
  def make_skill_action_result
    seph_preskillcommonevents_scnbtl_msar
    if @common_event_id > 0
      common_event = $data_common_events[@common_event_id]
      $game_system.battle_interpreter.setup(common_event.list, 0)
    end
  end
end

Just alter this:

Pre_Common_Event_ID = {}

Below that, lets say you want another common event 5 to run when skiil 3 is used. Below that line, add:


Pre_Common_Event_ID[3] = 5

Just do that for all your skills.
 

McP

Member

Sorry to digg this out after such a long time but i took a break in rpg making and so I wasn't active on this board either.

Thanks Sephi' for looking at this and thanks for your script, but theres still one problem. Your script works as far as the common event is executed when the skill is selected, but the skill itself is not.
In simple words: Instead of the skill, the common event occurs, but what i need is Common Event, then Skill!

The reason why i need this is, to fade out the battler gfx before a certain skill is performed e.g Ultima which would cover the whole screen and damage everyone near it. So the battlers need to disappear for some time.
 

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