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.

Scripting ideas

dricc

Member

I have seen a request that i found very interesting :

An auto-battle option !

There will be a scene called from the menu . For each actor , you can authorize use of items/skills ... For Healing also .
And in battle where the game asks "Battle or Retreat" , you will have another option : "Auto-Battle" and the actors fights alone .

This can be useful for a lot of people . I think i will work on it ... one day .
 
While that is a pretty common thing in RPGs, and therefore not really unknown (even though it's regularly praised as an awesome feature in whatever new RPG...), I think dubealex did it some time ago... though I'm not too sure on that, but yeah - someone did it, I think. Might look at that for reference before creating your own (which, in case alex did it, would be definately worth it, considering his scripting style... ^^" )
 
so about 2 and a half weeks ago i came here looking for an idea, i choose the world map script. its works perfect atm(tho seph is helping me change up my data structure to work faster/easier) but there is one feature i havent been able to get to work quite the way i wanted so i thought id come here and ask for ideas. that feature being the sub sections. how would you guys do it?
 
While having no idea what you're talking about at all, it kind of seems to be something along the lines of what we talked about up there with the Vector stuff: Seperating the scene in several, easily predefined areas by using vertices (corner points, connecting to the next one in line, forming a vector).
Without that, the most apparent way to me seems to be using images, however, that can hardly be what you're looking for.

Either way, this isn't a place to ask for ideas, but rather to submit your own for people to execute. Therefore, if you're having further questions about it, please open up a seperate topic in Script Support or Requests (depends).
 
I've been thinking about a layer-mask script.
The goal is to help mapping. It'll eliminate the need to create new cliff tiles sunk in grass/ rocks in water, etc. There will be 'mask tiles' and 'mask auto-tile' (by utilizing Terrain Tags) which hide the layer below them.
I may do it myself, if I have the time.
Also, I wonder whether to make it work with transparency-- making the layer below 50% visible. The same effect can be achieved by using events, so such a feature will have little use, aside from 50% visible water auto-tile for cliff bottom..
 
For the save name mods, check out this script that Scriptastic (me and Glitchfinder, mostly) cooked up awhile back:

http://www.glitchkey.com/view_page.php?id=15

It allows you to add a word, as well as icons, to the savegame.
Could easily be modded to do what you are looking for.

Found a few interesting ideas here, I'll have some fun with these when I get some free time.
 

dricc

Member

Someone asks for a battle statistics script .
It could be accessible from the menu . And it will display various figures like how many ennemies encoutered and killed , how many HP healed and lost .... There is a lot of possibilities . You have this in Disgaea for exemple .

With these figures , the player can earn points for some special actions like killing a monster one shot ...

I think i will try to make it for the GTBS . because , yes , i am afraid this must be done for each battle system .
 
Something I was trying to do, and sortof succeeded in a crude and unworkable way: IRC chat within rmxp. Would love to see it done, though this isn't a request nor a necessity. Would just like to see how one would go about it.

I managed to get it working in Game Maker, worked quite well. I think it would be a cool alternative to Netplay chat, offering more userbase and more moderation controls.
 
mtgmaster":2lust12i said:
I think an adventure game script would be awesome. Not point and click style really, just more of an item interaction system.

I coded one myself but it was my first script so the code probably sucks and it was a bit of a pain in the arse to use. I pretty much forgotten what I knew of Ruby so I won't be adding to it. I never made it like an actual adventure game because adding mouse support would of been hard and I like it how it is.
advent.jpg

It could definitely do with being rewritten and made slightly more user friendly on the editing side of things.

If anyway wants to use it how it is or for any other reason, here it is:
Code:
 

#==============================================================================

# ** Advent

#------------------------------------------------------------------------------

# mtgmaster

# 0.01

# 28/01/2008

#==============================================================================

 

#==============================================================================

# ** Window_Advent

#------------------------------------------------------------------------------

#  Create the HUD

#==============================================================================

class Window_Advent < Window_Selectable

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize

    super(-32, 420, 690, 107)

    self.contents = Bitmap.new(690, 107)

    self.opacity = 0

    refresh

  end

  #--------------------------------------------------------------------------

 

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    self.contents.clear

    ###self.contents.fill_rect(0, 0, 999, 999, Color.new(0,0,0,200))

    bitmap = RPG::Cache.picture("hudbg.png")

    self.contents.blt(16, 0, bitmap, Rect.new(0, 0, 999, 999), 170)

    

    # Draw the icons

    xn = 42

    itemid = 1

    textx = 35

    self.contents.font.size = 10

    for i in 1...$data_items.size

      if $game_party.item_number(i) > 0

        opacity = 100

        item = $data_items[i]

        # If item in hud is the same as being selected to hold

        if $scene.hold == itemid

          opacity = 255

          $holding = item.id

        end

        bitmap = RPG::Cache.icon(item.icon_name)

        self.contents.font.color = Color.new(255,255,255, opacity)

        self.contents.blt(xn, 10, bitmap, Rect.new(0, 0, 24, 24), opacity)

        self.contents.draw_text(textx, 6, 10, 10, itemid.to_s)

        xn += 48

        itemid += 1

      textx += 48

      end

    end

 

  end

  #--------------------------------------------------------------------------

 

  #--------------------------------------------------------------------------

  # * Update

  #--------------------------------------------------------------------------

  def update

    super

    refresh

  end

  #--------------------------------------------------------------------------

end  

 

#==============================================================================

# ** Scene_Map

#------------------------------------------------------------------------------

#  Add the HUD and check for input

#==============================================================================

class Scene_Map

  alias_method :scene_map_main, :main

  alias_method :scene_map_update, :update

  attr_accessor :hold

  attr_accessor :adv_window

  #--------------------------------------------------------------------------

  # * Main

  #--------------------------------------------------------------------------

  def main

    @adv_window = Window_Advent.new

    @adv_window.visible = true

    @adv_window.z = 9999

    scene_map_main

  end

  #--------------------------------------------------------------------------

 

  #--------------------------------------------------------------------------

  # * Update

  #--------------------------------------------------------------------------

  def update

    @adv_window.update

    # Item selection

    if Kboard.keyboard($R_Key_1)

      hold_item(1)

    elsif Kboard.keyboard($R_Key_2)

      hold_item(2)

    elsif Kboard.keyboard($R_Key_3)

      hold_item(3)

    elsif Kboard.keyboard($R_Key_4)

      hold_item(4)

    elsif Kboard.keyboard($R_Key_5)

      hold_item(5)

    elsif Kboard.keyboard($R_Key_6)

      hold_item(6)

    elsif Kboard.keyboard($R_Key_7)

      hold_item(7)

    elsif Kboard.keyboard($R_Key_8)

      hold_item(8)

    elsif Kboard.keyboard($R_Key_9)

      hold_item(9)

    end

    # Hide HUD

    if Kboard.keyboard($R_Key_0)

      @adv_window.visible ? @adv_window.visible = false : @adv_window.visible = true

    end

    # View item (V)

    if Kboard.keyboard($R_Key_L)

      view_item($holding)

    end

    # Menu Hotkeys

    if Kboard.keyboard($R_Key_O)

      $scene = Scene_Journal.new

    end

    scene_map_update

  end

  #--------------------------------------------------------------------------  

 

  #--------------------------------------------------------------------------

  # * view_item

  #-------------------------------------------------------------------------- 

  def view_item(itemid)

    if $holding == nil

      $game_system.se_play($data_system.cancel_se)

      return false

    end

      $game_system.ums_mode = FIT_WINDOW_TO_TEXT

      $game_system.comic_enabled = true

      $game_temp.message_text = '\e[0]' + $data_items[itemid].description.to_s

  end

  #--------------------------------------------------------------------------  

 

  #--------------------------------------------------------------------------

  # * hold_item

  #--------------------------------------------------------------------------  

  def hold_item(item_id)

    unless $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing

      if @hold == item_id

        @hold = 0

        $holding = nil

      else

        @hold = item_id

      end

    end

  end

  #--------------------------------------------------------------------------  

end

 

#==============================================================================

# ** Game_Player

#------------------------------------------------------------------------------

#  Adds the ability to change event interaction when holding an item

#==============================================================================

class Game_Player < Game_Character

  #--------------------------------------------------------------------------

  # * Front Event Starting Determinant

  #--------------------------------------------------------------------------

  def check_event_trigger_there(triggers)

    result = false

    # If event is running

    if $game_system.map_interpreter.running?

      return result

    end

    # Calculate front event coordinates

    new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)

    new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)

    # All event loops

    for event in $game_map.events.values

      # If event coordinates and triggers are consistent

      if event.x == new_x and event.y == new_y and

         triggers.include?(event.trigger)

        # If starting determinant is front event (other than jumping)

        if not event.jumping? and not event.over_trigger?

          #--------------------------------------------------

          # If you're holding an item

          if $holding

            comment = SDK.event_comment_input(event, 1, "Holding").to_s.split('|')

            item_id = comment[0].to_i

            command = comment[1].to_s.split(':')

              switch_id = command[1].to_i

              command_ = command[0].to_s

            # If the item you're holding and the item_id of the event comment match

            if $holding == item_id

              case command_

                # Switch

                when "s"

                  $game_switches[switch_id] = true

                # Self Switch

                when "ss"

                  switch_id = switch_id.to_s.split('.')

                  p switch_id[0]

                  #key = [$game_map.map_id, event.id, switch_id[0].to_s]

                  #$game_self_switches[key] = (switch_id[1].to_i == 0)

                # Common event

                when "c"

                  $game_temp.common_event_id = switch_id

              end

              $game_map.need_refresh = true

            else

              $game_system.se_play($data_system.cancel_se)

              return false

            end

          else

            event.start

          end

          #--------------------------------------------------

         result = true

        end

      end

    end

    # If fitting event is not found

    if result == false

      # If front tile is a counter

      if $game_map.counter?(new_x, new_y)

        # Calculate 1 tile inside coordinates

        new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)

        new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)

        # All event loops

        for event in $game_map.events.values

          # If event coordinates and triggers are consistent

          if event.x == new_x and event.y == new_y and

             triggers.include?(event.trigger)

            # If starting determinant is front event (other than jumping)

            if not event.jumping? and not event.over_trigger?

              event.start

              result = true

            end

          end

        end

      end

    end

    return result

  end

  #--------------------------------------------------------------------------  

