[XP] RPG Maker XP Online System (RMX-OS)

Started by Blizzard, June 20, 2009, 11:52:23 am

Previous topic - Next topic

wazzyl

is there a possible way to let this script work on a windows 7 system, and should it work?

G_G

It should run fine on any windows system with Ruby installed.

Hosom

Am i wrong or there isn't any tutorial on how to make a server side script?
I have something in mind.. but i really don't know hot to program it server side.

For example: a player places an object in the map, a barrel. I am able to do that type of client side script, but how to send this information to the server and apply to all the connected clients?

Blizzard

There is an "ExtensionSkeleton" script in the Extensions folder. You basically make a copy of that template and fill your stuff in the initialization method and the update method.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

KK20

And then you look at other people's scripts in the script database and see how they did it.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

mrretrus

This question was left off on a note that my question picks up on :) Ive read through quite a bit of blizzards RMX-OS related scripts to try and get a bearing on how things are done- It seems you pass variables to $Network- and then you should be able to pull them on client requests, although im not sure how to "push" them to the client instead.- I read through the manual as well, but it just scratches the surface of how this communication actually works. Is there any info on how this is done in a more comprehensive manner?

KK20

Maybe it's better if you describe what it is that you're trying to do and how much of it you have written up so far. It will make explaining it easier to understand.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

mrretrus

Thank you for your reply ^.^ Ill start off first by saying im a moderate scripter- I have a project much like diablo 2 Ive been working on for 3 years now- and have been using multi-dimensional arrays to store all of the data the game needs- Inventory, monsters on the map etc. I'm now trying to make a similar game using RMX-OS. I have a LAN where Im testing out the server with 2 players (Justin1, Justin2) and would like to be able to send and receive custom data to the server so both clients see the same thing. Im using the "Global Switches Variables" script Blizzard wrote but what I'd like to be able to do to start is make a single custom array for each player based on their username plus one global array, and have the clients able to access that information on call. Of course simply defining $GlobalArray = [] wont work because its only client side

I have Custom controls and Mouse Controller and wrote a custom "locate event" script to search for events under the cursor (targetting a player or event) and would like to be able to get the "map_users" list, scan the array for the player whose closest to the tile the cursor is over, and pull data from that users respective array, and be able to write to it. I dont know if this is the best way to do P2P communication, but I know its important to at least be able to have an array for each player plus one global array for the entire server where I can store all the information thats been hashed out by the clients. The thing is I'm not familiar with the code, and don't exactly know whats pointing where. I was able to get my own username by calling $network.username, but when i call $network.map_users it returns a strange hash value and not an array, and I dont know how to convert this list into an indexed list so I can pull more information (game_player.x & y- etc) and write back to it.

KK20

If these player-unique arrays are to be saved with the game, you should probably create this array in Game_Player and configure your SAVE_DATA to include this array.

class Game_Player
  attr_accessor :myUniqueArray
end


$network.map_players does return a hash based on the format {PLAYER_ID => Game_Character object}. You can generate an array of Game_Characters by simply doing $network.map_players.values.

It's been a while since I've played with RMX-OS. You might be lucky enough to be able to access the unique array from the $network.map_players result.

$network.map_players.values.each{|player| print player.myUniqueArray}


As for a server-side unique array, you will have to create your own extension code. Using Global Switches/Variables as a template will help. The basic idea is to create a typical array in self.initialize and make a new message code in self.client_update that looks something like:

when /\AGARR\t(.+)/ # Get ARRay
  id = $1.to_i
  value = @serverArray[id]
  client.send('GARR', value)
  return true

Then in your RMXP project, you will have to make a corresponding listener for this message:

class RMXOS::Network
 
  alias check_game_serverarray_later check_game
  def check_game(message)
    case message
    when /\AGARR\t(.+)/
      $server_array_result = $1.to_i # It's up to you what to do here
      return true
    end
    return check_game_serverarray_later(message)
  end
end

Now you can access the server's array by doing

$network.send('GARR', 1) # replace the 1 for whatever index you want to access

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

mrretrus

This seems pretty straight forward - would you mind briefly explaining what each line does? I'm not proficient with reg expression or the networking protocol implement :/ I could plug this is but I wouldn't understand it  :shy:

KK20

February 10, 2016, 02:16:57 pm #1750 Last Edit: February 10, 2016, 02:18:15 pm by KK20
when /\AGARR\t(.+)/ # Get ARRay

Anything between the two forward slashes indicates the usage of regular expression, which I'm sure you understand. \A means "start match at the very beginning of the string". \t is obvious tab. Anything in parentheses will be matched and can be accessed using $1, $2, etc. The period followed by a plus-sign means to match one or more of any character. There are plenty of tutorials about regular expressions, like this one: http://forum.chaos-project.com/index.php/topic,56.html

$network.send('GARR', 1)

When we make this call, we are sending this string to the server:
'GARR\t1'

If we run this through our regular expression, GARR\t will be matched. The 1 will be caught within the (.+), which we can then access with $1.

So we sent a message to the server, but now we need to send the message back to the client(s).
client.send('GARR', value)

The variable 'client' is passed through the self.client_update method, which pretty much is our Socket object. Again, we're sending a string that will look something like this back to the client:
'GARR\t42'

Our clients need to be able to interpret this message, hence the class RMXOS::Network aliased method.
---
All communication done between the client and server is through string-based messages. You start with some kind of identifier (e.g. GARR) that will then run a specific block of code to parse the remaining information appended to the message (if any). I suggest you get a solid understanding of regular expressions before you tackle this any further. I also suggest studying the RMX-OS plug-ins in the database until you can understand what is actually being done.

It would also help tremendously if you took a class on computer communications--everything made perfect sense to me. I was a prominent Ruby scripter of 4 years before taking the class, but RMX-OS was still a giant enigma to me.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

mrretrus

yes... about 10% of what you explained made sense to me, but I do apreciate the answer. Ill have to do a bit more studying before I become adept at this ^.^ but hey I taught myself everything I know from reading stuff online and Ive come this far so anything is possible with enough determination :) I also saw today that a new RPG maker was released? RPG MV? Do you have any knowledge of this new program? Im wondering if it might be wise to just start learning on this new platform as it seems to have capabilities to port to mobile devices as well as other operating systems...

KK20

Haven't played with the maker much. It uses JavaScript instead of Ruby. No one here can really be called an expert at it yet, so you're better off asking the people on the official RPG Maker forums instead. There's already a lot of community support for it and there's plenty of potential to make it one of the best RM's in the series, but it's still in its infancy.

I'm really just not interested in learning all the code again, especially since they didn't comment any of it (not to mention combined them all into a few files--take all the default scripts in RMXP, remove all the comments, and put them in one file--but there are tools to extract the separate "classes", one of which I made).

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Mason Wheeler

Hey all, sorry if this has already been asked, but there's no easy way on this forum to search through 88 pages of a topic like this. :(

Anyway, by default RMX-OS treats the whole game like a shared world: if more than one person logged in to the server is active on map 1, everyone on map 1 will see all those people.  Is there any way to selectively disable this behavior for certain maps and keep them private and local?  This is an obvious enough feature that I'd imagine it has to be present, but I can't find how to do it.  Does anyone know?

Blizzard

I know a couple of people requested this, but I never implemented this in the base script. There might be a plugin around for that, though. Try searching through our database. http://database.chaos-project.com I think it was called instance maps or something like that.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Mason Wheeler

I don't see anything with a name like that in the database. :(

Blizzard

You're right, I can't find anything either. :/ Maybe at another forum?
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

KK20

http://forum.chaos-project.com/index.php/topic,14580.0.html

There is no official script release. But maybe you can ping chaucer for the script if he still has it.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Mason Wheeler

Interesting.  The thing Ryex keeps saying is the wrong way to handle it really actually seems like exactly what I want to do, especially since you would definitely want the intro (where a new player starts the game) to not be a shared map, and the intro point is hardwired into the database.

Mason Wheeler

One other quick question: where does mysql_api.so come from?  It would be very nice to be able to run this on the latest version of Ruby instead of one that's 9 years old, but for that I need an updated mysql_api.so binary, and casual Googling doesn't actually turn up anything useful.