[RESOLVED] (massive knowledge included) Extracting data from an .rxdata...

Started by shdwlink1993, March 30, 2008, 02:16:12 pm

Previous topic - Next topic

shdwlink1993

OK... this is gonna sound a bit stupid. Because I have no clue where that would go in the code, I can only guess. And guesses on my part tend to end in miserable errors and RMXP's whining.

This is the blob of code I'm using. Sorry if it seems like I'm asking you guys about every little step. I'm still learning. :-[

Spoiler: ShowHide
class Scene_Title
  def main
  save = File.open(EXTRACT_LOCATION + '/Save1.txt', 'w')
  file = File.open("save1.nhav", "rb")
  var = []
  scripts = []
  # Read character data for drawing save file
  characters = Marshal.load(file)
  # Read frame count for measuring play time
  Graphics.frame_count = Marshal.load(file)
  # Read each type of game object
  $game_system        = Marshal.load(file)
  $game_switches      = Marshal.load(file)
  $game_variables     = Marshal.load(file)
  $game_self_switches = Marshal.load(file)
  $game_screen        = Marshal.load(file)
  $game_actors        = Marshal.load(file)
  $game_party         = Marshal.load(file)
  $game_troop         = Marshal.load(file)
  $game_map           = Marshal.load(file)
  $game_player        = Marshal.load(file)
  scripts.each_index {|i|
    for var in $game_system.instance_variables
      save.write(var" = "scripts)
      save.write("\n")
    end
    for var in $game_switches.instance_variables
      save.write(var" = "scripts)
      save.write("\n")
    end
    for var in $game_variables.instance_variables
      save.write(var" = "scripts)
      save.write("\n")
    end
    for var in $game_self_switches.instance_variables
      save.write(var" = "scripts)
      save.write("\n")
    end
    for var in $game_screen.instance_variables
      save.write(var" = "scripts)
      save.write("\n")
    end
    for var in $game_actors.instance_variables
      save.write(var" = "scripts)
      save.write("\n")
    end
    for var in $game_party.instance_variables
      save.write(var" = "scripts)
      save.write("\n")
    end
    for var in $game_troop.instance_variables
      save.write(var" = "scripts)
      save.write("\n")
    end
    for var in $game_map.instance_variables
      save.write(var" = "scripts)
      save.write("\n")
    end
    for var in $game_player.instance_variables
      save.write(var" = "scripts)
      save.write("\n")
    end
    save.write("#{$game_system.inspect}\n" +
               "#{$game_switches.inspect}\n" +
               "#{$game_variables.inspect}\n" +
               "#{$game_self_switches.inspect}\n" +
               "#{$game_screen.inspect}\n" +
               "#{$game_actors.inspect}\n" +
               "#{$game_party.inspect}\n" +
               "#{$game_troop.inspect}\n" +
               "#{$game_map.inspect}\n" +
               "#{$game_player.inspect}\n")
  }
  save.close
  p ".rxdata extraction successful! Time needed: #{Time.now-$time} seconds."
  exit
  end
end


And now, I'll be leaving for school. Quickly.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Blizzard

April 10, 2008, 11:45:34 am #41 Last Edit: April 10, 2008, 11:51:36 am by Blizzard
Put it in main, just above "begin" and add "exit" (without the double quotes) at the end (also above "begin"). The stuff will get executed and RMXP will exit.

Quote from: shdwlink1993 on April 09, 2008, 06:50:08 pm
Oh, yea. I left a note for you at the bottom of the last post, Blizz. I don't think you saw it, though.


I did see it. Smart way to protect my work, eh? ^_^ WcW said the same when he hacked DREAM. xD
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.

shdwlink1993

April 10, 2008, 09:35:32 pm #42 Last Edit: April 10, 2008, 10:30:51 pm by shdwlink1993
I was meaning Fantasist's line of code with the scripts.each_index. I'm not quite sure what you're talking about, Blizzard. Also, exit is already in there. Also also, the reason it's in scene_title is mainly that I had a bug problem and I forgot to switch it back, something that's happening... now.

Also, just wondering Blizz, how exactly did you get the .dll encrypted in the first place?
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Blizzard

I thought you were refering to this:

QuotePPS. The license redef was pretty funny.


When you said this:

QuoteOh, yea. I left a note for you at the bottom of the last post, Blizz. I don't think you saw it, though.


And the encryption is pretty simply. I put DREAM into a text file, opened it in RMXP as string and encrypted every character with its ASCII value. Then I put all numbers into an array and dumped the array into a Marshal file. The decoder is in DREAM_ext.rb, which is only a dumped string.
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.

shdwlink1993

I got that bit, Blizz. I was referring to this line:

QuotePut it in main, just above "begin" and add "exit" (without the double quotes) at the end (also above "begin"). The stuff will get executed and RMXP will exit.


I wasn't sure what you meant. I understand exactly what you meant with the latter part. Sorry for the confusion over that.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Blizzard

Original Main script:

#==============================================================================
# ** Main
#------------------------------------------------------------------------------
#  After defining each class, actual processing begins here.
#==============================================================================

begin
  # Prepare for transition
  Graphics.freeze
  # Make scene object (title screen)
  $scene = Scene_Title.new
  # Call main method as long as $scene is effective
  while $scene != nil
    $scene.main
  end
  # Fade out
  Graphics.transition(20)
rescue Errno::ENOENT
  # Supplement Errno::ENOENT exception
  # If unable to open file, display message and end
  filename = $!.message.sub("No such file or directory - ", "")
  print("Unable to find file #{filename}.")
end


YOUR Main script:

#==============================================================================
# ** Main
#------------------------------------------------------------------------------
#  After defining each class, actual processing begins here.
#==============================================================================

### Here goes your code.
exit

begin
  # Prepare for transition
  Graphics.freeze
  # Make scene object (title screen)
  $scene = Scene_Title.new
  # Call main method as long as $scene is effective
  while $scene != nil
    $scene.main
  end
  # Fade out
  Graphics.transition(20)
rescue Errno::ENOENT
  # Supplement Errno::ENOENT exception
  # If unable to open file, display message and end
  filename = $!.message.sub("No such file or directory - ", "")
  print("Unable to find file #{filename}.")
end
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.

shdwlink1993

OOOhhhh. That's what you meant. OK, sorry about that, I wasn't quite understanding you.

And I had a question for you, Blizz: I'm trying to get a battle similar to the Prologue fight with Rivy, you know, where the entire thing is automated, and I was wondering: How the heck did you get it to skip selecting attacks at the beginning  ??? ?  I've been trying to to almost every stupid option on that selection for when it happens, but it either skips all the actions or it won't skip the fight selection.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Blizzard

Make a status effect, call it Normal, make its rating 10 and inflict it at the beginning of the battle. That's it.
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.

Fantasist

April 18, 2008, 11:52:32 am #48 Last Edit: April 18, 2008, 11:54:22 am by Fantasist
QuoteMake a status effect, call it Normal, make its rating 10 and inflict it at the beginning of the battle. That's it.


Here's what I did:


I've got to set the rating I see ^.^
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Blizzard

Not really. You can set it to 1 alternatively. This will make every other status effect be displayed before. If two or more states are inflicted only the ones with the highest rating will be displayed if there isn't enough space to display them.
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.

Fantasist

So rating is only for displaying? I thought it was something else...
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Blizzard

Just search for .rating in the scripts, you will find out that the only place where it is used is the sorting of the state ID array where the topmost are being displayed.
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.

shdwlink1993

ARGH! I can't believe it was so obvious! A state! I was thinking it was going to have to be some script editing. I really need to remember that there are other things in RPG Maker that I should learn other than scripts (although scripts are one of the biggest and coolest things to learn ;D).

But just one other thing: I want there to be a very small Battle Tutorial that occurs in the battle itself. A state won't help much here, because the turn pretty much looks like this:

Actor 1 selects attack
Actor 2 selects attack
Messages and stuff
Actor 1 attacks
Actor 2 attacks

The problem is that I need to move messages and stuff above selecting things. Is there a similar, hopefully less "I-am-such-an-idiot-for-not-thinking-of-such-a-thing" method, way of doing that?

Oh, and yes, the state thing deals heaping amounts of help to my Introduction scene. Thanks ;D.

PS. Is it just me, or am I asking for help here a lot?
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Blizzard

It's no problem, I wouldn't be having this forum if I wouldn't want to help. ^_^ And your questions are different from the stuff everybody asks. ^_^

If you want a tute that actually selected attack and stuff, you need some rather complicated scripting of an alternate battle scene.
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.

shdwlink1993

Nothing nearly that ridiculous. I mean that the guy would say what you should be doing before you select the commands, and not after.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Fantasist

Try using the battle event commands (in the Monster Troop tab in Database). You might not be able to explain anything while the turn has started (i think), but explain a cuple of things each turn.

And btw, RPG Advocate did it in his game Phylomortis Avante Grande, a real-time battle tutorial. If you're desperate or curious, check it out, the project is unencrypted.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




shdwlink1993

Slight catch, Fantasist: Phylomortis went down at the end of March >:(. That and I don't know where else to get that game.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Fantasist

I have it, but too bad I can't upload it right now :(
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews