08-09-2023, 08:23 PM
(This post was last modified: 08-09-2023, 08:24 PM by DerVVulfman.)
Lycan Companion Icons
Version: 1.0
Version: 1.0
Introduction
A silly little script... it lets you place icons within the traditional menu screens. Now, you will be able to determine if a companion is set to use only skills, if they are following close, or if they're a pet!
Script
Its a little thing right here
Code:
#==============================================================================
# ** Lycan Companion Icons
#------------------------------------------------------------------------------
# version 1.0
# by DerVVulfman
# 08-09-2023 (MM/DD/YYYY)
# RGSS / RPGMaker XP
#==============================================================================
#
# INTRODUCTION:
#
# A silly little script... it lets you place icons within the traditional
# menu screens. Now, you will be able to determine if a companion is set
# to use only skills, if they are following close, or if they're a pet!
#
# The system allows you to place icons within the modules:
# * Windows_Base - draw_actor_name
# * Windows_MenuStatus - refresh
# * Window_Status - refresh
#
#
#------------------------------------------------------------------------------
#
# INSTALLATION:
# =============
#
# Paste this script below The Lycan ABS and above Main to use. Add your
# custom icons that this script will use within the Graphics\Icons folder,
# and configure as needed. The comments should be easy to understand.
#
#------------------------------------------------------------------------------
#
# COMPATIBILITY:
#
# This script adds new statements to three default script methods by the use
# of the alias command. So it should be compatible with any menu system that
# has a structure similar enough to the default menus.
#
#==============================================================================
#
# TERMS AND CONDITIONS:
#
# Free for use, even in commercial games.
#
#==============================================================================
#==============================================================================#
# +--------------------------------------------------------------------------+ #
# | * * C O N F I G U R A T I O N P A G E * * | #
# | * * THE ICONS * * | #
# +--------------------------------------------------------------------------+ #
#==============================================================================#
module Lycan
# MAIN WINDOW POSITIONING
# =========================================================================
# Determines if icons appear in one of the three basic menu forms, and the
# general poacement of the icons themselves
# Draw Actor Name Connect Settings
# ======================== ========
COMPANION_NAME_ICONS = false
COMPANION_NAME_X = 0
COMPANION_NAME_Y = 0
# Menu Status Connect Settings
# ======================== ========
COMPANION_MENU_ICONS = true
COMPANION_MENU_X = 300
COMPANION_MENU_Y = 0
# Status Window Connect Settings
# ======================== ========
COMPANION_STAT_ICONS = true
COMPANION_STAT_X = 8
COMPANION_STAT_Y = 32
# INDIVIDUAL ICON DEFINITIONS
# =========================================================================
# Determines the icon graphics used for specific conditions and the general
# placement in relation to the window(s) applied. Nil or "" filenames will
# disable the icon itself.
# Follow Player Icon Settings
# ======================== ========
C_ICON_FOLLOW_IMAGE = "016-Accessory01"
C_ICON_FOLLOW_X = 30
C_ICON_FOLLOW_Y = 0
# Follow Close Icon Settings
# ======================== ========
C_ICON_CLOSE_IMAGE = "020-Accessory05"
C_ICON_CLOSE_X = 30
C_ICON_CLOSE_Y = 0
# Wait/Stay Icon Settings
# ======================== ========
C_ICON_WAIT_IMAGE = "009-Shield01"
C_ICON_WAIT_X = 30
C_ICON_WAIT_Y = 0
# Hunt-and-Destroy Icon Settings
# ======================== ========
C_ICON_DESTROY_IMAGE = "050-Skill07"
C_ICON_DESTROY_X = 30
C_ICON_DESTROY_Y = 0
# Normal Attack Icon Settings
# ======================== ========
C_ICON_NORMAL_IMAGE = "002-Weapon02"
C_ICON_NORMAL_X = 0
C_ICON_NORMAL_Y = 0
# Melee-Only Icon Settings
# ======================== ========
C_ICON_MELEE_IMAGE = "001-Weapon01"
C_ICON_MELEE_X = 0
C_ICON_MELEE_Y = 0
# Skill-Only Icon Settings
# ======================== ========
C_ICON_SKILL_IMAGE = "044-Skill01"
C_ICON_SKILL_X = 0
C_ICON_SKILL_Y = 0
# Pet-Companion Icon Settings
# ======================== ========
C_ICON_PET_IMAGE = "027-Herb03"
C_ICON_PET_X = 60
C_ICON_PET_Y = 0
end
#==============================================================================
# ** Game_ABS
#------------------------------------------------------------------------------
# This class deals with the Action Battle System and controls all Player,
# Enemy and Companion Actions on the map.
#==============================================================================
class Game_ABS
#--------------------------------------------------------------------------
# * Get Companion data from actor
# actor : actor
#--------------------------------------------------------------------------
def companion_from_actor(actor)
# Exit with nil if Companions system is off
return nil unless Lycan::COMPANIONS_ON
# Cycle through every companion in ABS memory
for companion in $game_companions.values
# Get the actor_ID (party member) of the companion
actor_id = companion.actor_id
# Get the comparative actor from the companion data
test = $game_party.actors[actor_id]
# return companion data if the compared actor is the actor requested
return companion if test == actor
end
# Return nil if no companion data found
return nil
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias comp_icons_base_draw_actor_name draw_actor_name
#--------------------------------------------------------------------------
# * Draw Name
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_name(actor, x, y)
# Perform the original method
comp_icons_base_draw_actor_name(actor, x, y)
# Exit unless enabled
return unless Lycan::COMPANION_NAME_ICONS == true
# Adjust position
x += Lycan::COMPANION_NAME_X
y += Lycan::COMPANION_NAME_Y
# Apply Icons
draw_companion_icons(actor, x, y)
end
#--------------------------------------------------------------------------
# * ICON RENDER
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * Draw Companion Icons
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_companion_icons(actor, x, y)
# Get the companion data based on the actor supplied
companion = $ABS.companion_from_actor(actor)
# Exit if no valid companion found
return if companion.nil?
# Draw icons
lycan_draw_follow(companion, x,y)
lycan_draw_close(companion, x,y)
lycan_draw_wait(companion, x,y)
lycan_draw_destroy(companion, x,y)
lycan_draw_norm_combat(companion, x,y)
lycan_draw_melee_only(companion, x,y)
lycan_draw_skill_only(companion, x,y)
lycan_draw_pet(companion, x,y)
end
#--------------------------------------------------------------------------
# * Draw Actor-Follow Icon
# companion : companion actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def lycan_draw_follow(companion, x,y)
# Handle if proper flag settings
return if companion.destroy_flag == true
return if companion.close_follow == true
return if companion.wait_command == true
# Set location and push icon
x += Lycan::C_ICON_FOLLOW_X
y += Lycan::C_ICON_FOLLOW_Y
lycan_draw_icon(x, y, Lycan::C_ICON_FOLLOW_IMAGE)
end
#--------------------------------------------------------------------------
# * Draw Actor-Close-Follow Icon
# companion : companion actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def lycan_draw_close(companion, x,y)
# Handle if proper flag settings
return unless companion.close_follow == true
# Set location and push icon
x += Lycan::C_ICON_CLOSE_X
y += Lycan::C_ICON_CLOSE_Y
lycan_draw_icon(x, y, Lycan::C_ICON_CLOSE_IMAGE)
end
#--------------------------------------------------------------------------
# * Draw Actor-Wait Icon
# companion : companion actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def lycan_draw_wait(companion, x,y)
# Handle if proper flag settings
return unless companion.wait_command == true
# Set location and push icon
x += Lycan::C_ICON_WAIT_X
y += Lycan::C_ICON_WAIT_Y
lycan_draw_icon(x, y, Lycan::C_ICON_WAIT_IMAGE)
end
#--------------------------------------------------------------------------
# * Draw Actor-Hunt-n-Destroy Icon
# companion : companion actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def lycan_draw_destroy(companion, x,y)
# Handle if proper flag settings
return unless companion.destroy_flag == true
# Set location and push icon
x += Lycan::C_ICON_DESTROY_X
y += Lycan::C_ICON_DESTROY_Y
lycan_draw_icon(x, y, Lycan::C_ICON_DESTROY_IMAGE)
end
#--------------------------------------------------------------------------
# * Draw Normal-Combat Icon
# companion : companion actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def lycan_draw_norm_combat(companion, x,y)
# Handle if proper flag settings
return if companion.melee_only == true
return if companion.skill_only == true
# Set location and push icon
x += Lycan::C_ICON_NORMAL_X
y += Lycan::C_ICON_NORMAL_Y
lycan_draw_icon(x, y, Lycan::C_ICON_NORMAL_IMAGE)
end
#--------------------------------------------------------------------------
# * Draw Melee-Only Icon
# companion : companion actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def lycan_draw_melee_only(companion, x,y)
# Handle if proper flag settings
return unless companion.melee_only == true
# Set location and push icon
x += Lycan::C_ICON_MELEE_X
y += Lycan::C_ICON_MELEE_Y
lycan_draw_icon(x, y, Lycan::C_ICON_MELEE_IMAGE)
end
#--------------------------------------------------------------------------
# * Draw Skill-Only Icon
# companion : companion actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def lycan_draw_skill_only(companion, x,y)
# Handle if proper flag settings
return unless companion.skill_only == true
# Set location and push icon
x += Lycan::C_ICON_SKILL_X
y += Lycan::C_ICON_SKILL_Y
lycan_draw_icon(x, y, Lycan::C_ICON_SKILL_IMAGE)
end
#--------------------------------------------------------------------------
# * Draw Actor-Pet Icon
# companion : companion actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def lycan_draw_pet(companion, x,y)
# Handle if proper flag settings
return unless companion.pet_flag == true
# Set location and push icon
x += Lycan::C_ICON_PET_X
y += Lycan::C_ICON_PET_X
lycan_draw_icon(x, y, Lycan::C_ICON_PET_IMAGE)
end
#--------------------------------------------------------------------------
# * Draw Lycan Actor Item
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# filename : icon filename
#--------------------------------------------------------------------------
def lycan_draw_icon(x, y, filename)
return if filename.nil?
return if filename == ""
bitmap = RPG::Cache.icon(filename)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias comp_icons_menustatus_refresh refresh
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# Perform the original method
comp_icons_menustatus_refresh
# Exit unless enabled
return unless Lycan::COMPANION_MENU_ICONS == true
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
# Y position in screen
y = i * 116
# Adjust position
x = Lycan::COMPANION_MENU_X
y += Lycan::COMPANION_MENU_Y
# Apply Icons
draw_companion_icons(actor, x, y)
end
end
end
#==============================================================================
# ** Window_Status
#------------------------------------------------------------------------------
# This window displays full status specs on the status screen.
#==============================================================================
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias comp_icons_status_refresh refresh
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# Perform the original method
comp_icons_status_refresh
# Exit unless enabled
return unless Lycan::COMPANION_STAT_ICONS == true
# Adjust position
x = Lycan::COMPANION_STAT_X
y = Lycan::COMPANION_STAT_Y
draw_companion_icons(@actor, x, y)
end
end
Instructions
Paste this script below The Lycan ABS and above Main to use. Add your custom icons that this script will use within the Graphics\Icons folder, and configure as needed. The comments should be easy to understand.
Compatibility
Designed for RPGMaker XP and The Lycan ABS. This script adds new statements to three default script methods by the use of the alias command. So it should be compatible with any menu system that has a structure similar enough to the default menus.
Terms and Conditions
Free for use, even in commercial games.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links