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.

[Soft]Yuri RGSS Mod

Yuri RGSS Mod

Hi, I’m presenting to you my little project called Yuri RGSS Mod.
It’s a RGSS Player (Game.exe) for RMXP games which add some functions in the RGSS, these functions are programmed in C++. I called it Yuri RGSS Mod because it modify the RGSS :3
YuriRGSSGame is dependent to RGSS104E.dll because it using unreferenced functions inside this DLL and RGSS104E.dll is compatible with Windows XP and Windows 7 (it’s a good thing).

Functions

Input

Input.mx Return the mouse position x.
Input.my Return the mouse position y.
Input.kpress?(vk_key) Check if a virtual key is pressed.
Exemple : Input.kpress?(65) will return true if the A key is pressed.
Input.ktrigger?(vk_key) Check if a virtual key is trigged down.
Input.ktrigged?(vk_key) Same as ktrigger?
Input.ktrigger2?(vk_key) Check if a virtual key is trigged up.
Input.kreleased?(vk_key) Same as ktrigger2?
Input.CapsLocked? Check if the CapsLock key is enable (You write in capitalized letter).
Input.NumLocked? Check if the Num Pad is enable.
Input.ScrollLocked? Check if the console Scrolling is locked. (Useless today ^^’)
Input.GetKeyboardState Return a string containing KeyboardState. (A copy of lpKeyState returned by GetKeyboardState.)
Input.GetKeyboardState(string) Copy the KeyboardState in string. Return true if it succeed, false otherwise. (Basically it return false if string.size<256).
Note: There are two instance variable in the Input module: @mx and @my, they can be used inside the Input module for some functions related to the mouse position :b
Version 0.0.0.4 :
Input.update_joy=(bool) Enable or disable the joypad updating.
Input.update_joy? Check if the joypad are updated by the Input module.
Input.set_checkJoyCaps_condition(nb) It change the moment when the Input Module will check the joypad caps.
Input.getJoyError(id) Get the Joypad n°id Error.
Input.getJoyName(id) Get the Joypad's name. (Useless...)
Input.getJoyDeltaX(id) Get the difference between the Xmin and Xmax position.
Input.getJoyDeltaY(id)
Input.getJoyDeltaZ(id)
Input.getJoyDeltaR(id)
Input.getJoyDeltaU(id)
Input.getJoyDeltaV(id)
Input.getJoyNumButton(id) Get the count of button that the Joypad has.
Input.jpress?(id,key) Check if a key of the Joypad is pressed.
Input.jtrigger?(id,key) Check if a key of the Joypad is trigged.
Input.jtrigger2?(id,key) Check if a key of the Joypad is released.
Input.jtrigged?(id,key)
Input.jreleased?(id,key)
Input.jcurrentKey(id) Return the current pressed key.
Input.jAxeX(id) Return the position of the X axis. (-(Xmax-Xmin)...(Xmax-Xmin))
Input.jAxeY(id)
Input.jAxeZ(id)
Input.jAxeR(id)
Input.jAxeU(id)
Input.jAxeV(id)
Input.jHasZ(id) Check if the Joypad has a Z axis.
Input.jHasR(id)
Input.jHasU(id)
Input.jHasV(id)
Input.jAxeX!(id) Return the position of the X axis. (-1 or 0 or 1)
Input.jAxeY!(id)
Input.jAxeZ!(id)
Input.jAxeR!(id)
Input.jAxeU!(id)
Input.jAxeV!(id)

Input::MMSYSERR_NODRIVER
Input::MMSYSERR_INVALPARAM
Input::MMSYSERR_BADDEVICEID
Input::JOYERR_UNPLUGGED The Joypad has been unplugged.
Input::JOYERR_PARMS There is no Joypad there or the updating of the Joypad has failed.
Note : The joypads are linked to their USB port, if you unplug your joypad, it won't be recognised on other usb connection than its original USB connection.


Graphics

Graphics.width Return the width of the Game Screen.
Graphics.height Return the height of the Game Screen.
Graphics.resize_screen(width,height) Resize the Game Screen and don’t move it.
Graphics.resize_screen(width,height,true) Resize the Game Screen and center it on the Desktop Screen.
Graphics.snap_to_bitmap Return a Bitmap with a snapshot of the Game Screen.

Socket

Socket.new(family,type,protocol)
Socket.connect(hostname,port)
Socket.send(str)
Socket.recv(size)
Socket.recv(buffer)
Socket.closed?
Socket.close
Socket.listen(nb_sock)
Socket.accept
Socket.bind(hostname,port)
Socket.shutdown(how)

Socket::AF_UNSPEC
Socket::AF_INET
Socket::AF_IPX
Socket::AF_APPLETALK
Socket::AF_NETBIOS
Socket::AF_INET6
Socket::AF_IRDA
Socket::AF_BTH
Socket::SOCK_STREAM
Socket::SOCK_DGRAM
Socket::SOCK_RAW
Socket::SOCK_RDM
Socket::SOCK_SEQPACKET
Socket::IPPROTO_ICMP
Socket::IPPROTO_IGMP
Socket::BTHPROTO_RFCOMM
Socket::IPPROTO_TCP
Socket::IPPROTO_UDP
Socket::IPPROTO_ICMPV6
Socket::IPPROTO_RM
Socket::SOMAXCONN
Socket::SD_RECEIVE
Socket::SD_SEND
Socket::SD_BOTH

SocketError

Just the exception for errors in socket functions :b

TCPSocket

TCPSocket.new(hostname,port)
TCPSocket.readable?
TCPSocket.send(str)
TCPSocket.recv(size) The socket close itself if there it receive a zero sized data : "If the connection has been gracefully closed, the return value is zero."
TCPSocket.recv(buffer)
TCPSocket.closed?
TCPSocket.close
TCPSocket.shutdown(how)

TCPServer

TCPServer.new(hostname,port)
TCPServer.accepting?
TCPServer.send(str)
TCPServer.recv(size)
TCPServer.recv(buffer)
TCPServer.closed?
TCPServer.close
TCPServer.listen(nb_sock)
TCPServer.accept
TCPServer.shutdown(how)

That’s all I’ve done, I make other functions in the future mainly Socket functions :3

Download

Version 0.0.0.2

From MediaFire

Version 0.0.0.3
From MediaFire

Version 0.0.0.4
From MediaFire


Version 0.0.0.4b
From MediaFire


How To Use

In the first Script, set this line :
init_rgss_mod() if Kernel.private_method_defined?:)init_rgss_mod)
And launch your Game with YuriRGSSMod.exe

When you encrypt your Game, you can edit YuriRGSSMod.exe : change the Icon and the MainWindow Caption (it’s a string inside a StringTable).
The RGSSAD file should be name like the the YuriRGSSMod file so if you rename YuriRGSSMod.exe by YourGame.exe, the RGSSAD file should be rename YourGame.rgssad and the ini File should be rename YourGame.ini (if you use RTP otherwise just delete this file.)
Note: The debug mode is disabled only if the game is encrypted.


Credits

Dahrkael - The topic that gave me the motivation to program this <3
Enterbrain - The RGSS.
Microsoft - DirectDraw, User32, Kernel32, WinSock etc…
Nuri Yuri - YuriRGSSMod.exe


Last Words

If you have any suggestions or critics about it, I'd like to hear them :3

PS : This is a game Showcase but I don't know where I should post this project ^^'
 
Willing to share your source code? :)

I've done some RGSS hooking for adding debug consoles, but Ruby expansions are something I'd like to try but haven't, on top of that I see you mentioned direct draw, does this mean that you intercept the draw routines too?

Edit: also, I have been working on a network library which has an RGSS intended win32 binding, being able to throw all that into RGSS directly would be awesome, are you willing to share your experiences?

As for ideas, I have a filesystem library that handles .zip files as game resources and has a nice fileio system, these could be great additions as well as Xbox pad support (with haptics), that's something else I've been experimenting with and a binding at RGSS runtime level would be great for that.
 
I must set comments and clean the code before because I've a hard logic ^^
C:
<div class="c" id="{CB}" style="font-family: monospace;"><ol>VALUE Input_ktrigger(VALUE self,VALUE key)

{

    key=(key>><span style="color: #cc66cc;">1)&0xFF;

    <span style="color: #b1b100;">return ((~(lpKeyStateOld[key]&0x80))&(lpKeyState[key]&0x80))>><span style="color: #cc66cc;">6;

}
The Input.ktrigger? function looks like this x)

I didn't use DirectDraw for the moment, only stuff included in windows.h but I know the RGSS is using it so I thought it could be right to mention it.

I didn't make the network lib inside the program and last time I make a server in C++ it was in 2010 but when I'll do this lib I'll share it for sure, it will need to be corrected :3 (I'm not the very best Pokémon master x))

I like your suggestions, I'll try to see how to do this :3 (I'd like also see what you did because I didn't experiment reading zip file...)

PS : For extending ruby : http://ruby-doc.com/docs/ProgrammingRub ... _ruby.html (RGSS1 is using ruby 1.8.1)
And to begin with extending RGSS viewtopic.php?f=48&t=75669 but be aware of RGSS102X.dll, it's the worst RGSS DLL ever :< (If you want, I can give you the pointers I found in RGSS104E.dll :b)
 
Wow that tutorial is awesome, covers exactly the pointer I was looking for.

Why has no one replied to that thread? That is awesome information!

I am quite upset that no-one else took the information and ran with it.
viewtopic.php?f=48&t=75669

The overhead of the Win32 API can be totally avoided using this.

Yes if you have more address ranges then please post them, thanks loads and good work with this.
 
I wasn't registered when I discovered this topic (May 2013) but I tried on the RGSS104E.dll.
That's what I found (and searched, I'm not using everything but if I need something I search the pointer, the last was "rb_class_new_instance" to create a bitmap :3)
 
Have you looked at RGSS2xx and 3xx? I've messed with those DLLs before, making an RGSS cross compatible DLL would sure help a few scripters, I'm considering looking into this, is it something you have tried?

Again, the most I've done is written a debugging console and forwarding some simple utilities for these DLLs, adding a powerful hooking system would certainly be awesome.
 
I though about it, finding the pointer is the same but the functions and constant change a lot x)
It's an interesting thing so I should try :3
 
Double Post (can't make visible Edit) :
I modified the recv function in the 0.0.0.4b version, now the socket close itself if the server/client closed the socket.

I won't make a RGSS3 version now because Enterbrain used an uncommon calling convention : they send some argument in the esi, ecx and edi register so I must program some function's calling in assembly (before I should watch how the arguments are passed x))
 

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