Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> So, do you love RGSS3 yay nor nay?
Rukiri
post Dec 31 2011, 09:25 PM
Post #1


emerge -avt awesome! Wait... it brings me.... HERE?!
Group Icon

Group: Revolutionary
Posts: 1,717
Type: Scripter
RM Skill: Advanced




With ace being released a little over 2 weeks now what's your thoughts on RGSS3? Has things changed for the better or are there things you preferred in rgss1 or 2?

One noticeable change is game event and game character, most are identical to there vx counterpart's but game_event seems to have been simplified for the better.

RGSS
CODE
class Game_Event < Game_Character
# ------------------------------------
  attr_reader   :trigger
  attr_reader   :list
  attr_reader   :starting
# ------------------------------------
  def initialize(map_id, event)
    super()
    @map_id = map_id
    @event = event
    @id = @event.id
    @erased = false
    @starting = false
    moveto(@event.x, @event.y)
    refresh
  end
# ------------------------------------
  def clear_starting
    @starting = false
  end
# ------------------------------------
  def over_trigger?
    if @character_name != "" and not @through
      return false
    end
    unless $game_map.passable?(@x, @y, 0)
      return false
    end
    return true
  end
# ------------------------------------
  def start
    if @list.size > 1
      @starting = true
    end
  end
# ------------------------------------
  def erase
    @erased = true
    refresh
  end
# ------------------------------------
  def refresh
    new_page = nil
    unless @erased
      for page in @event.pages.reverse
        c = page.condition
        if c.switch1_valid
          if $game_switches[c.switch1_id] == false
            next
          end
        end
        if c.switch2_valid
          if $game_switches[c.switch2_id] == false
            next
          end
        end
        if c.variable_valid
          if $game_variables[c.variable_id] < c.variable_value
            next
          end
        end
        if c.self_switch_valid
          key = [@map_id, @event.id, c.self_switch_ch]
          if $game_self_switches[key] != true
            next
          end
        end
        new_page = page
        break
      end
    end
    if new_page == @page
      return
    end
    @page = new_page
    clear_starting
    if @page == nil
      @tile_id = 0
      @character_name = ""
      @character_hue = 0
      @move_type = 0
      @trigger = nil
      @list = nil
      @interpreter = nil
      return
    end
    @tile_id = @page.graphic.tile_id
    @character_name = @page.graphic.character_name
    @character_hue = @page.graphic.character_hue
    if @original_direction != @page.graphic.direction
      @direction = @page.graphic.direction
      @original_direction = @direction
      @prelock_direction = 0
    end
    if @original_pattern != @page.graphic.pattern
      @pattern = @page.graphic.pattern
      @original_pattern = @pattern
    end
    @opacity = @page.graphic.opacity
    @blend_type = @page.graphic.blend_type
    @move_type = @page.move_type
    @move_speed = @page.move_speed
    @move_frequency = @page.move_frequency
    @move_route = @page.move_route
    @move_route_index = 0
    @move_route_forcing = false
    @walk_anime = @page.walk_anime
    @step_anime = @page.step_anime
    @direction_fix = @page.direction_fix
    @through = @page.through
    @always_on_top = @page.always_on_top
    @trigger = @page.trigger
    @list = @page.list
    @interpreter = nil
    if @trigger == 4
      @interpreter = Interpreter.new
    end
    check_event_trigger_auto
  end
# ------------------------------------
  def check_event_trigger_touch(x, y)
    if $game_system.map_interpreter.running?
      return
    end
    if @trigger == 2 and x == $game_player.x and y == $game_player.y
      unless over_trigger?
        start
      end
    end
  end
# ------------------------------------
  def check_event_trigger_auto
    if @trigger == 2
      if @x == $game_player.x and @y == $game_player.y and over_trigger?
        start
      end
    end
    if @trigger == 3
      start
    end
  end
# ------------------------------------
  def update
    super
    check_event_trigger_auto
    if @interpreter != nil
      unless @interpreter.running?
        @interpreter.setup(@list, @event.id)
      end
      @interpreter.update
    end
  end
end

