The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: yuu-fallen on September 02, 2010, 07:44:51 PM

Title: [RMVX] "Transforming" common event to script?
Post by: yuu-fallen on September 02, 2010, 07:44:51 PM
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 ^^
Title: Re: [RMVX] "Transforming" common event to script?
Post by: cozziekuns on September 02, 2010, 10:36:43 PM
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.
Title: Re: [RMVX] "Transforming" common event to script?
Post by: yuu-fallen on September 02, 2010, 11:27:00 PM
Can you tell me how? I'm really a nobbie D:
Title: Re: [RMVX] "Transforming" common event to script?
Post by: cozziekuns on September 02, 2010, 11:37:39 PM
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.

Title: Re: [RMVX] "Transforming" common event to script?
Post by: yuu-fallen on September 03, 2010, 01:17:15 AM
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]
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg826.imageshack.us%2Fimg826%2F4961%2Fmaphud.jpg&hash=522e3e36ff4bbaa9251d24498b59d5479f5568b3)
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg9.imageshack.us%2Fimg9%2F4961%2Fmaphud.jpg&hash=bb3f3ebfed663911d98e1f3b1c8d1defce92f561)[/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 ^^
Title: Re: [RMVX] "Transforming" common event to script?
Post by: cozziekuns on September 03, 2010, 02:02:39 AM
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.
Title: Re: [RMVX] "Transforming" common event to script?
Post by: yuu-fallen on September 03, 2010, 03:38:38 AM
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