[RESOLVED] Artwork Viewer...[Completed by Blizzard]

Started by Calintz, January 16, 2008, 12:28:34 am

Previous topic - Next topic

Calintz

I do have an event system created that allows this feature to be possible, but it takes a lot of code that I know isn't necessary. More importantly, the limitations are ate the very basic, because it is an event system that only shows pictures...

**First off, I would like to state in advance, that if any scripter so chooses to fulfill my request, that I am truly grateful for your effort and contribution, and that your name WILL posted into "Well in the Woods" credits, and that I will either "create or modify" a character sprite for you (bumped to top priority). I am asking that this script be developed in a special fashion. That is why I am willing to repay the favor. I know this is an easy script to create, because it just calls a new scene, consisting of a window. I just don't understand how to script yet.

The Request Itself
I would like this system to follow the basic features in Blizzard's CMS Hybrid Edition(which I am currently using). If you recall, Blizzard allows the user the option of changing the game's windowskin at any given time. It would be FANTASTIC!! If someone could design this system relatively close to that. Here's what I mean: I would like to be able to activate this feature by selecting Blake's artbook from the quest item's screen, and when the book is selected, I will have it call a common event(This script). Of course, this script will call a new scene, bringing up a new window, set up like the options menu in Blizzard's CMS. In Blizz's CMS, you have like 7 options...The main difference s that the Artbook will be the only thing in this scene, and by pressing Left or Right on your keyboard, you will scroll through the pictures, and by pressingenter you can view the pic full size.

**If at all possible, I would like the scene to be named >> ($scene = Scene_Blakesartwork.new)

WILL SOMEONE PLZ DO THIS FOR ME??

Nortos

hmm I'll have a look at it for you I've learned how to use switches ect with scripting I can't promise anything but I might be able to do it :)

Calintz

If you would just try, you would be doing more than anyone else, so thank you Nortos...  :)
Just think, if you can create this script, then you will be in my credits for special thanks & Scripting!!  ;)

Blizzard

If you really make a sprite for me, I'll do the script for you.
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.

Nortos

k I'll leave it to you Blizz he said he would *feels relieved because wasn't sure what way to do it as soo many :P and wasn't sure which would be easiest for a non scripter*

Fantasist

Cool, Blizz can handle it. I have a plan and I guess I'll do it just for kicks in my leisure.

*sigh*, I want my scripting swing back *holds head and cries*

I want to see how this turns up Bliz, I can compare my ideas with yours :)
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

January 16, 2008, 09:50:23 am #6 Last Edit: January 17, 2008, 12:43:32 pm by Blizzard
Here you go.
Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Artwork Viewer by Blizzard
# Version: 1.2b
# Type: Picture Viewer
# Date: 16.1.2008
# Date v1.2b: 17.1.2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Compatibility:
#
#   99% compatible with SDK v1.x. 90% compatible with SDK v2.x. Should be
#   compatible with everything else
#
#
# Features:
#
#   - shows any pictures as special scene
#   - easy to set up and use
#   - trigger fullscreen display by pressing ENTER
#   - resizes any picture in normal mode to a max size of 320x240 if exceeding
#   - lagfree
#
# new in 1.2b:
#
#   - add any artwork during the game
#   - optionally adds enemy battler files (REQUIRES BLIZZARD'S BESTIARY!)
#   - now beta
#
#
# Explanation:
#
#   This script will allow you to use an artwork scene which shows pictures.
#   The pictures will be displayed sized down and you can trigger fullscreen
#   view by pressing ENTER.
#
#
# Configuration:
#   
#   AUTO_ENEMIES  - if you set this to true it will add enemy battlers graphics,
#                   YOU MUST HAVE BLIZZARD'S BESTIARY INSTALLED TO USE THIS
#   PATH          - default folder is the Pictures folder (''), add a special
#                   path if you need it, this doesn't affect enemy battlers
#   FILES         - add any filenames of the art without extension that are
#                   available to be viewed initially
#   NAMES         - add any display names, in same order as filenames that are
#                   available to be viewed initially
#   TITLEFONTNAME - font used for the names display
#   TITLEFONTSIZE - font size used for the names display
#   
#   Set up the configuration below and add your pictures to the folder you
#   specified. Call the scene with following syntax:
#   
#     $scene = Scene_Blakesartwork.new
#     
#   If you want to add art during the game, simply use following syntax:
#   
#     $game_system.add_art('FILENAME', 'ARTNAME')
#   
#   
# Important note:
#   
#   If you are using the AUTO_ENEMIES option, you need to have Blizzard's
#   Bestiary installed, but you don't have to use it.
#   
#   
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

AUTO_ENEMIES = false
PATH = ''
FILES = ['custom_back3', 'sort1']
NAMES = ['TLoL 4 - CP title', 'Metal-Plate image 1']
TITLEFONTNAME = 'Arial'
TITLEFONTSIZE = 22

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

if AUTO_ENEMIES && !$bestiary_enabled
  raise 'Artwork Viewer requires Blizzard\'s Bestiary! RMXP will now close'
end

#==============================================================================
# Game_System
#==============================================================================

class Game_System
 
  attr_reader :artfiles
  attr_reader :artnames
 
  def add_art(file, name)
    @artfiles = [] if @artfiles == nil
    @artnames = [] if @artnames == nil
    unless @artfiles.include?(file) || @artfiles.include?(file)
      @artfiles.push(file)
      @artnames.push(name)
    end
  end
 
  def artfiles
    return (@artfiles == nil ? [] : @artfiles)
  end
 
  def artnames
    return (@artnames == nil ? [] : @artnames)
  end
 
end
 
#==============================================================================
# Window_Artwork
#==============================================================================

class Window_Artwork < Window_Base
 
  attr_reader :index
 
  def initialize
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = TITLEFONTNAME
    self.contents.font.size = TITLEFONTSIZE
    self.contents.draw_text(0, 416, 608, 32, 'Press ENTER to trigger fullscreen', 1)
    @index, @names = 0, []
    (NAMES + $game_system.artnames).each {|name| @names.push(PATH + name)}
    $game_system.beasts.each {|id| @names.push($data_enemies[id].name)}
    refresh
  end
 
  def index=(index)
    @index = index
    refresh
  end
 
  def refresh
    self.contents.fill_rect(0, 0, 608, 32, Color.new(0, 0, 0, 0))
    self.contents.draw_text(32, -3, 564, 32, '<<')
    self.contents.draw_text(32, -3, 564, 32, '>>', 2)
    self.contents.draw_text(0, 0, 608, 32, @names[@index], 1)
  end
 
end

#==============================================================================
# Scene_Blakesartwork
#==============================================================================

class Scene_Blakesartwork
 
  def initialize
    @scene = $scene.class
  end
 
  def main
    @files, @battlers = [], []
    (FILES + $game_system.artfiles).each {|file| @files.push(PATH + file)}
    if AUTO_ENEMIES
      $game_system.beasts.each {|id|
          @battlers.push([$data_enemies[id].battler_name,
              $data_enemies[id].battler_hue])}
    end
    @back_window = Window_Artwork.new
    @sprite = Sprite.new
    @sprite.x, @sprite.y, @sprite.z = 320, 240, 200
    @index, @names = 0, []
    setup_sprite
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      break if $scene != self
    end
    Graphics.freeze
    [@back_window, @sprite].each {|obj| obj.dispose}
  end
 
  def update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      if @back_window.visible
        $scene = @scene.new
      else
        @back_window.visible = true
        setup_sprite
      end
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      @back_window.visible = !@back_window.visible
      setup_sprite
    elsif Input.trigger?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      size = @files.size + @battlers.size
      @back_window.index = (@back_window.index + 1) % size
      setup_sprite
    elsif Input.trigger?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      size = @files.size + @battlers.size
      @back_window.index = (@back_window.index + size - 1) % size
      setup_sprite
    end
  end
 
  def setup_sprite
    if @back_window.index < @files.size
      @sprite.bitmap = RPG::Cache.picture(@files[@back_window.index])
    else
      file, hue = @battlers[@back_window.index - @files.size]
      @sprite.bitmap = RPG::Cache.battler(file, hue)
    end
    @sprite.ox, @sprite.oy = @sprite.bitmap.width/2, @sprite.bitmap.height/2
    w, h = @sprite.bitmap.width, @sprite.bitmap.height
    if @back_window.visible && (w > 320 || h > 240)
      @sprite.zoom_x = @sprite.zoom_y = [320.0 / w, 240.0 / h].min
    else
      @sprite.zoom_x = @sprite.zoom_y = 1.0
    end
  end
 
end


And here's a little demo:
http://www.sendspace.com/file/zud0ee

I need a sprite for this guy here:
Spoiler: ShowHide


Feel free to use this sprite as help or as sorta template. :3
Spoiler: ShowHide


BTW, all I ask for is that you make a sprite that really resembles the battler.
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.

Nortos

January 16, 2008, 05:27:52 pm #7 Last Edit: January 16, 2008, 05:28:23 pm by Nortos
the purple is....awesome! *drawls* I'm also gonna download the demo not to use it or anything just wanna see your code :)

Calintz

Wow!!
Thank you sooo much Blizzard!!

Just one question??
- Is there anyway to add artwork at any given time??
- I would like to make something of a beastiary, but without displaying the monster's stats...
- I will draw original pictures of all the bosses that you encounter in the game, but they can only be viewable after encountering them obviously...

Blizzard

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.

Calintz

Thank you...

P.S. The current script works beautifully!! I really appreciate you making this for me, and I'll get to work on that request now...

Nortos

would be easy specially for Blizz :) just use switches or scripting switches whichever, also gj on script Blizz I wasn't sure about the picture/file size and stuff u did

Calintz

Yeah, Blizz is awesome!!
His script is working perfectly, just like I wanted...

Fantasist

January 17, 2008, 10:26:12 am #13 Last Edit: January 17, 2008, 10:30:21 am by Fantasist
Dunno how the new script will turn up, but here's my actual idea when you first requested the script at old CP: Image panning. I remember your images were larger than teh screen. This little addon (to Bliz's first script) will allow you to pan the image if you press a custom key ('A' key, Shift/Z by default) when in full-screen mode:

Paste in a new slot just below Bliz's script.
class Scene_Blakesartwork
 
  Pan_Key = Input::A # The key to be pressed to allow panning
  Pan_Dist = 6 # Panning distance in pixels
 
  alias fant_pan_art_upd update
  def update
    if Input.press?(Pan_Key) && !@back_window.visible
      if Input.press?(Input::LEFT)
        @sprite.x -= Pan_Dist unless @sprite.x + @sprite.bitmap.width / 2 <= 640
      elsif Input.press?(Input::RIGHT)
        @sprite.x += Pan_Dist unless @sprite.x - @sprite.bitmap.width / 2 >= 0
      end
      if Input.press?(Input::UP)
        @sprite.y -= Pan_Dist unless @sprite.y + @sprite.bitmap.height / 2 <= 480
      elsif Input.press?(Input::DOWN)
        @sprite.y += Pan_Dist unless @sprite.y - @sprite.bitmap.height / 2 >= 0
      end
      return
    end
    fant_pan_art_upd
  end
 
  alias fant_pan_art_setup_sprite setup_sprite
  def setup_sprite
    fant_pan_art_setup_sprite
    @sprite.x, @sprite.y = 320, 240
  end
 
end


Hope you like it ^_^

PS: I was planning a really flashy viewer with Picasa-like features and I got lazy, but a small edit to Bliz's script was nice to do :)
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

Yeah, I was thinking about implementing that, but then I thought, if Calintz wants it, he'll tell me. BTW, I updated the script and the demo link in my post above with v1.2b and the new features.
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

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

Nothing special, just added the stuff that Calintz wanted and changed the inner system a bit to work more conveniently with the new features.
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

Yeah, checked it out, and Bliz, you once again helped me!
Now I got my scripting swing back, yay!
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




Nortos


Fantasist

Yeah, uh,
Offtopic: ShowHide
Just whipped up a character selection screen for JPP and am ready for more, yeah! :mental: (i miss this smiley)
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




Calintz

Ok...
I'm back and I'll check that out right now.....Thank you Blizzard
Also, I tried copying this script and changing the scene and window and junk so that I could have the exact same setup for viewing Tuts by calling $scene = Scene_Blakestutorials.new, but everytime I call either, just the tut pics come up.

@Blizzard:
I finished the basic look for your request, check him out in the workshop, and let me know what you think...

Nortos

do you want a tut viewer that shows an image of tut that has writing? I could probably edit this for you with Blizz's artbook

Calintz

I want the 2 to be seperate...
I have two items that are supposed to call seperate things.

I have "Blake's Artbook" which when used, activates a common event that calls "$scene = Scene_Blakesartwork.new"
And I have "Blake's Notebook" which when used, is supposed to call a window EXACTLY the same as the artwork, but simply showthe TUT's instead, because the TUT's are also .png picture files.

Nortos

k I'll dll Blizz's latest one and do it for u I think be pretty esy

Calintz


Nortos

Here it's, *note I didn't get rid of the bestiary viewable from tut bit as well so just never turn the one in the tut viewer to true* I was too lazy :P

here's the link and to add a name and pic ect it's same as in the artwork viewer just under TUTNAMES and TUTFILES

http://www.sendspace.com/file/8ja0jd

Calintz

January 21, 2008, 10:40:00 pm #26 Last Edit: January 21, 2008, 10:41:27 pm by Calintz16438
Ok, so where is the script??

I played the demo, and it works just as good as Blizz's. You did a good job, but I can't get the script because you encypted it, and the editable game file isn't in there...

Nortos


Lost_Hope

oh btw, i was wondering if anyone knew how to make like a journal section in the menu?The menu that says like your stats and save,load,shutdown, etc.?
In my game I need something like this cuase the main character keeps a journal...any ideas???

Nortos

you could always use this and just put in a new text picture or do you want more of a quest script? There's quest scripts around and once you found one I could put it in ur menu for you, Blizzard said I think he's making one as well but that might be a while

Calintz

January 21, 2008, 11:30:20 pm #30 Last Edit: January 21, 2008, 11:54:32 pm by Calintz16438
All right, checking it out right now, Lol...

P.S. I didn't like how when you would press ESC after you were finished viewing the pics, it would take you back to the map, so I changed the code to make it pop up the menu again  ;D

Edit
Works like a charm, thank you very much Nortos...