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.

[Review] RGSS Web Kit 1.1

Gust

Member

RGSS Web Kit
Version: 1.1
By: Gustavo Bicalho


Introduction

The RGSS Web Kit (RWK) was designed to allow simple HTTP access through RGSS. I wanted to download resources from the web, so that's what it does: download resources from the web. However, this isn't a script for people who don't know RGSS, at least some basic stuff. There's no ready-to-use "Scene_ResourceDownloader" or something like that. RWK gives you a way to get online, but it's completely up to you to make it useful.

What you can do with RWK: download resources, send Post data to a server and read the response, send requests with special headers and check the headers of the response.

You can use this to create an Online Ranking, or some kind of chat or bulletin board in your game, or to check and download updates. Like the whole game making thing, it's all up to your creativity.

Remember: this is a HTTP library, not a browser. It won't do everything for you. If you want to access some service that needs cookies, you will have to emulate those cookies by yourself and deal with the HTTP headers. The same applies to everything else beyond the normal "Get" and "Post like a web form". RWK gives you only the basic stuff.

The Demo

RWK Version 1.1 Demo has an interesting system to show the Kit's power: GusForum, an in-game forum system. It uses AWorks Input scripts for user input, REXML for XML processing (in external files) and RWK to connect to a web server and, using simple PHP scripts (that you can download below to install in your own web server), allow users to create threads and send messages that can be seen by other people through the internet.
You are free to use and modify the GusForum scripts, just remember to credit me ;)
You can download the Demo below.

Download

Demo: http://www.gust.projetorpgmaker.com/RWK_1_1/RWK 1_1.rar
RWK Scripts in txt files: http://www.gust.projetorpgmaker.com/RWK_1_1/RWK 1_1_txt.rar
AsyncHTTP.dll Source Code: http://www.gust.projetorpgmaker.com/RWK_1_1/AsyncHTTP.src.rar
GusForum Server Scripts: http://www.gust.projetorpgmaker.com/RWK_1_1/GusForum_Server.rar

Instructions

Download the Demo and copy the scripts of the section named RGSS Web Kit (the Documentation is not necessary) and the AsyncHTTP.dll to your project. The SDK is not needed.
Read the RWK Docs to learn more.

FAQ

Q: Can I use RWK with RPG Maker VX?
A: I created and tested (a lot) the script on XP, but there's no reason it wouldn't work on VX since it's completely independent from all Game classes, it uses only the core Ruby classes... I tested it briefly on VX and it looks like it's OK. There could be some incompatibility somewhere... but I don't think so =P Just remember to copy all the Scripts (the Docs pages aren't necessary) and copy AsyncHTTP.dll from the demo to your VX project.

Compatibility

RWK should be compatible with any normal scripts. The only way you could have a problem is if some script changes classes from the core Ruby library (like class Thread or class Proc), which (I think) is not frequent.

Credits and Thanks

Special thanks to Diovanni "AntiCasper" de Souza, for support and testing.

Terms and Conditions

RWK is released under Creative Commons BY license. That means you must give me credit for the script if you use or redistribute it.
 
Damnit, all the cool stuff comes out when I stop using RPG Maker. Nice work with this, I haven't had chance to try it out but it's certainly useful and looks a nice way of going about it.
 

Gust

Member

Commodore Whynot":3phf33bp said:
Damnit, all the cool stuff comes out when I stop using RPG Maker. Nice work with this, I haven't had chance to try it out but it's certainly useful and looks a nice way of going about it.

Thanks!

Right now I'm working on a more interesting Demo and on some helper methods that I didn't put in v1.0 because I wanted to release it fast.
So v1.0.1 should be online in a few days and you'll a better example of what you can do with this :)
 
OFF-TOPIC
Olá, também sou brasileiro, eu lhe enviei uma PM, duas na verdade, mas parece que estas não foram entregues, não sei porque, bom gostaria muito de conversar com você, tenho um proposta a lhe fazer, você tem e-mail ou MSN?
 

Gust

Member

FYI: Awardspace web host, where I host the page accessed by the demo, seems to be down for a while, so the Demo might not work and you'll see Error 12029. The server should be online again soon.
New demo works ok.
 
Being unable to open RPG Maker right now, I ask...

What libraries did you use on the back end? Do you have a Socket class? Does it utilize Winsock? Where did you get the code, or did you write it yourself?

EDIT: I see, you made a compiled library and linked it. Could you share the source code for you AsyncHTTP.dll library?
 

Gust

Member

rey meustrus":2wxv5rcb said:
Being unable to open RPG Maker right now, I ask...

What libraries did you use on the back end? Do you have a Socket class? Does it utilize Winsock? Where did you get the code, or did you write it yourself?

EDIT: I see, you made a compiled library and linked it. Could you share the source code for you AsyncHTTP.dll library?

AsyncHTTP.dll uses the WinHTTP library. WinHTTP itself is waaay more powerful but waaay more complex, and I couldn't use it directly in Ruby because I need to give the methods a pointer-to-function, so I made this wrapper that I called AsyncHTTP. I coded it in C using Visual Studio 2008.
If you look at the Documentation of RWK, there is a description of the methods exported by the DLL.

About sharing the sources... well, I could, but they're not commented and may be a little confuse XD Just wait a few days and I will put them in (fairly) good order and post them here, probably together with RWK 1.1.
 
This looks very promising indeed... but everything I can think of utilizing this for kind of wants me to be able to access a mysql database with it, which I don't think I could with this... or is the script capable of handling that?

Either way, this is a great script, and I'll stand in the same line as rey and wyatt before me, as in not being able to use RMXP at the time, so posting the scripts in here seperately from the demo would be handy to give you some more fundamental feedback, rather than guesses. ^^

Keep up the good work!
 

Gust

Member

BlueScope":11ia50v4 said:
This looks very promising indeed... but everything I can think of utilizing this for kind of wants me to be able to access a mysql database with it, which I don't think I could with this... or is the script capable of handling that?

Either way, this is a great script, and I'll stand in the same line as rey and wyatt before me, as in not being able to use RMXP at the time, so posting the scripts in here seperately from the demo would be handy to give you some more fundamental feedback, rather than guesses. ^^

Keep up the good work!

You couldn't directly access the database, but you can make a php (or any language you want) script running on a webserver that accesses the database, get/set the info you want and returns you the data. That's what i do in the demo. (The problem now is that awardspace, where I host the php script, is down for a week, so the demo won't work u.u)
For example, for version 1.1 I'm making a little "forum" that you read and write to from inside the game =D

About posting the scripts: there are a lot of them, and very long documentation. I could make a package with them in txt files, though. I'll do that.

EDIT:
Here they are: http://www.gust.projetorpgmaker.com/RWK1_0_txt.zip
Please read and review =D hahahaha
I tried very hard to make the docs useful and easy to understand. There are a lot of examples to show you want you can do and how.
 

Gust

Member

RWK Version 1.1 Released

I fixed some bugs and added four useful helper methods for parsing GET and POST data and two HTTP Headers that are commonly used. Also, the V1.1 Demo has an interesting system to show the Kit's power: GusForum, an in-game forum system. It uses AWorks Input scripts for user input, REXML for XML processing (in external files) and RWK to connect to a web server and, using simple PHP scripts (that you can download below to install in your own web server), allow users to create threads and send messages that can be seen by other people through the internet. You are free to use and modify the GusForum scripts, just remember to credit me ;)

Also, I now realease the Source Code to AsyncHTTP.dll, for those of you who like some C code.

Downloads

Demo: http://www.gust.projetorpgmaker.com/RWK_1_1/RWK 1_1.rar
RWK Scripts in txt files: http://www.gust.projetorpgmaker.com/RWK_1_1/RWK 1_1_txt.rar
AsyncHTTP.dll Source Code: http://www.gust.projetorpgmaker.com/RWK_1_1/AsyncHTTP.src.rar
GusForum Server Scripts: http://www.gust.projetorpgmaker.com/RWK_1_1/GusForum_Server.rar
 
I'd really love to use this, but whenever i set it up to work with my webserver, all i get in the game window is

Error -> Invalid board id

Can anyone help?
I've setup the connect.php and the mysql database, and setup the scripts and executed the sql queries.
 

Gust

Member

Oh, oh, sorry.
Here's the problem: You have to create a board in your DB table "board".
Use this code:
Code:
 

insert into board(name) values('name of your board')

 
Look at the table to see what's the created board ID and use that ID when creating Scene_Board.
My fault, I should have explained that in the instructions.

Let's make something clear: GusForum isn't a "serious" script. I mean, the purpose is just to show one thing you can do with RWK, so I didn't put a lot of effort on making GusForum bug-free (some people already found one bug... try pressing a NUMPAD key). You can use it, but you should probably work on it to make it better before releasing your game.
 
That's great thanks, everything connects :)
Just one more problem though.
Whenever i try and post anything, i get this error:

Error Sending: Query Failed

Any ideas on what's wrong?
Thanks in advance :)
 

Gust

Member

That happens when you try to create a thread or send a post to an existing one?
Is there anything in your "thread" table right now?
 
This is what's in my Thread table at the moment:

screenie-1.png


Those are the titles of the threads i sent from the Game.
The messages don't show, and neither do the times, but the Titles do which is weird.
 

Gust

Member

Hmm
Are you sure you've run all the sql instructions?
When you create a new thread, it says "query failed" or "insert 2 failed"?
It looks like you are missing the add_post procedure, I think..
It's in the sql.txt file but I copy here:
Code:
 

DELIMITER $$

 

DROP PROCEDURE IF EXISTS `add_post`$$

CREATE PROCEDURE add_post( IN ptid int, IN pauthor varchar(20), IN ptext varchar(200))

BEGIN

 

INSERT INTO message(thread_id, author, text) VALUES (ptid, pauthor, ptext);

update thread set last_post = SYSDATE() where thread.id = ptid;

 

END$$

 

DELIMITER ;

 
 

Gust

Member

Just to let anyone who see the topic know:
Problem solved, it was an issue with permissions in the hosts database, not a problem with GusForum scripts.
Remeber, when you copy the php scripts to your host, remeber to set the correct user and password at the connect.php file to the ones you use to log into phpmyadmin.
 

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