RGSS3
CODE
#==============================================================================
# â–  Game_Event
#------------------------------------------------------------------------------
#  イベントを扱ã�†ã‚¯ãƒ©ã‚¹ã�§ã�™ã€‚æ�¡ä»¶åˆ¤å®šã�«ã‚ˆã‚‹ã‚¤ãƒ™ãƒ³ãƒˆãƒšãƒ
¼ã‚¸åˆ‡ã‚Šæ›¿ã�ˆã‚„ã€�並列処ç�†
# イベント実行���機能を����り�Game_Map クラス�内部�使用�れ��。
#==============================================================================
class Game_Event < Game_Character
  #--------------------------------------------------------------------------
  # â—� 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :trigger                  # トリガー
  attr_reader   :list                     # 実行内容
  attr_reader   :starting                 # 起動中フラグ
  #--------------------------------------------------------------------------
  # â—� オブジェクトåˆ�期化
  #     event : RPG::Event
  #--------------------------------------------------------------------------
  def initialize(map_id, event)
    super()
    @map_id = map_id
    @event = event
    @id = @event.id
    moveto(@event.x, @event.y)
    refresh
  end
  #--------------------------------------------------------------------------
  # â—� 公開メンãƒ�変数ã�®åˆ�期化
  #--------------------------------------------------------------------------
  def init_public_members
    super
    @trigger = 0
    @list = nil
    @starting = false
  end
  #--------------------------------------------------------------------------
  # â—� é�žå…¬é–‹ãƒ¡ãƒ³ãƒ�変数ã�®åˆ�期化
  #--------------------------------------------------------------------------
  def init_private_members
    super
    @move_type = 0                        # 移動タイプ
    @erased = false                       # 一時消去フラグ
    @page = nil                           # イベントページ
  end
  #--------------------------------------------------------------------------
  # â—� キャラクターã�¨ã�®è¡�çª�判定
  #--------------------------------------------------------------------------
  def collide_with_characters?(x, y)
    super || collide_with_player_characters?(x, y)
  end
  #--------------------------------------------------------------------------
  # â—� プレイヤーã�¨ã�®è¡�çª�判定(フォロワーをå�«ã‚€ï¼‰
  #--------------------------------------------------------------------------
  def collide_with_player_characters?(x, y)
    normal_priority? && $game_player.collide?(x, y)
  end
  #--------------------------------------------------------------------------
  # â—� ロック(実行中ã�®ã‚¤ãƒ™ãƒ³ãƒˆã�Œç«‹ã�¡æ­¢ã�¾ã‚‹å‡¦ç�†ï¼‰
  #--------------------------------------------------------------------------
  def lock
    unless @locked
      @prelock_direction = @direction
      turn_toward_player
      @locked = true
    end
  end
  #--------------------------------------------------------------------------
  # â—� ロック解除
  #--------------------------------------------------------------------------
  def unlock
    if @locked
      @locked = false
      set_direction(@prelock_direction)
    end
  end
  #--------------------------------------------------------------------------
  # â—� å�œæ­¢æ™‚ã�®æ›´æ–°
  #--------------------------------------------------------------------------
  def update_stop
    super
    update_self_movement unless @move_route_forcing
  end
  #--------------------------------------------------------------------------
  # â—� 自律移動ã�®æ›´æ–°
  #--------------------------------------------------------------------------
  def update_self_movement
    if near_the_screen? && @stop_count > stop_count_threshold
      case @move_type
      when 1;  move_type_random
      when 2;  move_type_toward_player
      when 3;  move_type_custom
      end
    end
  end
  #--------------------------------------------------------------------------
  # â—� ç”»é�¢ã�®å�¯è¦–領域付近ã�«ã�„ã‚‹ã�‹åˆ¤å®š
  #     dx : ç”»é�¢ä¸­å¤®ã�‹ã‚‰å·¦å�³ä½•マス以内を判定ã�™ã‚‹ã�‹
  #     dy : ç”»é�¢ä¸­å¤®ã�‹ã‚‰ä¸Šä¸‹ä½•マス以内を判定ã�™ã‚‹ã�‹
  #--------------------------------------------------------------------------
  def near_the_screen?(dx = 12, dy = 8)
    ax = $game_map.adjust_x(@real_x) - Graphics.width / 2 / 32
    ay = $game_map.adjust_y(@real_y) - Graphics.height / 2 / 32
    ax >= -dx && ax <= dx && ay >= -dy && ay <= dy
  end
  #--------------------------------------------------------------------------
  # â—� 自律移動を開始ã�™ã‚‹å�œæ­¢ã‚«ã‚¦ãƒ³ãƒˆã�®é–¾å€¤ã‚’計算
  #--------------------------------------------------------------------------
  def stop_count_threshold
    30 * (5 - @move_frequency)
  end
  #--------------------------------------------------------------------------
  # â—� 移動タイプ : ランダム
  #--------------------------------------------------------------------------
  def move_type_random
    case rand(6)
    when 0..1;  move_random
    when 2..4;  move_forward
    when 5;     @stop_count = 0
    end
  end
  #--------------------------------------------------------------------------
  # â—� 移動タイプ : è¿‘ã�¥ã��
  #--------------------------------------------------------------------------
  def move_type_toward_player
    if near_the_player?
      case rand(6)
      when 0..3;  move_toward_player
      when 4;     move_random
      when 5;     move_forward
      end
    else
      move_random
    end
  end
  #--------------------------------------------------------------------------
  # â—� プレイヤーã�®è¿‘ã��ã�«ã�„ã‚‹ã�‹åˆ¤å®š
  #--------------------------------------------------------------------------
  def near_the_player?
    sx = distance_x_from($game_player.x).abs
    sy = distance_y_from($game_player.y).abs
    sx + sy < 20
  end
  #--------------------------------------------------------------------------
  # â—� 移動タイプ : カスタム
  #--------------------------------------------------------------------------
  def move_type_custom
    update_routine_move
  end
  #--------------------------------------------------------------------------
  # â—� 起動中フラグã�®ã‚¯ãƒªã‚¢
  #--------------------------------------------------------------------------
  def clear_starting_flag
    @starting = false
  end
  #--------------------------------------------------------------------------
  # â—� 実行内容ã�Œç©ºã�‹å�¦ã�‹ã‚’判定
  #--------------------------------------------------------------------------
  def empty?
    !@list || @list.size <= 1
  end
  #--------------------------------------------------------------------------
  # â—� 指定ã�•れã�Ÿãƒˆãƒªã‚¬ãƒ¼ã�®ã�„ã�šã‚Œã�‹ã�‹å�¦ã�‹ã‚’判定
  #     triggers : トリガーã�®é…�列
  #--------------------------------------------------------------------------
  def trigger_in?(triggers)
    triggers.include?(@trigger)
  end
  #--------------------------------------------------------------------------
  # â—� イベント起動
  #--------------------------------------------------------------------------
  def start
    return if empty?
    @starting = true
    lock if trigger_in?([0,1,2])
  end
  #--------------------------------------------------------------------------
  # â—� 一時消去
  #--------------------------------------------------------------------------
  def erase
    @erased = true
    refresh
  end
  #--------------------------------------------------------------------------
  # â—� リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    new_page = @erased ? nil : find_proper_page
    setup_page(new_page) if !new_page || new_page != @page
  end
  #--------------------------------------------------------------------------
  # â—� æ�¡ä»¶ã�«å�ˆã�†ã‚¤ãƒ™ãƒ³ãƒˆãƒšãƒ¼ã‚¸ã‚’見ã�¤ã�‘ã‚‹
  #--------------------------------------------------------------------------
  def find_proper_page
    @event.pages.reverse.find {|page| conditions_met?(page) }
  end
  #--------------------------------------------------------------------------
  # â—� イベントページã�®æ�¡ä»¶å�ˆè‡´åˆ¤å®š
  #--------------------------------------------------------------------------
  def conditions_met?(page)
    c = page.condition
    if c.switch1_valid
      return false unless $game_switches[c.switch1_id]
    end
    if c.switch2_valid
      return false unless $game_switches[c.switch2_id]
    end
    if c.variable_valid
      return false if $game_variables[c.variable_id] < c.variable_value
    end
    if c.self_switch_valid
      key = [@map_id, @event.id, c.self_switch_ch]
      return false if $game_self_switches[key] != true
    end
    if c.item_valid
      item = $data_items[c.item_id]
      return false unless $game_party.has_item?(item)
    end
    if c.actor_valid
      actor = $game_actors[c.actor_id]
      return false unless $game_party.members.include?(actor)
    end
    return true
  end
  #--------------------------------------------------------------------------
  # â—� イベントページã�®ã‚»ãƒƒãƒˆã‚¢ãƒƒãƒ—
  #--------------------------------------------------------------------------
  def setup_page(new_page)
    @page = new_page
    if @page
      setup_page_settings
    else
      clear_page_settings
    end
    update_bush_depth
    clear_starting_flag
    check_event_trigger_auto
  end
  #--------------------------------------------------------------------------
  # â—� イベントページã�®è¨­å®šã‚’クリア
  #--------------------------------------------------------------------------
  def clear_page_settings
    @tile_id          = 0
    @character_name   = ""
    @character_index  = 0
    @move_type        = 0
    @through          = true
    @trigger          = nil
    @list             = nil
    @interpreter      = nil
  end
  #--------------------------------------------------------------------------
  # â—� イベントページã�®è¨­å®šã‚’セットアップ
  #--------------------------------------------------------------------------
  def setup_page_settings
    @tile_id          = @page.graphic.tile_id
    @character_name   = @page.graphic.character_name
    @character_index  = @page.graphic.character_index
    if @original_direction != @page.graphic.direction
      @direction          = @page.graphic.direction
      @original_direction = @direction
      @prelock_direction  = 0
    end
    if @original_pattern != @page.graphic.pattern
      @pattern            = @page.graphic.pattern
      @original_pattern   = @pattern
    end
    @move_type          = @page.move_type
    @move_speed         = @page.move_speed
    @move_frequency     = @page.move_frequency
    @move_route         = @page.move_route
    @move_route_index   = 0
    @move_route_forcing = false
    @walk_anime         = @page.walk_anime
    @step_anime         = @page.step_anime
    @direction_fix      = @page.direction_fix
    @through            = @page.through
    @priority_type      = @page.priority_type
    @trigger            = @page.trigger
    @list               = @page.list
    @interpreter = @trigger == 4 ? Game_Interpreter.new : nil
  end
  #--------------------------------------------------------------------------
  # â—� 接触イベントã�®èµ·å‹•判定
  #--------------------------------------------------------------------------
  def check_event_trigger_touch(x, y)
    return if $game_map.interpreter.running?
    if @trigger == 2 && $game_player.pos?(x, y)
      start if !jumping? && normal_priority?
    end
  end
  #--------------------------------------------------------------------------
  # â—� 自動イベントã�®èµ·å‹•判定
  #--------------------------------------------------------------------------
  def check_event_trigger_auto
    start if @trigger == 3
  end
  #--------------------------------------------------------------------------
  # â—� フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    check_event_trigger_auto
    return unless @interpreter
    @interpreter.setup(@list, @event.id) unless @interpreter.running?
    @interpreter.update
  end
end


My overall thought is that I love rgss3 and ruby 1.9, things just seem neater and cleaner.


__________________________
Xeilsoft
- Follow your dreams to the very end..

Kits that I'm working on.
[Unity3D 4.0] LTTP/Minish Cap - I don't have time for custom gfx like what the pze folks are doing but I will try and work on some enhanced LTTP graphics.

Main PC
Core i7 3820 overclocked @ 4.8GHZ
Galaxy: Nvidia Geforce GTX 680 GDDR5 2GB
Asrock X79 Extreme9 w' creative sound
64GB corsair platinum @ 1600MHZ
Muchkin 128GB SSD(boot), OZKIN 2TB SSD, Western Digital GREEN 1TB HDD.
Rosewill Lightning 1000W PSU
OS: Funtoo Linux, Windows 8 (Virtual Machine)

iMac (March 2013)
3.4GHz Quad-core Intel Core i7, Turbo Boost up to 3.9GHz
16GB 1600MHz DDR3 SDRAM - 2X8GB
1TB Serial ATA Drive @ 7200 rpm
NVIDIA GeForce GTX 680MX 2GB GDDR5
Go to the top of the page
 
+Quote Post
   
joey101
post Jan 4 2012, 03:49 PM
Post #2


DeadlyWeapon6
Group Icon

