Some questions

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
Hello,

Many of you may be informed about my presence on the forums.

I started making RGSS3 scripts about three months ago, so I'm not quite a newbie to all of the terms.

However, I have to ask some questions.

I please moderators not to close this topic when first two questions are answered, because I have the third, and the most complex one awaiting, and I can't really post the whole problem now.

So, let's start

1) Are files in encrypted archive rewritable?

That means, can I store Saves and such in the Data folder?

I suppose not, because it is ENCRYPTED, but just to make sure...

2) How to read Scripts.rvdata2 ?

I know that I can use load_data("Data/Scripts.rvdata2"), but the returned object is an array of arrays of some numbers, the script name, and some \xsomething\xsomething text.

So, when I worked in Python, you could just print those characters out, and it would display them.

But, in Ruby those \xsomething characters also have something to do with pack and unpack methods, I assume.

So, should I do something like

that_xsomething.unpack('something').pack('somethingelse')

and I'll be able to read it like that?

I know some scripts actually do that, like Estriole - Script Control, but I don't know that encryption method (is it really encrypted or?)

So, thanks for answering, sorry if posted in the wrong place or did something that mustn't, and please, I say this again, do not lock the topic after first two questions are answered.
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
383
Reaction score
91
First Language
English
Primarily Uses
I'm not sure about RMVXA, but in RMXP the scripts.rxdata used Zlib to compress the scripts. So you had some numbers, the script name, and then the actual source code was compressed with Zlib. To un-compress it, you had to call Zlib::Inflate.inflate(script). I'd guess that RMVXA uses something similar if I doesn't actually use that same method.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
1) Possible.But by default saving methods, you cant overwrite them...

2) It returns an aray of arrays that has the scripts saved in quite a few ways. It has a key of sorts, an encrypted version of the script and so on...
 

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
Zlib::Inflate.inflate(script)That's just what I needed!

But, there is a bit of problem with reading the scripts...

I tried to put ALL scripts in ONE row, by adding ;'s at the end of every row.

(Comment Remover ran earlier)

At first, I did it by putting the result string in the file scripts.txt

Problem occurred when I tried to add the contents of the file to the script editor.

The script editor crashed.

Then, I tried to make the new Scripts.rvdata2 with this code :

data = load_data("Data/Scripts.rvdata2")str = ""data.each{|d|Zlib::Inflate.inflate(d[2]).split(/[\r\n]/).each{|s|str += s + ";"}}File.copy("Data/Scripts.rvdata2", "Data/Scripts.rvdata2.bak")f = File.open("scripts.txt", "w")Marshal.dump([25125893, "The BIG Script", Zlib::Deflate.deflate(str)])f.closeNope.

When started Game.exe got an load script error, and when opened the scripts in RPGMVXA got an "Internal error."

Is it possible to do something like this?

And, my next question is....

How to make animations on Sprites?

I made a Sprite that inherits from Sprite_Base, and called start_animation.

Parameters were correct, and the correct methods were called (tested it by adding p "something" in the update_animation method), but nothing actually updated.

Is my Sprite invisible? I tried to set the Z value to 100000, and experimented with OX and OY, but nothing actually happened.

Thanks for your replies!
 
Last edited by a moderator:

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
383
Reaction score
91
First Language
English
Primarily Uses
So why are you trying to read the scripts data? Knowing that might help us help you.

As for your Sprite question, did you make your own Sprite class? Or did you just make an instance of the sprite class?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Your marshal.dump seems to be missing the file where you're dumping...

As for animating, you need to update the sprite each frame of your scene (by calling SpriteObject.update if I remember right, don't have RM with me right now)... It won't update automatically ..
 
Last edited by a moderator:

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
@Engr. Adiktuzmiko

Actually, I had to rewrite this code, and passing the file to Marshal.dump is just a rewrite mistake.

It was passed in the original code

I think I tried to call 'update' from the update method, but still didn't work.

@Mobius

I'm trying to make the scripts data very unreadable, just from curiosity.

It's also an another layer of securing the Game.rgss3a, if I want to add some encryption to the scripts.

I know, I know, it's stupid, it'll change basically nothing, but I'm still curious on how to do that

I'm trying to convert this :

def a do_something blah blah blahendto this :
Code:
def a;do_something;blah;blah;blah;end
And for the Sprite, my class is an instance of Sprite_Base.
 
Last edited by a moderator:

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
383
Reaction score
91
First Language
English
Primarily Uses
Ok, after checking over the code you posted, I found one mistake. When you dump "The Big Script", you dumpped it as a single level array. Even though there's only one entry is still needs to be one level deep. So try changing: 

Marshal.dump([25125893, "The BIG Script", Zlib::Deflate.deflate(str)])

to

Marshal.dump( [ [25125893, "The BIG Script", Zlib::Deflate.deflate(str)] ] )
 

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
@Mobius

Oops, my mistake.

But now, when I try to start it, the Game.exe crashes with no error, just opens and closes, and when I try to open it with RPGMVXA, it crashes also.

Is there even a way to do something like that?
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
383
Reaction score
91
First Language
English
Primarily Uses
I don't know. I've done some work exporting scripts to text files, and importing them back in later after editing them with a text editor. I've never tried changing the content of scripts via scripting.
 

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
Hello again,

Back with another question, while for the Sprite question I'll post the code later.

Can I change what F12 does?

I deleted the possibility that F1 and F2 do something, and I managed to exit the game (not restart it) with F12 with this code :

#==============================================================================# ** RGSSReset#------------------------------------------------------------------------------#  Exception class providing notifications for when the F12 key is pressed # during game execution. Name changed from the hidden class Reset before RGSS2. #============================================================================== class RGSSReset < Exception  include KOCKA    #--------------------------------------------------------------------------  # * Aliases  #--------------------------------------------------------------------------  alias :kocka_random_alias_exception_8x3M :exception    #--------------------------------------------------------------------------  # * Raise Exception  #--------------------------------------------------------------------------  def exception(*args)    exit if DISABLE_F12    kocka_random_alias_exception_8x3M(*args)  end  endBut still, I can't rescue an exception from inside an exception, right?

I also managed to do thing with rescuing the exception in Main, but it still just reboots the game from Title, and does not clear the Scene before.

Can I just resume the rgss_main?

Or is the code for rgss_main provided on some way, so we can rewrite it and disable F12?

(Or is it Graphics.update method?)

EDIT: Tried some things, managed to disable F12, unless you spam it.

Looks like in EVERY SINGLE ENTERBRAIN'S METHOD THERE IS A CHECK FOR RGSSRESET and then throwing a new exception.

WTF????

Currently I stopped the F12 presses in Window.update, Graphics.update, Graphics.transition, Input.update, and still while spamming it's giving me errors (sometimes it even gives me errors in lines of comments!)

On the other note... is this legal?

EDIT2 : OMG!!! I GOT A BACKTRACE FROM RUBY INTERPRETER!!!

{0062}:409: [BUG] cfp consistency error - sendruby 1.9.2p0 (2010-08-18 revision 29036) [i386-mswin32_90] -- control frame ----------c:0026 p:---- s:0076 b:0076 l:000075 d:000075 CFUNC  :timesc:0025 p:0017 s:0073 b:0073 l:000072 d:000072 METHOD {0062}:409c:0024 p:0021 s:0070 b:0070 l:000069 d:000069 METHOD {0135}:213c:0023 p:0043 s:0067 b:0067 l:000066 d:000066 METHOD {0135}:189c:0022 p:---- s:0062 b:0062 l:000061 d:000061 FINISHc:0021 p:---- s:0060 b:0060 l:000059 d:000059 CFUNC  :newc:0020 p:0013 s:0055 b:0055 l:000054 d:000054 METHOD {0200}:88c:0019 p:0034 s:0049 b:0049 l:000048 d:000048 METHOD {0135}:598c:0018 p:0021 s:0045 b:0045 l:000044 d:000044 METHOD {0135}:580c:0017 p:0020 s:0042 b:0042 l:000041 d:000041 METHOD {0135}:558c:0016 p:0011 s:0039 b:0039 l:000038 d:000038 METHOD {0107}:21c:0015 p:0073 s:0036 b:0036 l:000035 d:000035 METHOD {0200}:159c:0014 p:0078 s:0033 b:0033 l:000032 d:000032 METHOD {0008}:23c:0013 p:0011 s:0030 b:0030 l:000029 d:000029 METHOD {0180}:931c:0012 p:0015 s:0027 b:0027 l:001d74 d:000026 BLOCK  {0205}:39c:0011 p:0007 s:0025 b:0025 l:000017 d:000024 BLOCK  :1c:0010 p:---- s:0023 b:0023 l:000022 d:000022 FINISHc:0009 p:---- s:0021 b:0021 l:000020 d:000020 CFUNC  :loopc:0008 p:0011 s:0018 b:0018 l:000017 d:000017 METHOD :1c:0007 p:0009 s:0015 b:0015 l:001d74 d:000014 BLOCK  {0205}:39c:0006 p:---- s:0013 b:0013 l:000012 d:000012 FINISHc:0005 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC  :loopc:0004 p:0127 s:0008 b:0008 l:001d74 d:000007 EVAL   {0205}:39c:0003 p:---- s:0006 b:0006 l:000005 d:000005 FINISHc:0002 p:---- s:0004 b:0004 l:000003 d:000003 CFUNC  :evalc:0001 p:0000 s:0002 b:0002 l:001d74 d:001d74 TOP----------------------------- Ruby level backtrace information ----------------------------------------ruby:0:in `eval'{0205}:39:in `<main>'{0205}:39:in `loop'{0205}:39:in `block in <main>':1:in `rgss_main':1:in `loop':1:in `block in rgss_main'{0205}:39:in `block (2 levels) in <main>'{0180}:931:in `run'{0008}:23:in `run'{0200}:159:in `main'{0107}:21:in `main'{0135}:558:in `start'{0135}:580:in `create_all_windows'{0135}:598:in `create_file_window'{0200}:88:in `new'{0200}:88:in `new'{0135}:189:in `initialize'{0135}:213:in `refresh'{0062}:409:in `draw_all_items'{0062}:409:in `times' [NOTE]You may have encountered a bug in the Ruby interpreter or extension libraries.Bug reports are welcome.For details: http://www.ruby-lang.org/bugreport.html
I was spamming F12 while trying to change scene to Scene_Load, and suddenly... BAM! An error window showed and Ruby logged the backtrace to the console.

WHAT IS HAPPENING???
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
About the previous problem:


It might be that your edit to the scripts file somehow changed or removed the line which initializes the game... Remember that initializing the game is also written in the scripts at the lowest most part.
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
383
Reaction score
91
First Language
English
Primarily Uses
Depending on what you want to do with F12, there are easier ways to accomplish them than digging around in Exception classes. If you change main to this:

$run_once = falsergss_main { unless $run_once $run_once = true SceneManager.run end }Then it will run the provided block on startup, but then when you press F12 it will exit. 
 

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
@MobiusXVI : I know, but what if I want to disable F12, like I did with F1 and F2?

@Engr. Adikutzmiko : I don't think it was that. Even if it was, I have no way to check it, because Script Editor is still crashing...
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
383
Reaction score
91
First Language
English
Primarily Uses
Out of curiosity, why do you want to disable it? 

Although it's not the prettiest method, one way of disabling the effect is to separate the SceneManager methods. So rgss_main looks something like this:

def rgss_main(&block) yieldresuce RGSSReset retryend
So anytime F12 is pressed and the RGSSReset error is raised, the method catches it and retries itself. This ends up calling SceneManager.run again which re-initializes the game. 

def self.run DataManager.init Audio.setup_midi if use_midi? @scene = first_scene_class.new @scene.main while @scene end 
But if you were to split that up into two methods like this:

def self.init DataManager.init Audio.setup_midi if use_midi? @scene = first_scene_class.new end def self.run @scene.main while @scene end 
Then you could initialize everything and just pass the 'run' method to rgss_main like this:

SceneManager.initrgss_main { SceneManager.run } 
Now whenever you press F12, the screen will flash black but execution will continue normally.
 

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
@MobiusXVI

Hey, that's a great idea!

It's just happening, that my Mouse script is crashing, because of 'disposed sprite', but I suppose I can add in the RGSSReset some disposal and re-initialization code.

(And I can make some screenshot processing to make that black screen more logic to player, if he ever presses F12 :) )

I know, I know, too many questions....

But, here is another one.

Let's suppose I want to use a default Ruby library not included in RGSS3, like Net (for Internet communication with Net::HTTP - yes, I know there is RGSS WebKit) or OpenSSL (for ciphering with OpenSSL::Cipher::AES - because XOR is just TOO WEAK)

But, Net module requires 'socket.so' and OpenSSL requires 'openssl.so'

Requiring those throws an error.

Next, I found out that FyxInput script is using LoadSo DLL, and loading it through Win32API

FenixFyreX made a script also, that implements loading SO's through require

It works for FenixFyreX's fyxinput.so, but for openssl.so it's not working and throwing an

LoadError: 127: The specified procedure could not be foundThis is the excerpt from FenixFyreX's script:

# Get the addresses of method function and Objectmm, oo = method:)method).object_id * 2, Object.object_id * 2Win32API.new("msvcrt-ruby191", "Init_LoadSo", "ii", "i").call(mm, oo) #------------------------------------------------------------------------------## require_so(file)                                                             ##    file - String                                                             ## Loads a so file in via msvcrt-ruby191.dll.                                   ##------------------------------------------------------------------------------#def require_so(file)  dir = File.dirname(file)  name = File.basename(file, ".so")  load_so "#{dir}/#{name}.so", "Init_#{name}"end #------------------------------------------------------------------------------## require(name)                                                                ##    name - String                                                             ## Alias require to add in so files.                                            ##------------------------------------------------------------------------------#alias require_rb requiredef require(name)old_name = name.dup  type = nil  name.gsub!(/\.(so|rb)$/) do    type = $1.intern    ''  end  if name =~ /^[A-Z]:/    dirs = [""]  else    dirs = $:.map{|dir| "#{dir}/"}  end  dirs.each do |dir|    if type != :rb      file = "#{dir}#{name}.so"      return require_so(file) if File.exist?(file)    end    if type != :so      file = "#{dir}#{name}.rb"      return require_rb(file) if File.exist?(file)    end  end  raise LoadError, "No such file #{old_name}"end $:.push "./Data/ext"$:.uniq!
That means maybe Init_openssl method in the library does not exist?

Nope. Checked it.

In all Ruby libraries I think that method MUST exist...

Does anybody know what is causing the problem?

(FenixFyreX is not amongst us currently, so asking him would require an unlimited amount of waiting)

And thank you all for answering.

EDIT : 

FyxInput : http://forums.rpgmakerweb.com/index.php?/topic/34073-fyxinput

LoadSo : https://github.com/wanabe/LoadSo

OpenSSL (not the original one, but the one where I found out all libraries have Init_ methods) : https://github.com/emboss/ruby-openssl
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,018
Messages
1,018,357
Members
137,803
Latest member
andrewcole
Top