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.

enemy hp bar with near fantastica's sbabs

statci

Member

alright, i'm using near's Squad Based Action Battle System and it works fine enough for me, but i'm wondering if there is something i'm missing. the enemies in my game don't show hit points or have an hp bar. How can i fix this.

#======================================
# â–  Squad Based Action Battle System
#======================================
#  By: Near Fantastica
# Date: 02.07.05
# Version: 3.4
# Thanks To: Cybersam for the Keyboard Script
# Thanks To: Prexus for the Graphics
#======================================
#
#======================================
# â–  ABS Key Commands
#======================================
# E ● Change Lead Forward
# R ● Change Lead Backwards
# T ● Waits Leader
# Y ● Waits Allies
# U ● Gathers Allies
# I ● Dash
# O ● Sneak
# P ● Toggle Hud
# F ● Melee Attack
# G ● Range Attack
# H ● Skill Key 1
# J ● Skill Key 2
# K ● Skill Key 3
# L ● Skill Key 4
# N ● Wide Follow
# M ● Close Follow
#======================================
#
#======================================
# â–  ABS Enemy Ai List
#======================================
# Name
# Name Of the Enemy in The Data Base
#---------------------------------------------------------------------------
# Behavior
# Passive = 0 ● The Event (Enemy) will only attack when attacked
# Aggressive = 1 ● The Event will attack when one of its Detection level are set true
# Linking = 2 ● Event will only attack when another Event is attacked with in its Detection level
# Aggressive Linking = 3 ● Event will attack when either Aggressive or Linking is true
#---------------------------------------------------------------------------
# Detection
# Sound = range ● The range of sound the enemy can hear inactive if set to zero
# Sight = range ● The range of sightthe enemy can see inactive if set to zero
#---------------------------------------------------------------------------
# Aggressiveness
# Aggressiveness = Level ● The high number the less Aggressive the Event
#---------------------------------------------------------------------------
# Movement
# Speed = Level ● The movment Speed of the event when engaged
# Frequency = Level ● The movment Frequency of the event when engaged
#---------------------------------------------------------------------------
# Trigger
# Erased = 0 ● The event will be erased on death
# Switch = 1 ● The event will be trigger Switch[ID] on death
# Varible = 2 ● The event will be set the Varible[ID] = VALUE on death
# Local Switch = 3 ● The event will trigger Local_Switch[ID] on death
#======================================
#
#======================================
# â–  ABS CONSTANTS
#======================================
# ● DEAD_DISPLAY is the sprite that is displayed when an actor is dead
# ● DEAD_DISPLAY[Data_Base_Actor_ID] = ["Character_Set_Name", X of sprite, Y of sprite]
#---------------------------------------------------------------------------
$DEAD_DISPLAY = {}
$DEAD_DISPLAY[1] = ["189-Down01", 2, 0] #Actor 1
$DEAD_DISPLAY[2] = ["189-Down01", 6, 1] #Actor 2
$DEAD_DISPLAY[7] = ["190-Down02", 8, 0] #Actor 7
$DEAD_DISPLAY[8] = ["191-Down03", 4, 1] #Actor 8
#---------------------------------------------------------------------------
# ● RANGE_ELEMENT_ID is which element the range is set to
#---------------------------------------------------------------------------
$RANGE_ELEMENT_ID = 17 #Element 17
#---------------------------------------------------------------------------
# ● RANGE_DISPLAY is the setup for range weapons
# ● RANGE_DISPLAY[Data_Base_Weapon_ID] =
# ["Character_Set_Name", New Animation Id, Item Id of Ammo]
#---------------------------------------------------------------------------
$RANGE_DISPLAY = {}
$RANGE_DISPLAY[17] = ["Arrow", 4, 33] #Weapon 17
#======================================

class Action_Battle_System
#--------------------------------------------------------------------------
attr_accessor :ally_ai_active
attr_accessor :enemies
attr_accessor :display
attr_accessor :hud
attr_accessor :hud_pc
attr_accessor :hudname
attr_accessor :dash_level
attr_accessor :sneak_level
attr_accessor :transer_player
attr_accessor :ranged
attr_accessor :skill_key
attr_accessor :player_engaged
attr_accessor :close_follow
#--------------------------------------------------------------------------
def initialize
# Ally AI Flag
@ally_ai_active = true
# Enemies List
@enemies = {}
# Range List
@ranged = {}
# Dashing
@dashing = false
@dash_restore = false
@dash_reduce= false
@dash_timer = 0
@dash_level = 5
@dash_sec = 0
# Sneaking
@sneaking = false
@sneak_restore = false
@sneak_reduce= false
@sneak_timer = 0
@sneak_level = 5
@sneak_sec = 0
# Display
@display = []
@display[0] = false
@display[1] = ""
# Hud
@hud = true
@hud_pc = true
@hudname = "HUD-Display"
# Transfering Player
@transer_player = false
# Skill Keys
@skill_key = {}
@skill_key[1] = 0
@skill_key[2] = 0
@skill_key[3] = 0
@skill_key[4] = 0
# Ally tracking
@player_engaged = true
@player_obect = nil
# Party Command
@close_follow = false
end
#--------------------------------------------------------------------------
def hud_control(flag)
@hud = flag
return
end
#--------------------------------------------------------------------------
def hud_player_control(flag)
@hud_pc = flag
return
end
#--------------------------------------------------------------------------
def set_ally_ai(tirgger)
@ally_ai_active = tirgger
return
end
#--------------------------------------------------------------------------
def refresh(event, list, character_name)
@enemies.delete(event.id)
return if character_name == ""
return if list == nil
for i in 0...list.size
if list.code == 108 and list.parameters == ["ABS Event Command List"]
name = list[i+1].parameters[0].split
for x in 1...$data_enemies.size
enemy = $data_enemies 
 
 

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