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.

XAS Action Rpg System (Secret Of Mana Styled)

Davey

Member

December Blue Deity":3ay87a3b said:
How would I turn off the HUD (temporarily) on the Hero version of the XMS?
With switches. There are 3 switches: 4,5,11 (i thought, i don't have rmxp right now)
one is for the hud, another is for the dashing system, and the last one is for the overdrive.
 
Got a question about the scripting.  I've gotten this error saying:

Script 'XRXS - XAS' line 877: NoMethodError occurred
undefined method `+' for nil:NilClass

and that line in the code says:

876        character_name = super
877        file_name = character_name + self.character_namesuffix.to_s
878        character_name = file_name if RPG_FileTest.character_exist?(file_name)

And as for my character file names I'm using, the base character sprite I'm using is called "YoungAlexander" while the attack sprite is "YoungAlexander_STICK_01".  I got the walking animation sprites working but anytime I try to attack with the "Stick" I get that error.

I'm trying to follow the examples in the XAS Demo, but I'm stumped up to this point.

I'm not too knowledgable in ruby script yet so any advice I'd be grateful for.

P.S. sorry I can't send screenshots or anything of the type, I'm writing this during my break from class.
 
XDarknessBoyX":2cerx5k6 said:
@Regi
Where Exatly in the script i kinda couldn't find it * shy *

It's the XAS script, try using "Ctrl_F" and searching the first few words.

@Ryosuke, in the scriplet where you define the weapon, you need to change the suffix to "_STICK_01". I believe the default one is "_SWD_01", you have to define the suffix in the script or it won't work.
 
@Regi
Regi":2i6a396d said:
In the script, there's a section for activating a switch.

Find the lines:
Code:
DEFEAT_SWITCH_ID = {
   A=>B
}

Replace A with the ID of the boss, and B with the ID of a switch. Then create a new event on the map with Conditions "Switch B is On" and make things happen :smile:
i did all of this but it wont get the event work
my enemy ID is 10 and the event ID is 6
and i put this line in the XAS script u told me in page 10 of this topic:
  10=>6    #this is it

and in the event i put self switch B is on
but still nothing happend

thanks
 
6 isn't the event ID, it's the global switch that's activated.

Instead of "Self Switch B == On", use "Switch [0006:] == On." (Or you can change 6 to another number.)
 
You're going to have to modify the script if you want to use a self-switch, it's programmed so you have to use a switch.

~~~~~~~~~
Okay, so I've spotted a little glitch with the HUD. It only refreshes if you go to the menu and exit it. The problem is, if you change party members or use "Change Equipment", the HUD doesn't refresh and still shows the old equipment. Anyone know how to fix this?
 
Yeah, I did switch the weapon ID to "_STICK_01" but I still get the same error?

I'm getting a little more patient with scripting now that I got my finals done.  :lol:
Now I can start playing around with it again.
 
Sorry, I can't figure out the problem. Maybe if you could post the whole weapon scriptlet, that would help.

~~~
By the way, anyone figure out how to make the HUD refresh more often (read my previous post)?
Or, is there a way to make it refresh manually (using a call script)?

(And whatever happened to the site you made?)
 

6

Member

Can anyone tell me where to set up the ammo projectile weapons use?
Because at the moment all my projectile weapons have to use the same ammo.
And the new ones won't show the amount of ammo on the HUD...
 
This is the individual script for the weapon itself.
Code:
module Database_Bullet
  action_id = 1
  SUFLAGS[action_id] = 22 
  DURATIONS[action_id] = 22
  SELF_MOTIONS[action_id] = "_STICK_01"
  plan = []
  plan[5] = action_id 
  ATTACK_ID_PLANS[action_id] =  plan 
  ATTACK_RANGE_TYPES[action_id] = SQUARE
  ATTACK_RANGE_PLANS[action_id] = [1]
  BLOW_POWERS[action_id] = 1
  SELF_ANIMATION_PLANS[action_id] = []
  SELF_DAMAGES[action_id] = false
  PLAYER_DAMAGES[action_id] = false
  IGNORE_INVINCIBLES[action_id] = false
end
And this is a part of the XRXS-XAS code that the error happens,
which is at the "module XAS_CharacterName_Suffix"
this code starts at line 698:
Code:
#===============================================================================
# Token Mech
#===============================================================================
module XRXS_ActionTemplate
  map_id = XAS::ACTION_TEMPLATE_MAP_ID
  map = load_data(sprintf("Data/Map%03d.rxdata", map_id))
  @@events = map.events
end
class Token_Event < Game_Event
  include XRXS_ActionTemplate
end
class Game_Temp
  attr_accessor :active_token
end
module XAS_ACTION
  attr_reader   :action
  attr_reader   :erased
  def shoot(action_id)
    return if action_id == 0
    item_id = XAS::ITEM_COST[action_id]
    if item_id != nil and $game_party.item_number(item_id) == 0
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    self.action_attachment(action_id)
    n = 1
    @action.prelag   = n
    skill_id = action_id
    skill    = skill_id == nil ? nil : $data_skills[skill_id]
    sp_cost  = skill.sp_cost
      if self.battler.sp < sp_cost
      m = 1
      else  
      m = Database_Bullet::SUFLAGS[action_id].to_i  
      end
    @action.duration = m
  end
  def action_attachment(action_id)
    @action = Game_Action.new(self, action_id)
    @action.attachment(action_id)
    plan = Database_Bullet::SELF_ANIMATION_PLANS[action_id]
    @self_animation_plan = plan.nil? ? nil : plan.dup
  end
  def action_update
    return unless @action.is_a?(Game_Action)
    if @self_motion != nil
      self.character_name_suffix = @self_motion
      @pattern = 0
      @pattern_count  = 0
      @self_motion = nil
      if self.is_a?(Game_Player)
      @step_anime = true    
      end
    end
    if @self_animation_plan != nil
      animation_id = @self_animation_plan[@action.now_count]
      self.animation_id = animation_id unless animation_id.nil?
    end
    if @action.prelag > 0
      @action.prelag -= 1
      self.shoot_bullet(@action.id) if @action.prelag == 0      
      return
    end
    @action.update
  end
  def check_event_trigger_attack()
    if $game_system.map_interpreter.running?
      return
    end
    if @action.nil? or @action.attack_id == 0
      return
    end
    hit_check = false
    range = @action.attack_range
    hit = []
    targets = [$game_player] + (@action.player_damage ? [] : $game_map.events.values)
    for event in targets
      next if event == self  or
              @action.hit_events.include?(event) or
              event.jumping? or event.erased
      body_size      = event.body_size
      event_center_x = event.x
      event_center_y = event.y - body_size
      dx = event_center_x - self.x
      dy = event_center_y - self.y
      dx = (dx >= 0 ? [dx - body_size, 0].max : [dx + body_size, 0].min)
      dy = (dy >= 0 ? [dy - body_size, 0].max : [dy + body_size, 0].min)
      case @action.attack_range_type
      when Map::RHOMBUS
        hit_check = (dx.abs + dy.abs <= range)
      when Map::SQUARE
        hit_check = (dx.abs <= range and dy.abs <= range)
      when Map::LINE
        case self.direction
        when 2
          hit_check = (dx == 0 and dy >= 0 and dy <= range)
        when 8
          hit_check = (dx == 0 and dy <= 0 and dy >= -range)
        when 6
          hit_check = (dy == 0 and dx >= 0 and dx <= range)
        when 4
          hit_check = (dy == 0 and dx <= 0 and dx >= -range)
        end
      end
      hit.push(event) if hit_check
      hit_check = false
      end
    for event in hit
      if event.action_effect(self, self.action.attack_id)
        hit_check = true
      end
      @action.hit_events.push(event)
    end
    if hit_check
      $game_temp.active_token = self
    end
  end
  def action_effect(attacker, attack_id)
    return false unless self.is_a?(Game_Event)
    for page in @event.pages
      if page.condition.variable_valid and
         page.condition.variable_id == XAS::HIT_ID and 
         page.condition.variable_value == attack_id
        self.reaction_valid_attack_id = attack_id
        self.refresh
        @trigger = 0
        self.start
        return true
      end
    end
    return false
  end
  def shoot_bullet(action_id)
    return false if action_id == 0
    item_id = XAS::ITEM_COST[action_id]
    if item_id != nil
       $game_party.lose_item(item_id, 1)
       $game_temp.item_refresh = true  
    if $mogscript["mpequip"] == true
       $eref = true
    end          
    end
    bullet_token = Token_Bullet.new(self, action_id)
    $game_map.add_token(bullet_token)
    @self_motion = Database_Bullet::SELF_MOTIONS[action_id]
    return bullet_token
  end
  def body_size
    return 0
  end
  def action_clear
    @action = nil
    self.character_name_suffix = nil
  end
end
class Game_Character
  include XAS_ACTION
end
module XAS_Dispose
  def update
    action_update
    super
    if @action.is_a?(Game_Action) and @action.done?
      self.action_clear
      if self.is_a?(Game_Player)
      @step_anime = false    
      end      
    end
  end
end
class Game_Player < Game_Character
  include XAS_Dispose
end
class Game_Event < Game_Character
  include XAS_Dispose
end
module XAS_CharacterName_Suffix
  def character_name
    character_name = super
    file_name = character_name + self.character_name_suffix.to_s
    character_name = file_name if RPG_FileTest.character_exist?(file_name)
    return character_name
  end
  attr_accessor :character_name_suffix
end
class Game_Player < Game_Character
  include XAS_CharacterName_Suffix
end
class Game_Event < Game_Character
  include XAS_CharacterName_Suffix
end
module XAS_StopToAction
  def acting?
    return self.action != nil
  end
  def moving?
    return (super or self.acting?)
  end
end
class Game_Player < Game_Character
  include XAS_StopToAction
end
class Interpreter
  alias xrxs64_command_end command_end
  def command_end
    @list = nil
    event = $game_map.events[@event_id]
    return if event == nil
    if event.reaction_valid_attack_id
      event.reaction_valid_attack_id = nil
      event.refresh
    end
    xrxs64_command_end
  end
end
class Game_Event < Game_Character
  attr_accessor :reaction_valid_attack_id
  def refresh
    new_page = nil
    unless @erased
      for page in @event.pages.reverse
        c = page.condition
        if c.switch1_valid
          if $game_switches[c.switch1_id] == false
            next
          end
        end
        if c.switch2_valid
          if $game_switches[c.switch2_id] == false
            next
          end
        end
        if c.variable_valid
          if c.variable_id == XAS::HIT_ID and 
             c.variable_value == self.reaction_valid_attack_id
          elsif $game_variables[c.variable_id] < c.variable_value
            next
          end
        end
        if c.self_switch_valid
          key = [@map_id, @event.id, c.self_switch_ch]
          if $game_self_switches[key] != true
            next
          end
        end
        new_page = page
        break
      end
    end
    if new_page == @page
      return
    end
    @page = new_page
    clear_starting
    if @page == nil
      @tile_id = 0
      @character_name = ""
      @character_hue = 0
      @move_type = 0
      @through = true
      @trigger = nil
      @list = nil
      @interpreter = nil
      return
    end
    @tile_id = @page.graphic.tile_id
    @character_name = @page.graphic.character_name
    @character_hue = @page.graphic.character_hue
    if @original_direction != @page.graphic.direction
      @direction = @page.graphic.direction
      @original_direction = @direction
      @prelock_direction = 0
    end
    if @original_pattern != @page.graphic.pattern
      @pattern = @page.graphic.pattern
      @original_pattern = @pattern
    end
    @opacity = @page.graphic.opacity
    @blend_type = @page.graphic.blend_type
    @move_type = @page.move_type
    @move_speed = @page.move_speed
    @move_frequency = @page.move_frequency
    @move_route = @page.move_route
    @move_route_index = 0
    @move_route_forcing = false
    @walk_anime = @page.walk_anime
    @step_anime = @page.step_anime
    @direction_fix = @page.direction_fix
    @through = @page.through
    @always_on_top = @page.always_on_top
    @trigger = @page.trigger
    @list = @page.list
    @interpreter = nil
    if @trigger == 4
      @interpreter = Interpreter.new
    end
    check_event_trigger_auto
  end
end
class Game_Action
  attr_reader   :id                 
  attr_accessor :prelag                
  attr_accessor :attack_id             
  attr_reader   :attack_range        
  attr_reader   :attack_range_type    
  attr_accessor :user                 
  attr_reader   :hit_events           
  attr_accessor :now_count             
  attr_reader   :final_mark            
  attr_accessor :duration             
  attr_reader   :blow_power            
  attr_reader   :piercing             
  attr_reader   :player_damage         
  attr_reader   :ignore_invincible    
  def initialize(user, action_id)
    @user        = user
    @id          = action_id
    @prelag      = 0
    @now_count   = 0
    @duration    = nil
    @attack_id   = 0
    @attack_range= 0
    @hit_events  = []
    @blow_power  = 0
  end
  def attachment(action_id)
    @duration   = Database_Bullet::DURATIONS[action_id]
    power = Database_Bullet::BLOW_POWERS[action_id]
    @blow_power = power == nil ? 1 : power
    @attack_id_plan = Database_Bullet::ATTACK_ID_PLANS[action_id]
    @attack_range_type = Database_Bullet::ATTACK_RANGE_TYPES[action_id]
    plan = Database_Bullet::ATTACK_RANGE_PLANS[action_id]
    @attack_range_plan = plan.nil? ? nil : plan.dup
    @self_damage = Database_Bullet::SELF_DAMAGES[self.id]
    @player_damage = Database_Bullet::PLAYER_DAMAGES[action_id]
    @ignore_invincible = Database_Bullet::IGNORE_INVINCIBLES[action_id]
  end
  def update
    if @attack_id_plan != nil
      id = @attack_id_plan[@now_count]
      unless id.nil?
       @attack_id = id
       @hit_events.clear
       @hit_events.push(self.user) unless @self_damage
      end
    end
    if @attack_range_plan != nil
      range = @attack_range_plan[@now_count]
      @attack_range = range unless range.nil?
    end
    @now_count += 1
  end
  def done?
    return (self.duration.to_i > 0 and self.now_count >= self.duration)
  end
end
class Token_Bullet < Token_Event
  def initialize(user, action_id)
    original_event = @@events[action_id]
    return if original_event == nil
    event = original_event.dup
    event.x = user.x
    event.y = user.y
    event.pages[0].graphic.direction = user.direction
    @character_name = event.pages[0].graphic
    super($game_map.map_id, event)
    self.action_attachment(action_id)
    @action.user = user
    @remain_for_an_act = @action.duration.is_a?(Numeric)
  end
  def update
    super
    erase if @action == nil and @remain_for_an_act
    check_event_trigger_attack
  end
end
module Map
  RHOMBUS = 1
  SQUARE  = 2
  LINE    = 3
end
module Database_Bullet
  include Map
  EVENTS    = []
  EVENT_IDS = []
  DURATIONS = []
  PRELAGS   = []
  SUFLAGS   = []
  FINALIZE_MARKS = []
  ATTACK_ID_PLANS    = []
  ATTACK_RANGE_TYPES = []
  ATTACK_RANGE_PLANS = []
  BLOW_POWERS = []
  SELF_MOTIONS = []
  SELF_ANIMATION_PLANS = []
  PIERCINGS = []
  SELF_DAMAGES = []
  PLAYER_DAMAGES = []
  IGNORE_INVINCIBLES = []
end
"YoungAlexander" is the walking sprite and
"YoungAlexander_STICK_01" is the attacking sprite and they're .png files.
 

merfie

Member

Has anyone found a compatible script that lets you switch party leaders.  So I could have an archer, mage, and fighter in my party and press a button to switch between the 3 of them.
 
merfie":23lfjtbr said:
Has anyone found a compatible script that lets you switch party leaders.  So I could have an archer, mage, and fighter in my party and press a button to switch between the 3 of them.

I FOUND IT>> Thanks!!

megamariohead":23lfjtbr said:
You can just edit it. i made a pretty good game out of it.

I'll try to edit it.... But thanks also!!
 
Okay, forget my last question for now, I've been working with 2.0 for a bit and have a different question .  I notice that the Skills tab in the database is used for everything like player weapons, player/monster skills, and items.  My question is, would it be possible to shorten up that list by using a type for weapons instead of seprating each weapon in the skills tab?

Example: Sword, Fire Sword, Ice Sword, Claymore, Bastard Sword, Short Spear, Fire Spear, Ice Spear, Pike, and Lance, are all the weapons I want to use in my game (I actually plan on the weapons available in the triple digits).  Could I seperate them in to these into classes like Sword, Fire Sword, Ice Sword, Spear, Fire Spear, Ice Spear?

Unless the Skill ID effects the weapon individually, then I guess my idea goes down the crapper. XD
 

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