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.

Need to know the following event commands in RGSS

Taylor

Sponsor

#==============================================================================
# â–  Scene_Scripting_Help
#------------------------------------------------------------------------------
# This post defines the difficulties Jirbytaylor is having with RGSS
#==============================================================================


class Scene_Scripting_Help #LOL

def main

draw.text =

I've been tinkering with the Pokémon Starter Kit, I've solved one of the lags, (I don't know how I did though,) and I'v created a battle intro in Pokémon style.
But it's using common events.

I need to know the following event commands in RGSS:

Unrealted
-Changing the hero sprites (for running script), but the sprites should only change during movement.

Battle Intro
-Conditional Branch for switches and variables.
Here is where I'm really stumped- "if $game_variables[4] = 0" should be if variable 4 is = to 0 right? It's seems to be acting more like "$game_variables[4] = 0", setting the variable, not checking if.
(This was not in an atempt with the intro, but with some scripts from the starter kit.

-Memorize BGM

-Wait

-Change Screen Tone

-Prepare for Transition

-Show Picture / Erase Screen
I've been using a black picture in the intro, but what I really want is something that completly blackens the screen. ..."@spriteset.dispose" perhaps?

-Variable set to random

Would I add these directly below "def call_battle" in Scene_Map, moving "$game_system.bgm_play($game_system.battle_bgm)" above the new script?

Leave Battle

-Restore BGM

-Stop ME

-Erase Picture (if another method is used in intro, fade to black before showing map)

I tried to stop the BGM and ME, but it only worked under a certain battle condition, where should I put the following to make it affect win, loss, loss but continue and escape?

---------------------

I'd like to point out that you don't need the starter kit to help me, the following areas have not be changed much.

Thanks in advance.


end #LOLx2
 
Noone ignores your topics, you just have syntax errors in the one above, so noone of the RGSS-Freakx here can read it ^_^ (Points for originality for the first post, but accusing people here to ignore you won't get you any further most of the time ...)

A basic rule for converting event commands to RGSS code is to look in Interpreter class. This is where the event commands are 'converted' (interpreted, to be exact, but informally) to RGSS. In Interpreter 1 (or 2, just look for it), there's a list of the event commands with comments behind them, telling you which number is which event command. Now just look for the definition with this number behind and extract the code.
 

Taylor

Sponsor

I thought I'd try the common event call script, but how do I use it?
Would "common_event = $data_common_events[01[1]]" call the CE at id 1? Because it's not working. :< Nothing happens.
 

Taylor

Sponsor

Sorry. Here we go, the script that contains entry and exit from battle:
Code:
#==============================================================================
# ** Battle Intro / Exit
#------------------------------------------------------------------------------
#  Defines the special transitions for the entry and exit of battle.
#==============================================================================
class Scene_Map
  #--------------------------------------------------------------------------
  # * Battle Call
  #--------------------------------------------------------------------------
  def call_battle
    #Call Common Event 01
    common_event = $data_common_events[01[1]]
    # Clear battle calling flag
    $game_temp.battle_calling = false
    # Clear menu calling flag
    $game_temp.menu_calling = false
    $game_temp.menu_beep = false
    # Straighten player position
    $game_player.straighten
    # Memorize map BGM and stop BGM
    $game_temp.map_bgm = $game_system.playing_bgm
    $game_system.bgm_stop
    # Play battle start SE
    $game_system.se_play($data_system.battle_start_se)
    # Play battle BGM
    $game_system.bgm_play($game_system.battle_bgm)
    # Make encounter count
    $game_player.make_encounter_count
    # Switch to battle screen
    $scene = Scene_Battle.new
  end
end

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Battle Ends
  #--------------------------------------------------------------------------
  def battle_end(result)
    # Clear in battle flag
    $game_temp.in_battle = false
    # Clear entire party actions flag
    $game_party.clear_actions
    # Remove battle states
    for actor in $game_party.actors
      actor.remove_states_battle
    end
    # Clear enemies
    $game_troop.enemies.clear
    # Call battle callback
    if $game_temp.battle_proc != nil
      $game_temp.battle_proc.call(result)
      $game_temp.battle_proc = nil
    end
    # Switch to map screen
    $pkmn.show_pkmn = false
    $scene = Scene_Map.new
    #Call Common Event 02
    common_event = $data_common_events[02[2]]
  end
end
"$pkmn.show_pkmn = false" is a PKMN Starter Kit line, remove this if you are going to try yourself.
 
I wonder what event you possibly could've set there... why not use battle event commands?
And I believe the problem is that common events are to be called on map and nowhere else. I also wonder why ever call a common event per script, 'cause you could script everything the common event contains and it'd be even faster than processing a common event call.
 
wrong you have to call the common event using $game_system.map_interpreter in Scene_Map and $game_system.battle_interpreter in Scene_Battle

here an example I created an Interpreter class for other Scenes
Code:
    common_event = $data_common_events[1]
    $game_system.scene_interpreter.setup(common_event.list, 0)
 
As far as I can see, you try to do a to-black transition (Trebor777 released a script to do that automatically) and do random battlefades ... all that can be more easily done with scripts than you did it...
 

Taylor

Sponsor

(Because my previous post didn't edit, I'll repost it.)
If I remove the common event line from Scene_Battle, the into plays after the battle. (The end of battle CE would normally cancel this.)

So the reason nothing is happening, is because I need to make the script wait for the CE to finish before continuing.
 

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