RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

[RMVX] "Transforming" common event to script?

Started by yuu-fallen, September 02, 2010, 07:44:51 PM

0 Members and 1 Guest are viewing this topic.

yuu-fallen

Is there any way to someone "transform" (or help me to do it) a common event to script?
I have a common event based on pictures that a friend made for me, I would like to transform it to script, so I can use it in battle and map..

Can you help me?
thanks in advance ^^

cozziekuns

It's pretty easy, since RMVX's interpreter has all the methods that events have in it already. But you'll have to do it manually.

yuu-fallen


cozziekuns

No real way. You just have to look through interpreter and change the methods. For example, Control Timer is:


  #--------------------------------------------------------------------------
  # * Control Timer
  #--------------------------------------------------------------------------
  def command_124
    if @params[0] == 0  # Start
      $game_system.timer = @params[1] * Graphics.frame_rate
      $game_system.timer_working = true
    end
    if @params[0] == 1  # Stop
      $game_system.timer_working = false
    end
    return true
  end


Just get rid of the def command_124, and alter the @params to your liking.


yuu-fallen

#4
I'm not sure if you understood what I said..
I will upload an image for you too see what I meant..
Well I will try to explain in a more detailed way ^^
[spoiler]

[/spoiler]

This HUD made in common event, is based on images.. It moves, but when the actor takes a certain amount of damage the HUD changes it's images to Yellow.. then when he is in critical mode to Orange. If he's Dead the HUD is Red.

What I want to do is:
"HUD" changes according do damage inflicted on actor, but not by variables.. I need it to take the "real" HP of the actor. Let's say: If Actor's HP is at 50% then the HUD will turn to Yellow. If its a 20% it will turn to orange.
Also I want it to be affected by skills, let's say that the actor is poisoned, the HUD changes to purple..
Always with images to have the effect of animated..
that's why I need it in script... Also I want to put that HUD in battle..
For what I've seen/heard, that could only be made in script.. But I am too weak at scripting...

Can you help me?
Is really in Game_interpreter?
Thank you ^^

cozziekuns

Yeah, you could do it in Game_Interpreter, since every event is interpreted through it's methods, but you could just use this:


module COZZIEKUNS
  module COMMON_EVENT_IN_BATTLE
    COMMON_EVENT_ID = 1
  end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  alias coz_common_event_in_battle_start start
  def start
    coz_common_event_in_battle_start
    $game_temp.common_event_id = COZZIEKUNS::COMMON_EVENT_IN_BATTLE::COMMON_EVENT_ID
  end
end


But I think with some clever eventing you could put it in there with pure events.

yuu-fallen

Ok, I will try in game_Interpreter then.
Well, this is hard to explain... How can I put "real damage" instead of Conditional Branches?
What I want to say is, when an enemy attacks the HP drops.
It's better to send a demo for you too see perhaps..
thanks