Xenosaga Information Database
#1
Xenosaga Information Database
by Nakate
v1.1
Jul 26 2007

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Cleaned it up a bit, made it easier to impliment, and overall more user-friendly

For a game I'm working on, I decided to make a kind of database accessible from the menu that would let you look through all of the characters you've met so far in the game, showing pictures of them all. So at any point you can check the database and see who all you've met. Due to the flexible nature of the coding, it doesn't actually have to be characters, but just snipits of information you run across. Essentially it's an expanding database with entries that can be added at the game maker's will, whenever the player sees a specific event. However, until I figure out a way around it, it is mandatory that you have a picture to associate with each entry. It is easy enough, however, to just put in a blank image for an entry with no picture (say, for example, a .png entirely set to transparent) It also allows you to use the "shoulder" buttons Q and W to go through the database you've made. Now I'm not the best scripter in the world, and though I know a decent amount of C++, this is the first real work I've done with Ruby. As such, I'm pretty sure it could be written better or improved by someone else :P

The code is divided into three sections that just need to be inserted anywhere above main.

Entry 1

Entry 2

Entry 3

From there, the database menu can be called with:
Code:
$scene = Scene_CharMenu.new

So, for example, you want to change the "Save" option in the menu (since I just disable it, anyway) to call the database. Change this in Scene_Menu:
Code:
when 4 #the save option
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Call database menu
$scene = Scene_CharMenu.new


Now, to explain how this works. The menu calls entries based on number. You make a database yourself (which I'll get to), with each element given a number. The menu uses this number to display the entry. It also displays an image, named after this number. The image must be in Graphics/Pictures/characters/

So, for example, if I want to add an entry, I look in the second code section Window_CharMenu, at the bottom and add a title:
Code:
case index
when 0
return "Rudaux"
when 1
return "Hilda"
when 2 #<----- new entry
return "The great war."
end

Now go to the third section, Window_Character, and add the actual entry:
Code:
when 0
#general length guideline----------------------|
@L1 = "Rudaux"
@L2 = "Age: 19"
@L3 = "Zodiac: Capricorn"
@L4 = "Height: 181cm"
@L5 = "Weight: 93.6kg"
when 1
@L1 = "Hilda"
@L2 = "Age: 29"
@L3 = "And she did stuff, yeah, yeah."
when 2 #<----- new entry
@L1 = "Ages ago there was a great war."
@L2 = "Lots of people died. It was sad."
end


Notice you don't have to meet a certain number of lines. There is a general length guideline at the top so you don't make it too wide, and each entry can support up to 18 lines. The last thing to do now is make the character directory in Pictures, and add 2.png (or jpg, it doesn't really matter) Once again, that's Graphics/Pictures/characters/2.png

Now that it's in the database and happily waiting to be discovered, we have to give the entry to the player, so he can access it from the menu. In an event, call a script. Put in the script:
Code:
$chardata.push(0)
$chardata.push(2)



Updated to v1.1
Cleaned it up a bit, made it easier to impliment, and overall more user-friendly

For a game I'm working on, I decided to make a kind of database accessible from the menu that would let you look through all of the characters you've met so far in the game, showing pictures of them all. So at any point you can check the database and see who all you've met. Due to the flexible nature of the coding, it doesn't actually have to be characters, but just snipits of information you run across. Essentially it's an expanding database with entries that can be added at the game maker's will, whenever the player sees a specific event. However, until I figure out a way around it, it is mandatory that you have a picture to associate with each entry. It is easy enough, however, to just put in a blank image for an entry with no picture (say, for example, a .png entirely set to transparent) It also allows you to use the "shoulder" buttons Q and W to go through the database you've made. Now I'm not the best scripter in the world, and though I know a decent amount of C++, this is the first real work I've done with Ruby. As such, I'm pretty sure it could be written better or improved by someone else :P

The code is divided into three sections that just need to be inserted anywhere above main.
entry 1


entry 2


entry 3


From there, the database menu can be called with:
Code:
$scene = Scene_CharMenu.new


So, for example, you want to change the "Save" option in the menu (since I just disable it, anyway) to call the database. Change this in Scene_Menu:
Code:
when 4  #the save option
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Call database menu
        $scene = Scene_CharMenu.new


Now, to explain how this works. The menu calls entries based on number. You make a database yourself (which I'll get to), with each element given a number. The menu uses this number to display the entry. It also displays an image, named after this number. The image must be in Graphics/Pictures/characters/

So, for example, if I want to add an entry, I look in the second code section Window_CharMenu, at the bottom and add a title:
Code:
case index
      when 0
        return "Rudaux"
      when 1
        return "Hilda"
      when 2          #<----- new entry
        return "The great war."
      end

Now go to the third section, Window_Character, and add the actual entry:
Code:
when 0
        #general length guideline----------------------|
        @L1 = "Rudaux"
        @L2 = "Age: 19"
        @L3 = "Zodiac: Capricorn"
        @L4 = "Height: 181cm"
        @L5 = "Weight: 93.6kg"
      when 1
        @L1 = "Hilda"
        @L2 = "Age: 29"
        @L3 = "And she did stuff, yeah, yeah."
      when 2                                         #<----- new entry
        @L1 = "Ages ago there was a great war."
        @L2 = "Lots of people died. It was sad."
      end


Notice you don't have to meet a certain number of lines. There is a general length guideline at the top so you don't make it too wide, and each entry can support up to 18 lines. The last thing to do now is make the character directory in Pictures, and add 2.png (or jpg, it doesn't really matter) Once again, that's Graphics/Pictures/characters/2.png

Now that it's in the database and happily waiting to be discovered, we have to give the entry to the player, so he can access it from the menu. In an event, call a script. Put in the script:
Code:
$chardata.push(0)
$chardata.push(2)

Now, you see, you can access element 0 "Rudaux" and 2 "The great war" from the database menu.

Screenshots below show a database with many more entries. In my game, I used it as a character database, logging everyone I've met, but since it lets you add any entry at any time, and lets you add any information inside, this can be used as any kind of expanding information database for the player.

(Screenshots unavailable - Images lost over time)
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Clive's Hero Database SephirothSpawn 0 2,351 02-22-2006, 01:00 PM
Last Post: SephirothSpawn
  Advanced Monster Database SephirothSpawn 0 2,731 11-19-2005, 01:00 PM
Last Post: SephirothSpawn



Users browsing this thread: 2 Guest(s)