end

 

class Game_Character

  attr_accessor :move_speed

end
It uses actual items, any items you have will show up in the GUI and can be used. To use it add these comments to the event.
Comment: Holding
Comment: 1|s:1
The last comment controls item and switching. It's used like this:
[ID of the item you need to be holding] | [s for switch, ss for self switch, c common event] : [ id of the switch/common event to be triggered]
Probably too complicated, could do with simplifying.
Just press the corresponding number on your keyboard to select(hold) or deselect an item. When you have the item selected and press space with the event, the switch or common event is triggered.
Press 0 to hide the GUI.
L makes your character look at the item and shows its description set in the DB.
I will be doing something like this for one of my games, i had a similar idea. But also with a adventure skills that can be used in map . I dont know if i will use some with my actual short system, but i use i will code it
 
Mode7 for battle backgrounds, basically.. when you get into a battle, the game zooms in and the ground shifts and what not and the um..NPCs and everything go invisible and the monsters and players apear as if it's the battle back.. and everything else apears..
Basically like they do in The 7th Saga for battles on the SNES.
here is a video.. mute it if the guy talking gets on your nerves, it's the only vid i could find showing the battles..
http://www.youtube.com/watch?v=l5A8R_Clr7Q

I just thought it might be cool, plus people are already working with mode 7 even scripters, so maybe someone might like this idea and try and make it work.
 
I have less time and interest so i release scripts ideas that other scripters may terminate.

Improved Show Pictures Command
This script idea was to have these habilities:
-Lock the picture
-Make a fog/panorama continuos movement for pictures
-The option to set the z of game pictures through a depth atribute, so you can set it an a plenty of key locations: under chipset, under characters, under fog, up messages.

I also pots my learnins to solve this:

Z values
-WinMsg 9998
-WinInputNum 9999
Per sobre de msg: 10000
@viewport2.z = 200
@viewport3.z = 5000
-Event always on top 999
# Make panorama plane
@panorama = Plane.new(@viewport1)
@panorama.z = -1000
# Make fog plane
@fog = Plane.new(@viewport1)
@fog.z = 3000

The problem here is viewports. The z in viewports seems to be used to differentiate between the objects that used that viewport, so, if you give it a z = 10000 it wont work because these z only makes to show on the top of its viewport.

Note that the key class is spriteset map. I have modified well the sprite picutr, i think.

Then to make this scripts you have to know about viewports and modify that system. I also dont know if viewports give some other beneficits so you will have to create your mdified version.

Finally, i think this is a very good idea. It will be nice that somebody terminates this. Also, my code use some Anonymous Scripters code so if you take it give it credits too,xDDDDDDDDDDDDDD.

Code:
 

#==============================================================================

# ** Game_Picture

#------------------------------------------------------------------------------

#  This class handles the picture. It's used within the Game_Screen class

#  ($game_screen).

#==============================================================================

     

class Game_Picture

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor   :anchor                    # rotation angle

  attr_accessor   :depth

  #--------------------------------------------------------------------------

  # * Alias Methods

  #--------------------------------------------------------------------------

  alias glitch_anchor_pic_game_picture_initialize initialize

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     number : picture number

  #--------------------------------------------------------------------------

  def initialize(number)

    @anchor = false

    @depth = 0

    glitch_anchor_pic_game_picture_initialize(number)

  end

  

  def set_depth (code)

    if code == :under_chipset

      

    elsif code == :under_fog

    

    elsif code == :above_message

      

    end

    

  end

  

end  

#==============================================================================

# ** Sprite_Picture

#------------------------------------------------------------------------------

#  This sprite is used to display the picture.It observes the Game_Character

#  class and automatically changes sprite conditions.

#==============================================================================

 

class Sprite_Picture < Sprite

  #--------------------------------------------------------------------------

  # * Alias Methods

  #--------------------------------------------------------------------------

  alias glitch_anchor_pic_sprite_picture_update update

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    glitch_anchor_pic_sprite_picture_update

    if @picture.anchor == true

      self.ox = $game_map.display_x / 4

      self.oy = $game_map.display_y / 4

    end

    self.z = @picture.depth

    

  end

  

  

 

  

end

 

 

 

#==============================================================================

# ** Interpreter (part 1)

#------------------------------------------------------------------------------

#  This interpreter runs event commands. This class is used within the

#  Game_System class and the Game_Event class.

#==============================================================================

 

class Interpreter

  def pic_depth(num, code)

    $game_screen.pictures[num].set_depth(code)

  end

end

Improved key input command

The idea was to make a command like 2003 one, and also, whatever you think in adding to it for eventers. So:

-A wait for trigger key option.
-Selection the valids keys for each key input command.

This is the code i already created, the idea was to have a defined
array of default keys to use in all input calls, and then that you can modify this list in two ways:

-new: creates a totally new set of temporal keys used for that call
-add: add keys to the default list
example:
def_used_keys('add', ['z', 'x', 'up'].

-special mark 'all'. These key mark makes that all are used in a temporal or default context.

Using this you may have the more basic actived, and then add someone if you need.


Code:
class Interpreter

  alias wep_interpreter_init initialize

   def initialize(depth = 0, main = false)

    @key_wait = false           # control internal way

    @used_keys = Wep::Default_used_keys.split  # list of used keys setted with default

    @type = 0  # it saves the type of input

    wep_interpreter_init

  end

  #--------------------------------------------------------------------------

  # * Button Input

  #--------------------------------------------------------------------------

  def input_button

    # Determine pressed button

    n = 0

    for i in 1..18

      if Input.trigger?(i) and @used_keys.include?(Input.trigger?(i))

        n = i

      end

    end

    # If button was pressed

    if n > 0

      # Change value of variables

      $game_variables[@button_input_variable_id] = n

      $game_map.need_refresh = true

      # End button input

      @button_input_variable_id = 0

    # Reset values

    if @type == 1 or @type == 2

      @used_keys.clear

      @used_keys=Wep::Default_used_keys

      @type = 0

    end

    end

  end

 

  #--------------------------------------------------------------------------

  # * Button Input Processing

  #--------------------------------------------------------------------------

  def command_105

    

    # Set variable ID for button input

    @button_input_variable_id = @parameters[0]

    # Advance index

    @index += 1

    # End

    return false

  end

  

  #--------------------------------------------------------------------------

  # * Def Used Keys

  #--------------------------------------------------------------------------

  def def_used_keys(type='add', keys)

    # Check for type

    if type == 'add'

      @used_keys+=keys

      @type = 1

    elsif type == 'new'

      @used_keys=keys

      @type = 2

    end

  end

  

  #--------------------------------------------------------------------------

  # * Is Used Key?

  # determine if a key is used

  #-------------------------------------------------------------------------- 

  def is_used_key?(num)

    # If used keys have a all mark, allways true

    if @used_keys.include?('all')

      return true

    end

    # If not, search for it

    for key in @used_keys 

      return true if convert_user_key(key) == num

    end

    # Return false if not valid

    return false

  end

  

  #--------------------------------------------------------------------------

  # * Convert user key

  # this method have to be used to make convertion key-Input constants

  #--------------------------------------------------------------------------  

  def convert_user_key(key)

    case key

     when 'a'; return Input::A

     when 'b'; return Input::B

     when 'c'; return Input::C

    end

  end

  

  def wait_key

    

  end

  

end

 

 

module Wep

  Default_used_keys = ('a', 'b', 'c')

end

Note that will be better to use symbols here because they are easy to type and process and this is not using really the text in strings.

Script command language

The ideas to try to create some sort of scripting 'language' for the call script command that maks the things more easy and quick. For that i planned to use:

-Use of sortcuts to the game information
-Use of event commands with scripts
-Create new functions for this system


We can make everything, and its very quick to do. Here a example:

def cure_all
for actor in $game_party.actors
actor.recover_all
end
end

This is the easy way of doing it.

def cure(id=0)
if id == 0
for actor in $game_party.actors
actor.recover_all
end
else
$game_actors[id].recover_all
end
end

I think that knowing that all database ids start with 1, will be nice to treat a 0 like a "for all". And maybe make this the default values.

Also i think that will be nice to make that each method have a shorter one:
cure- c o cu
cure_all -cu_a

def gold=(value)
$game_party.gold += value
end

def gold
return $game_party.gold
end

Maybe when setting variables values we can make that a value of 0 sets it to 0. If not, to reduce the gold to 0 you have to call gold=-99999.
Another idea is if the use of = in method names is correct or not. Its more slow,that for sure.

A example call script.

gold=500 # This add 500 gold
(a 1).name = 'Wilfred' # (a 1) is like $game_actors[1]
for a in actors # actors is an alias of $game_party.actors
a.hp+=20
end
get_number(1) # This is like a input number command.

In the same way that cure and cure all:


def hp_mod(hp, id=0)
if id == 0
for actor in $game_party.actors
actor+=hp
end
else
$game_actors[id]+=hp
end

end
That can be aliased like mhp or hp. The problem here may be if you want
to make that trully all actors get the bonus. Maybe make that with a id=-1?
Also a nice idea for ids arguments will be to be arrays...

Note that idea was attacked because it lacked new things and was poorly readable. Anyway adding a save support for example, is not hard using my improved save as a basis.

Also i think the readibility things matter when someones wants to read what you have created. Who in the hells reads in a full game for normal events like how you have shown a message or something? thats stupid to do and care.

In 2k/2k3 the people looked for events to understand engines. But in everydary eventing readability dont matters for me. I was planning to finnish this but for now i couldnt.

The topic was here:
http://www.arpgmaker.com/viewtopic.php?f=155&t=72548

Code:
class Interpreter

  def gold=(value)

    $game_party.gold += value 

  end

 

  def gold

    return $game_party.gold

  end

 

  def g(value)

    $game_party.gold += value 

  end

 

  def vg

    return $game_party.gold

  end

 

  def actor(id)

    return $game_actors[id]

  end

  def a(id)

    return $game_actors[id]

  end

  

  def actors

    return $game_actors.party.actors

  end

  def as(id)

    return $game_actors.party.actors

  end

  

  def steps

    return $game_actors.party.steps

  end

  def st

    return $game_actors.party.steps

  end

    

  def cure_all

    for actor in $game_party.actors

      actor.recover_all

    end

  end

 

  def cure(id=0)

    if id == 0

      for actor in $game_party.actors

        actor.recover_all

      end

    else

      $game_actors[id].recover_all

    end

  end  

 

  def variable(id)

    return $game_variables[id]

  end  

  def v(id)

    return $game_variables[id]

  end  

 

  def switch(id)

    return $game_switches[id]

  end  

 

  def sw(id)

    return $game_switches[id]

  end

  

  def get_number(variable, digits=2)

    @parameters[0] = variable

    @parameters[1] = digits

    command_103

  end

 

  def gnum(variable, digits=2)

    @parameters[0] = variable

    @parameters[1] = digits

    command_103

  end

 

  def wait(frames)

    @wait_count = frames * 2

    command_106

  end

  

  def hp_mod(hp, id=0)

    if id == 0

      for actor in $game_party.actors

        actor+=hp

      end

    else

      $game_actors[id]+=hp

    end

 

  end

end

 

class Game_Party

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_accessor  :actors                   # actors

  attr_accessor  :gold                     # amount of gold

  attr_reader   :steps                    # number of steps

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize

    # Create actor array

    @actors = []

    # Initialize amount of gold and steps

    @gold = 0

    @steps = 0

    # Create amount in possession hash for items, weapons, and armor

    @items = {}

    @weapons = {}

    @armors = {}

  end

end

Note that i didnt plan to support all comands. There are things for the events are far better.
 
The first two ideas there'S nothing to say agains (other than you probably want to use a different word than 'terminate', which doesn't really mean 'script' ^^ but I like the ideas), however the third idea is not really potent in my opinion... what I see there is a second event-like language where you can access specific snippets to call directly... not practicable, as you have to learn them, and as they aren't in the default package, that's a necessary extra effort.
As for your short commands... I figure I've been the one talking to you about it for the last time: Readability is not about people reading through events of the finished game, which they may or may not do for reasons I don't wanna take guesses on.... it's primarily for you, the creator, or for your team. It doesn't matter how familiar your are with the custom commands - the time you need to write the commands out is not much more than the time you need to process it in your head, meaning if you look at something twice, it might've already been more efficient to spell it out.

Tbh, I don't really get why you chose Ruby/RGSS and RPG Maker as a platform... everything about those languages and programs aims to be simple, well-understandable and single-glance get-able. You're trying to get a tidbit of performance out of it, and maybe faster writing speed when creating your project, but seriously... working with stuff like 'vg' for party gold is (aside from the fact that writing appropriately is a thing you want to do in almost every programming language) definately not something you want to do in Ruby.
And before you bring Tricksters/Sephs/dubealex'/whoevers scripts as examples: Yes, they did it wrong, too.
 
BlueScope":k3m5cv4a said:
The first two ideas there'S nothing to say agains (other than you probably want to use a different word than 'terminate', which doesn't really mean 'script' ^^ but I like the ideas), however the third idea is not really potent in my opinion... what I see there is a second event-like language where you can access specific snippets to call directly... not practicable, as you have to learn them, and as they aren't in the default package, that's a necessary extra effort.
As for your short commands... I figure I've been the one talking to you about it for the last time: Readability is not about people reading through events of the finished game, which they may or may not do for reasons I don't wanna take guesses on.... it's primarily for you, the creator, or for your team. It doesn't matter how familiar your are with the custom commands - the time you need to write the commands out is not much more than the time you need to process it in your head, meaning if you look at something twice, it might've already been more efficient to spell it out.

Tbh, I don't really get why you chose Ruby/RGSS and RPG Maker as a platform... everything about those languages and programs aims to be simple, well-understandable and single-glance get-able. You're trying to get a tidbit of performance out of it, and maybe faster writing speed when creating your project, but seriously... working with stuff like 'vg' for party gold is (aside from the fact that writing appropriately is a thing you want to do in almost every programming language) definately not something you want to do in Ruby.
And before you bring Tricksters/Sephs/dubealex'/whoevers scripts as examples: Yes, they did it wrong, too.

I dont know that scripters works that used this. I choose rpgmaker because is the better plattfrom for this, it have a interesting base features a and a lot of custom scripts of other people. I also know the work of these through old rpgmaker 95.

Note that at least for me using that command syntax wont be hard. Also, you have used linux command line? Its a lot like this system. And all in it is very small and have a lot of shortcuts and nobody cares about readibilty or whatever, no?
 
In all honesty, I don't think you're getting what I'm talking about... it IS possible to do what you planned, and you WILL find people using it, yes. That doesn't make it purposeful, good scripting practice, logical or smart. Your linux example is bullshit, as it's not only built-in stuff you're talking about (you don't hear me complaining about .to_s either), but also a completely different base model, as it's an OS, not a game project.

Either way, let's keep this to the topic... I can shut up if my input is not apprechiated.
 
I've been toying around with calling C functions from Ruby and it's just made RPG maker scripting a lot more accessible to me, stuff like 3D graphics in RM seems super easy to me now when C extensions come into the picture, so I'm confident enough to bump this thread with the idea of a new networking API.

My idea is to create Ruby bindings for my networking engine:
arpgmaker.com/viewtopic.php?p=896585

So in RGSS you can build game-focused network packets and fire them at a remote server which fires some right back at you.

That might encourage someone to make netplay++ or even simple stuff like RPG maker online item trading or a score ranking server.

Ruby:
reliablePacket = ReliablePacket.new

reliablePacket.AddMessage( "move_me #{direction}" )

reliablePacket.AddMessage( "rename_me \"#{myName}\" " )

reliablePacket.SendTo( "#{serverAddress}" )

And when it comes to listening to packets:

Ruby:
class MovementManager

    def MoveRequest( senderAddress, commandString )

        # Grab the command params out of the string commandString  and process it

        # senderAddress is the IP of the machine that sent this command

    end

end

 

movementManager = MovementManager.new

 

Network.RegisterReliableListener( movementManager.method( :MoveRequest ), "move_player" )

And in the main loop there is a call to the Network module to grab the latest packets and then call the listener methods with the first string of the command.

So it's like: If it's a reliable packet -> Extract command -> If listener exists for command "move_player" -> Call listener method for "move_player"



If anyone wants to expand on this idea, please do so!
 

Zeriab

Sponsor

Nice idea Xilef :3
A 'freezing' occurs when you make a Win32API call. It doesn't matter if you have several threads running in RGSS, they will ALL be halted while the Win32API call is processed.
Yes, this really sucks and affects the design required for a responsive online rpg. My suggestion would be to create a DLL that acts as an interface between RGSS and your network engine.
It will start up a thread running outside RGSS, which will manage the connections, i.e. sending the messages and receiving them again. It will contain polling functions that you can use from RGSS to check for message and receive them in a fast manner. Sending messages be handled a similar indirect async manner.
There may be other ways around the shortcomings of the RGSS Win32API interactions though =o

P.s. I have updated the first post with the new ideas.

*hugs*
 
Thanks for the tip, so you suggest moving even more stuff into the DLL side of things?

So if I had the DLL constantly building a list of latest commands on a thread and then RGSS's single command is "Give me list of commands" and then the command processing is done on RGSS side would that help?

The sending of messages reliably/unreliably could be built in a list on RGSS side and then all at once sent to the DLL too.

Would that setup reduce the effects of a thread lock? I may need to research a bit more into handling ruby in C code...
 

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