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.

Khai's_Item_Found_1.2b UPDATE!

Dude wow.

It looks like a very simplistic script yet I love the eye candy in comparison with the default. If I use this I might edit where the window appears but I'll still credit you.

Good job!
-Krobe
 

kire

Member

Cool, great script. Simple and effective.
The demo link is bit strange the first time I tried it looked like this http://www."http.com//www.mediafire.com/?mmswxzy0frk%22" so I think is better to fix it.
 
Your scripting is messy (work on your indentation) and the way to call this via 'Call Script' seems redundant. Either way, I like the final outcome in how it looks. Either way, you should heavily work over that code, especially making it auto-appear when you add a new item via the event command rather than needing to set up everything via call script. The reason is that you'll have cleaner code, it's easier to use because it uses the default system everyone should be aware of, and last but not least, it allows your script to be inserted in no matter how far progressed games and will work without the need to insert anything.

Also, very nice compatibility informations XD
 
BlueScope":l5txvfzh said:
Your scripting is messy (work on your indentation) and the way to call this via 'Call Script' seems redundant. Either way, I like the final outcome in how it looks. Either way, you should heavily work over that code, especially making it auto-appear when you add a new item via the event command rather than needing to set up everything via call script. The reason is that you'll have cleaner code, it's easier to use because it uses the default system everyone should be aware of, and last but not least, it allows your script to be inserted in no matter how far progressed games and will work without the need to insert anything.

Also, very nice compatibility informations XD

The reason it's messy is due to the wrapped text when pasting on forums. I added more notes because not everyone is familiar with scripting basics.

As for reworking the code, it seems you want me to do an entire system for you which i don't have time for. That would also lengthen the code as well as modify some of the base system which isn't the goal i had in mind.

But i'll improve it however i can when i have time the next release XD
 
You shouldn't have wrapped lines within code tags... and well, I was basically talking about indentation... you might have a look at the default scripts or some tutorials regarding that.

Also, since I'm most likely doing something like that as well, just with the mentioned features, for my project, I can send you a copy to see what I mean if you want... it's really not much to do, I guess...
 
indian giver":1j8apqwu said:
I've found a script which clahes with this one :O
It's anaryus Particle Engine!

Can you send me a link to it? I'll see how to fix it.

BlueScope":1j8apqwu said:
You shouldn't have wrapped lines within code tags... and well, I was basically talking about indentation... you might have a look at the default scripts or some tutorials regarding that.

Also, since I'm most likely doing something like that as well, just with the mentioned features, for my project, I can send you a copy to see what I mean if you want... it's really not much to do, I guess...

I'm not sure what you mean exactly, but i fixed and cleaned most everything now XD It's working properly as its intended purpose now with auto-resize and slimed down code. (Maybe send me a link to what your referring to O_O;;)

Here's a link to the screens and differences. (Still finishing)
http://ktbanh.wordpress.com/2008/08/16/khais_item_found_12/

I think both approach are great. One requires you to change numeric values + pasted code-line, the other requires you to make a new event command; selecting the item and amount. Both works [your idea however gives it a cleaner feel since it uses the default drop down box. (Now i need to work it down to Scene_Map )

And yes send it over! I'll gladly check it out to see the differences!

Thanks for all the comments!

Edit:
I found the particle engine and working on a solution.
 
indian giver":1ay6o8gf said:
A link to his particle engine? here you go: http://www.rmxp.org/forums/index.php?topic=42384.0
and i have a request (of course only if you want to do that) could you enable to make a small messagebox which says ''I didn't find anything'' or something like that?

Yes, i already included that setting in 1.2 XD so no worries. As for the particle engine, it seems to only add particle when entering/exiting scene_map. This will have to be referred to the particle engine maker. Any scenes executed from events will disrupt the update method or giving it an error. Try adding this line to an event then execute it to see my point.
"$scene = Scene_Menu.new"
 

Twirly

Sponsor

No no i guess i have to explain better!
When i have a sparkling event (particles) which gives you an item i get an error
 
Arbiter":117vxf52 said:
It still isn't indented properly, here.

Code:
=begin

Khai's Item Found
 Version: 1.1
 Release: 8.13.08 4:42pm
 Updated: 8.13.08 8:41pm
 Author: Khai
 http://ktbanh.wordpress.com/
 Description: A basic script to display popup window(s) from common events
 such as treasure chest or other custom designs.
 
Notes:
 1.0 - simple usage, initial release.
 1.1 - bug fixes, note correction, item add included. (requires no hassle to
 create item obtain events now)
 Setup: Place above Main. [config below]

Usage: Create an event such as a treasure chest and place this in Scripts
 under tab 3 of event commands:

 $scene = Khai_Item_Found.new(type,index,number)

 [Type(0-3): 0:Items 1:Armors 2:Weapons 3:Gold]
 [Index: item list in database]
 [Number: amount displayed]

Example:
 $scene = Khai_Item_Found.new(2,5,10) display, "10x Leather Whip Found"
 $scene = Khai_Item_Found.new(3,5,1234) display, "1234G Found"

IMPORTANT NOTICE!
 If you want a chest to display multiple items, create [Wait: 1 frame(s)] in
 the current event after each call.

=end
 
# Configuration: 
  SE = "Saint5"          # Sound effect when item found. Leave blank to disable.
				                 # Exact name from Sound Test/SE
  MSG	= "Found"          # Message for item found eg. "You have Found..."
  Align = 1		           # Text alignment of message window. 0=L 1=Center 2=R
  Width = 300	           # Width of message window.
  Format = 1	      	   # 0:[msg,number,type] 1:[number,type,msg]
  Fade = false           #enable/disable message fade overtime.
  Fade_Speed  = 2	       #speed of fade
  Fade_Length = 10	     #length of fade
                         # Screen Setting: for 640x480 users else void
  Graphic_W = 544        # Screen Width
  Graphic_H = 416        # Screen Height
# Configuration end

class Khai_Window_Found_Icon < Window_Base
  def initialize(index,type)
    super(0, 0, 54, WLH + 32)
    gold = $data_system.terms.gold
    self.draw_icon($data_items[index].icon_index, 0, 0, true) if type == 0
    self.draw_icon($data_armors[index].icon_index, 0, 0, true) if type == 1
    self.draw_icon($data_weapons[index].icon_index, 0, 0, true) if type == 2
    self.contents.draw_text(6, 0, 54, WLH, gold) if type == 3
  end
end
#------------------------------------------------------------------------------
class Khai_Window_Found < Window_Base
  def initialize
    super(0, 0, Width, WLH + 32)
  end
#------------------------------------------------------------------------------
  def dispose_item_window
    self.dispose
  end
#------------------------------------------------------------------------------
  def set_text(text, align = Align)
    if text != @text 
      @text = text
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(0, 0, self.width - 40, WLH, text, align)
    end
  end
end
#------------------------------------------------------------------------------
class Khai_Item_Found < Scene_Base
  def initialize(type,index,num)
    @index = index
    @setting = type
    @fade_length = Fade_Length
    case type
    when 0
      @type = $data_items[@index].name
      $game_party.gain_item($data_items[@index], num)
    when 1
      @type = $data_armors[@index].name
      $game_party.gain_item($data_armors[@index], num)
	  when 2
      @type = $data_weapons[@index].name
      $game_party.gain_item($data_weapons[@index], num)
	  when 3
      @type = Vocab::gold
      $game_party.gain_gold(num)
    end
    @text = "#{MSG} #{num}x #{@type}" if Format == 0 && type != 3
    @text = "#{num}x #{@type} #{MSG}" if Format == 1 && type != 3
    @text = "#{num} #{@type} #{MSG}" if type == 3
  end
  #------------------------------------------------------------------------------
  def start
    @spriteset = Spriteset_Map.new
    @khai_info_window = Khai_Window_Found.new
    @khai_info_window.width = (@khai_info_window.contents.text_size(@text).width) + 42
    @khai_icon_window = Khai_Window_Found_Icon.new(@index, @setting)
    @khai_info_window.set_text(@text)
    @khai_info_window.x = (Graphic_W-(@khai_info_window.width-@khai_icon_window.width))/2
    @khai_info_window.y = (Graphic_H-@khai_info_window.height)/2
    @khai_icon_window.x = ((Graphic_W-(@khai_info_window.width+@khai_icon_window.width))/2)
    @khai_icon_window.y = ((Graphic_H-@khai_icon_window.height)/2)
    Audio.se_play("Audio/SE/#{SE}", 100, 100) if SE != ""
  end
#------------------------------------------------------------------------------
  def terminate
    super
    @spriteset.dispose
    dispose_item_window
  end
#------------------------------------------------------------------------------
  def dispose_item_window
    @khai_icon_window.dispose
    @khai_info_window.dispose
  end
#------------------------------------------------------------------------------  
  def update
    @khai_info_window.update
    @khai_icon_window.update
    if Fade
      @fade_length -= 1
      if @fade_length <= 0
        @khai_info_window.opacity -= Fade_Speed
        @khai_info_window.contents_opacity -= Fade_Speed
        @khai_icon_window.opacity -= Fade_Speed
        @khai_icon_window.contents_opacity -= Fade_Speed
      end
      if @khai_info_window.opacity == 0
        $scene = Scene_Map.new
      end
    end
    $scene = Scene_Map.new if Input.trigger?(Input::B)
    $scene = Scene_Map.new if Input.trigger?(Input::C)
  end
end

That looks lots cleaner! Thanks, that's what you meant XD. I'll upload and try to follow that format when the new version is released. Currently making the demo XD
 
Would this script work with XP?
If not would you be able to mod it so it can? :)

Because this is a really great looking script and i'd love to have the opportunity to use it in my game :P
 
Hey, so how can I make it so that this script doesn't pause the game until you press enter(action key). I know i can have the events still going on, but as I am using a zelda like ABS system, if I have the events running (enemies), but require the player to get out of the popup before battling, its kinda sucky.
 

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