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.

[RESOLVED] Photo Album?

lmkris

Member

  Have any of you ever played Harvest Moon 64?  I can't remember if this was in any of the other various versions, but 64 specifically had this little photo album you could look at.  It would be empty until you hit certain plot points... like, for example, when you got married, a picture was added in of the marriage.  Stuff like that.

  Well, I've sat and looked at script tutorials, scripts in the game and scripts on the forums, hoping that I could figure it out, but...  meh.  I can't do it.  :(

  Basically, I'm imagining it in my head to have an open book background that has the placeholder polaroids in place, and when you hit certain events, the switch (you know, switches and variables) would be turned on, and that'd show the picture in the photo album that'd be accessible... preferrably from the start menu, but since switches are in-game, it'd probably have to be on the item/equip/status/etc menu, wouldn't it...  though maybe you can load switches from saved games?  beats me!
  I've honestly got no clue how any of this would work, or even be possible.  Cause it'd be nice if the picture could be highlighted so the "full" version would cover the screen when you hit enter/whatever, and if you could go to the "next page" or go back a page, et cetera, like a photo album...

  It's really non-essential, just for fluff, for side-events in the RPG.  I'm using the XP version if that helps any...

  If I'm not making any sense/being unclear, let me know and I'll reiterate... hopefully less rambly.  I can do all the pictures and aligning of things - that much I'm capable of... but I've not a clue as to how the script-switches interaction would work, or the other basic but necessary things like that.  ^^;;

  If it's not possible or too hard, I can easily just leave it out.  ^^  Thank you for any and all help on this!  And it'd be helpful but not required at all if you could add in small comments (the # things) so I can try to learn from any script provided... thank you.  ^^

  Also, a very random side-question... does anyone know how to auto-close a "show text" message box, if that's possible?  I'm using... umm, I think it's ccoa's... the Universal Message Script.  What I'm trying to do is have it show some text ("This is my sink...") with one face-graphic, auto-close the message, switch to a new face graphic, and show the "full" text ("This is my sink... oops, I forgot to put a cup away."), so it'd kind of look like he changes expressions in mid-sentence.  Thank you again ^^
 
I think rm2k3 had something like this. I believe it was based on common events though. The name prexus keeps coming  to mind and I remember the mascot of the demo was a white haired character... I could be wrong but I know something similar to what you're asking HAS been done. So fear not :)
 

poccil

Sponsor

The script below implements a simple photo album.  Put the script just before
the last script section in the script editor. Edit the array
ALBUMPICTURES at the top of the script to customize it.  For each entry,
enter the switch that will activate the picture, a title for the picture,
and the picture's file name (located in Graphics/Pictures/).

The script doesn't have a fancy user interface, though, but it does illustrate
how a photo album can be implemented.

Code:
class Scene_Album
 ALBUMPICTURES=[
   # Switch number, Title, Picture image file
   [1,"Picture 1","Battle_Start"],
   [5,"Picture 2","cursor"],
   [8,"Picture 3","Enemies_Turn"],
   [12,"Picture 4","Players_Turn"]
 ]
 def main
  @help=Window_Help.new
  @help.set_text("Photo Album")
  albumtexts=[]
  albumpictures=[]
  i=0
  for pic in ALBUMPICTURES
   i+=1
   if $game_switches[pic[0]]
    albumtexts.push(sprintf("#%d %s",i,pic[1]))
    albumpictures.push(pic[2])
   end
  end
  if albumtexts.length==0
    albumtexts.push("")
  end
  @picwindow=Window_Base.new(0,0,33,33)
  @picwindow.z=400
  @picwindow.visible=false 
  @album=Window_Command.new(640,albumtexts)
  @album.y=64
  @album.x=0
  @album.height=480-64
  Graphics.transition(10)
  begin
   Graphics.update
   Input.update
   @help.update
   @album.update
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     $scene=Scene_Menu.new(0)
     break
   elsif Input.trigger?(Input::C)
     if @album.index>=albumpictures.length
       $game_system.se_play($data_system.buzzer_se)
     else
       $game_system.se_play($data_system.decision_se)
       @picwindow.contents=RPG::Cache.picture(
        albumpictures[@album.index])
       @picwindow.width=@picwindow.contents.width+32
       @picwindow.height=@picwindow.contents.height+32
       @picwindow.visible=true
       @album.active=false
       loop do
         Graphics.update
         Input.update
         @help.update
         @album.update
         @picwindow.update
         if Input.trigger?(Input::B) || Input.trigger?(Input::C)
          $game_system.se_play($data_system.cancel_se)
          break
         end
       end
     end
     @picwindow.visible=false
     @album.active=true
   end
  end while $scene==self
  Graphics.freeze
  @album.dispose
  @help.dispose
 end
end

After adding that script, use the following snippet to call the photo album from your
menu system:

Code:
$scene=Scene_Album.new

Note that the photo album script returns to the main menu when the player cancels.

----

To make a message window close automatically in the Universal Message System, use the command \w 
 

lmkris

Member

Thank you for the script and the auto-close command... I feel like I should have been able to find the command on my own.  *durr*  Sorry about that.  :)

Thank you!
 

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