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.

Equipaments On Screen

Equipment on Screen
By : Rafidelis By: Rafidelis [/b]

About the script:

This script shows their equipment on the screen, you can choose between using and not using an image of substance.
The 3 types available for use, you must TYPE in the mo0dificar variable, you must use from 1 to 3 (see the pictures and to learn how each type)

http://i328.photobucket.com/albums/l332 ... equip3.png[/img]
http://i328.photobucket.com/albums/l332 ... ipt1-1.jpg[/img]
http://i328.photobucket.com/albums/l332 ... equip2.png[/img]


Features:

You can show the 5 equipment (gun, shield, helmet, armor and accessories) to show some and not so follow the instructions in the Script
You may or may not use images if you want you can use one of the 3 images below, or create your custom.
And remembering that already own script turns the image if you choose the type 2 ^ ^

ScreenShots

TYPE 1

http://i328.photobucket.com/albums/l332 ... ker/e1.png[/img]

TYPE 2

http://i328.photobucket.com/albums/l332 ... ker/e2.png[/img]

TYPE 3
http://i328.photobucket.com/albums/l332 ... ker/e3.png[/img]

Code:
module Rafidelis_Equipamentos   
#==============================================================================|
#						S T A R T   O F  C O N F I G U R A T I O N S				   |						   
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|


# Leave at True to show the icon Equipment | False not to Show |
	MOSTRAR_ARMA = true 
# Leave at True to show the icon of the Shield | False not to Show |
	MOSTRAR_ESCUDO = true 
# Leave at True to show the icon of the helmet | False not to Show |
	MOSTRAR_ELMO = true 
# Leave at True to show the icon of Armor | False not to Show |
	MOSTRAR_ARMADURA = true 
# Usar Imagem de fundo?
  # Leave at True to show the icon of Acessories| False not to Show |
	MOSTRAR_ACESSORIO = true 
# Opacity of Windows that will show the icons of Equipment
	OPACIDADE = 0
# Use background image?
	USAR_IMG = true
# If above is true, what is the name of the image being used?
	IMG_NOME = "Equip2"
	
#==============================================================================|
#					 D I S P L A Y  T Y P E				|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 
# 1 to display the icons horizontally on top of the SCREEN | 
#------------------------------------------------- -----------------------------| 
# 2 To view the icons at the left corner of VERTICAL SCREEN | 
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 
# 3 To view the icons horizontally in the bottom of the SCREEN | 
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 
# IF YOU ARE NOT USING A number 1 or 2 or 3 The script will generate an error 
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
	TIPO = 2								 
  end  
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|  

class Rafidelis_Equip_Window < Window_Base  
  def initialize(x,y,n)	
	@n = n  
	@x = x 
	@y = y
	super(x,y,56,56)	
	refresh
  end
end
#==============================================================================|
#							 R E F R E S H
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
def refresh
  self.contents.clear
  @actor = $game_party.members[0]
  draw_item_name(@actor.equips[@n], 0, 0)
end
#==============================================================================|
#			S T A R T	O F   C L A S S	S C E N E   M A P			  |
#------------------------------------------------------------------------------|

class Scene_Map
  include Rafidelis_Equipamentos		
  alias rafidelis_start start
  alias rafidelis_terminate terminate
  alias rafidelis_update update
  
  def start
#-------------------------------------------------------------------------------
   @Window_Equip = nil
	if TIPO == 1	  
	  @Window_Equip = Rafidelis_Equip_Window.new(0,0,0)
	elsif TIPO == 2	  
	  @Window_Equip = Rafidelis_Equip_Window.new(0,0,0)
	elsif TIPO == 3	 
	  @Window_Equip = Rafidelis_Equip_Window.new(0,360,0)	
	end
	if MOSTRAR_ARMA == true
	  @Window_Equip.visible = true
	else
	  @Window_Equip.visible = false
	end 
	 @Window_Equip.opacity = OPACIDADE
#-------------------------------------------------------------------------------
	@Window_Equip2 = nil
	if TIPO == 1	  
	  @Window_Equip2 = Rafidelis_Equip_Window.new(56,0,1)
	elsif TIPO == 2	  
	  @Window_Equip2 = Rafidelis_Equip_Window.new(0,56,1)
	  elsif TIPO == 3	 
	  @Window_Equip2 = Rafidelis_Equip_Window.new(56,360,1)  
	end 
	if MOSTRAR_ESCUDO == true
	  @Window_Equip2.visible = true
	else
	  @Window_Equip2.visible = false
	end
	@Window_Equip2.opacity = OPACIDADE
#-------------------------------------------------------------------------------
	@Window_Equip3 = nil
	if TIPO == 1	  
	  @Window_Equip3 = Rafidelis_Equip_Window.new(56*2,0,2)
	elsif TIPO == 2	  
	  @Window_Equip3 = Rafidelis_Equip_Window.new(0,56*2,2)
	  elsif TIPO == 3	 
	  @Window_Equip3 = Rafidelis_Equip_Window.new(56*2,360,2)  
	end	   
	if MOSTRAR_ELMO == true
	  @Window_Equip3.visible = true
	else
	  @Window_Equip3.visible = false
	end
	@Window_Equip3.opacity = OPACIDADE
#-------------------------------------------------------------------------------
	@Window_Equip4 = nil
	if TIPO == 1	  
	  @Window_Equip4 = Rafidelis_Equip_Window.new(56*3,0,3)
	elsif TIPO == 2	  
	  @Window_Equip4 = Rafidelis_Equip_Window.new(0,56*3,3)
	  elsif TIPO == 3	 
	  @Window_Equip4 = Rafidelis_Equip_Window.new(56*3,360,3)  
	end	
	if MOSTRAR_ARMADURA == true
	  @Window_Equip4.visible = true
	else
	  @Window_Equip4.visible = false
	end
	@Window_Equip4.opacity = OPACIDADE
#-------------------------------------------------------------------------------
	@Window_Equip5 = nil	
	if TIPO == 1	  
	  @Window_Equip5 = Rafidelis_Equip_Window.new(56*4,0,4)
	elsif TIPO == 2	  
	  @Window_Equip5 = Rafidelis_Equip_Window.new(0,56*4,4)
	  elsif TIPO == 3	 
	  @Window_Equip5 = Rafidelis_Equip_Window.new(56*4,360,4)  
	end	
	if MOSTRAR_ACESSORIO == true
	  @Window_Equip5.visible = true
	else
	  @Window_Equip5.visible = false
	end
	@Window_Equip5.opacity = OPACIDADE
	if USAR_IMG
	  if TIPO == 1
		@bg = Sprite.new 
		@bg.bitmap = Cache.picture(IMG_NOME)
		@bg.x = 1
		@bg.y = 1		
		end				 
	  end
	  if TIPO == 2
		@bg = Sprite.new 
		@bg.bitmap = Cache.picture(IMG_NOME)
		@bg.x = 54
		@bg.y = 1
		@bg.angle = 270.5 
	  end
	  if TIPO == 3
		@bg = Sprite.new 
		@bg.bitmap = Cache.picture(IMG_NOME)
		@bg.x = 3
		@bg.y = 360   
	end
#-------------------------------------------------------------------------------
	rafidelis_start
  end
  
  def terminate
	@Window_Equip.dispose 
	@Window_Equip2.dispose 
	@Window_Equip3.dispose
	@Window_Equip4.dispose
	@Window_Equip5.dispose
	rafidelis_terminate
  end
  
	def update
	@Window_Equip.update
	@Window_Equip2.update
	@Window_Equip3.update
	@Window_Equip4.update
	@Window_Equip5.update
	rafidelis_update
  end
end
#=================================================================
# www.ReinoRpg.com 
#=================================================================


Credits:

www.ReinoRpg.com
 
I have a couple criticisms about this script.

First being, why is that information even relevant enough to warrant being displayed on the screen? Can you name any typical RPG that required that information to be known, short of a game like Legend of Zelda (not an RPG) where tools were a major part of the game and limited controller input forced them to be swapped out often? Even in an action battle system, it is pointless. You know what you are equipped with, and if not, checking a menu is only a click or so away and for the most part ABSes will pause to let you manipulate your menu.

Secondly, why did you not just use script to let one image be repeated for all the boxes, rather than have one image for all of the boxes? (And for that matter, why are the boxes 4x the size of the icon inside them?) If you're going to use the "every box can have its own individual text!" reason, read section 3:

Thirdly, you should use script to write the text in the boxes. Its just good coding practice. Unless the text needs to be manipulated in a way that only an image can (and Bitmaps and the .blt method alleviate that issue entirely); it is pointless. You could argue that it is so you can have text with awesome photoshop effects and in weird directions, but you'd be wrong. Because that is a bad idea, because having sideways text makes it difficult to read and ugly in general.

From a scripting perspective, it is good practice to use English for variable names. The majority of the Japanese and German scripts floating around this and other RM communities do this. You are using too many constants. For the background image/filename, you could simply have one variable that if set to a string value, parses it into an image, and if set to 'nil' or 'false' could not parse an image at all. If you think about it from a logical standpoint, when USAR_IMG is set to false, IMG_NOME is a pointless constant that should never have or need a value.

The first five constants could be combined into one Hash.
Code:
USE_SLOTS = {
  'Weapon1' = true,
  'Weapon2' = false,
  'Armor' = true,
  'Helmet' = true,
  'Accessory' = false
}

TIPO shouldn't be set to a literal integer value. If you're using this area to define options for the end-user, you should provide constants for them. In your case, something like:

# DO NOT CHANGE THESE VALUES
TOPLEFT_HORZ, TOPLEFT_VERT, BOTTOMLEFT = 1, 2, 3

would be good, although you are offering options but limiting.

You should adjust your script to allow any corner of the screen, and any orientation. Something like this:

# DO NOT CHANGE THESE VALUES
TOPLEFT, TOPCENTER, TOPRIGHT = 1, 2, 3
BOTTOMLEFT, BOTTOMCENTER, BOTTOMRIGHT = 4, 5, 6
VERTICAL, HORIZONTAL = 1, 2

# Set these values to determine the position (on screen) and the orientation (vertical/horizontal) of the HUD
POSITION = value # TOPLEFT, TOPRIGHT, BOTTOMLEFT, BOTTOMRIGHT, TOPCENTER, BOTTOMCENTER
ORIENTATION = value # VERTICAL, HORIZONTAL

And use your code to parse the locations and set it according.

Other than that, read the first part about how I think this is useless information.
 
First I want to thank you Prexus, the evaluations and criticisms about my script, with some certainty that assessment on my script (I have only 6) I am still half in RGSS noob, so sorry for this bunch of error that you mentioned.

Then, I create a lot of appearing to try to ease the life of the user's script, but by what I saw just exaggerating and I think the script became polluted.
And how about rotating the image depending on the type, I ate more I tried noob as I said, and therefore can not make the texts rotate according to the type selected.

I can not use hachem well, more after this explanation that you gave me, opened my mind.

And really, the variable IMG_NOME is really inútel when USAR_IMG is true x.x

Look, I really love your opinion and criticism about my script, I became his fan, I ate behind some of his scripts for me to study them ^ ^

Thank you PRexus Again!

NOTE: I apologize if my English is very bad, because I am Brazilian xD

² NOTE: Prexus, if you can rewrite this script for an simplest way for me to study would be eternally grateful ^ ^


Thankzz MAnnn!!
 

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