Group: Revolutionary
Posts: 196
Type: Developer
RM Skill: Skilled




okay...nice....whats your point?????????


__________________________
Go to the top of the page
 
+Quote Post
   
Kread-EX
post Jan 8 2012, 10:58 PM
Post #3


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




The point joey, it to compare how the default scripts are written depending of the version. For RGSS3, Enterbrain code is much clever than in previous iterations, both in readability and performance.
Although I have to agree that shoving two random pieces of codes isn't the best way to illustrate the point.


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   
Ashalinia
post Jan 9 2012, 06:30 PM
Post #4


Level 12
Group Icon

Group: Revolutionary
Posts: 204
Type: Writer
RM Skill: Intermediate




I'm assuming all the characters that are garbled were originally Japanese? Well... this example isn't the best one he could've given, but I understand.

QUOTE (joey101)
okay...nice....whats your point?????????


You could've asked nicely. happy.gif


__________________________
Do you hate me? Good, I hate you too.

Rob_Riv is my idol. :)



Support



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

Sorcerer's Night
Go to the top of the page
 
+Quote Post
   
Rukiri
post Jan 11 2012, 01:06 AM
Post #5


emerge -avt awesome! Wait... it brings me.... HERE?!
Group Icon

Group: Revolutionary
Posts: 1,717
Type: Scripter
RM Skill: Advanced




QUOTE (Kread-EX @ Jan 8 2012, 10:58 PM) *
The point joey, it to compare how the default scripts are written depending of the version. For RGSS3, Enterbrain code is much clever than in previous iterations, both in readability and performance.
Although I have to agree that shoving two random pieces of codes isn't the best way to illustrate the point.


Probably not, but it does display how efficient default RGSS has become over the years.


__________________________
Xeilsoft
- Follow your dreams to the very end..

Kits that I'm working on.
[Unity3D 4.0] LTTP/Minish Cap - I don't have time for custom gfx like what the pze folks are doing but I will try and work on some enhanced LTTP graphics.

Main PC
Core i7 3820 overclocked @ 4.8GHZ
Galaxy: Nvidia Geforce GTX 680 GDDR5 2GB
Asrock X79 Extreme9 w' creative sound
64GB corsair platinum @ 1600MHZ
Muchkin 128GB SSD(boot), OZKIN 2TB SSD, Western Digital GREEN 1TB HDD.
Rosewill Lightning 1000W PSU
OS: Funtoo Linux, Windows 8 (Virtual Machine)

iMac (March 2013)
3.4GHz Quad-core Intel Core i7, Turbo Boost up to 3.9GHz
16GB 1600MHz DDR3 SDRAM - 2X8GB
1TB Serial ATA Drive @ 7200 rpm
NVIDIA GeForce GTX 680MX 2GB GDDR5
Go to the top of the page
 
+Quote Post
   
Klokinator
post Jan 13 2012, 03:37 PM
Post #6


IM THE BET MEMEBER ON RRR
Group Icon

Group: Revolutionary
Posts: 1,394
Type: Developer
RM Skill: Advanced




Idk, I'm not a scripter or anything... but posting a script in clean english and comparing it to a garbled monstrosity made out of alien hieroglyphics that's supposed to be superior just... isn't doing it for me lol.


__________________________
Want to be a part of the biggest new Fandom Game? Check out the already popular....
Fire Emblem: The Medallion of Hope
(Based on the semi-popular Ragefest 3 submission, Generic War!)

(Sorry, this game is currently on hiatus and possibly discontinued.)
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 18th May 2013 - 04:03 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker