Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 5 posts ] 
    silver wind
  Tue Jun 14, 2016 11:33 am
Chompil
User avatar
Member

apparently, the script:
include 'file.rb'
just takes a ruby file from the game folder.
/facepalm/ took me too long to figure why i can't load ruby libraries this way.
so if I need to load a library/gem, I need to get its ruby code. but where do I get it?
I have ruby installed in my PC, and when I search .rb files I get no results. is ruby code saved with a different extension? or is it saved on a server, and gems just refer to it? I tried searching the ruby website, but it mainly has docs and small snippets of code. I saw people writing complex scripts, like 3D modes, and keyboard/mouse support, so I assumed it's possible. do people just write everything from scratch?


Top Top
Profile      
 

    ZenVirZan
  Tue Jun 14, 2016 12:04 pm
very undead
User avatar
Sponsor

Inept Evil Stooge

Location: land of the snags 'n tracky-dacks
RPG Maker doesn't use Rubygems, so you'll need to find a stand-alone way to achieve whatever it is you're trying to do. This is why netplay was such a pain in the ass to achieve back in the day.

Rubygems is Ruby's method of distributing libraries, which you can install from the repository through command line. As far as I know, you can't use any 'include x' in your code, because RM games use what's in the script editor as the scripts (which are technically all merged into one file). It may be possible to store scripts in a folder beside Audio and Data if you wrote your own 'include' equivalent, but they will not be compressed and packaged so people could open it and edit it whenever they want.

You can find the core scripts at (assuming it's the same layout as 1.9.x, and you're on Windows):
[installdir]/lib/ruby/x.x.x/


You can find installed gems at:
[installdir]/lib/ruby/gems/x.x.x/gems

_________________
Image


Top Top
Profile      
 

    Amy
  Tue Jun 14, 2016 12:23 pm
User avatar
Staff

Big Dumb Guy
Just take note you won't be able to use any that have .so files in them, such as the sockets library.


Top Top
Profile      
 

    silver wind
  Tue Jun 14, 2016 1:26 pm
Chompil
User avatar
Member

thanks, ZenVirZan. I'll search there.
hopefully I can make this work. cause now that I think of this, I'll have to handle dependencies.
include 'x' works for me, not sure what you mean. I can't remember if I used eval(text), or it was done automatically but I can call methods/classes written in separate .rb file.

Princess Amy,
yeah, I heard about the .so thing.

so.. can I just use DLL files? I've seen people use them in scripts.


Top Top
Profile      
 

    ZenVirZan
  Tue Jun 14, 2016 1:49 pm
very undead
User avatar
Sponsor

Inept Evil Stooge

Location: land of the snags 'n tracky-dacks
silver wind wrote:
thanks, ZenVirZan. I'll search there.
hopefully I can make this work. cause now that I think of this, I'll have to handle dependencies.
include 'x' works for me, not sure what you mean. I can't remember if I used eval(text), or it was done automatically but I can call methods/classes written in separate .rb file.

Princess Amy,
yeah, I heard about the .so thing.

so.. can I just use DLL files? I've seen people use them in scripts.
Right, I must have been thinking of something else. You'll need to store it in your own format though if you don't want people tampering with it.

And yeah DLL calls work perfectly fine; the Win32API is available.

_________________
Image


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


Who is online

Users browsing this forum: No users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group