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.

Requirement Scripts

Just to Clarify
I have seen a few and checked them but wasn't sure if they met what I needed so instead of repeat posting on each, I just did this post.
I wasn't sure about some other scripts as they depended on an implemented stats like strength etc whereas my requirement is a variable.
(ID 0002 for reference).

Firstly,
I would like a script where to use a skill you would have to either a certain 'type' of weapon equipped (ie a sword, axe, bow etc) to use or to have multiple types of weapon equipped (ie 2 swords (via a multi-equip script) or 1 sword and 1 axe etc)
For example:
Dual Slash requires 2 swords equipped.
Axe Smash requires an axe (in either R Arm (Normally Weapon Slot) or L Arm (Normally Shield Slot))

Secondly
In my game I have a 'alignment' variable and I would like a script that would allow certain skills to be learnt by certain alignments. ie:
  • evil characters (alignment < 0)
  • good characters (alignment > 0)
  • neutral characters (alignment == 0)
Also they must have reached the desired level.
For example:
Holy requires a positive alignment.
Greater Holy requires a positive alignment over 30.

Thirdly
I may need a script to allow for 1 particular skill to act differently depending alignment when used. Ie a different element, animation, state infliction/removal and name.
For example:
True Strike - causes light damage if good alignment, dark if evil or no element if neutral.

Fourthly
A script that only allows certain weapons to be equipped by certain alignments. Ie good, evil, neutral.
For example:
Excaliber requires a positive alignment.
Pure Silver Sword requires a posivive alignment over 30.

I hope this is possible and i accept that it would require a wait if they don't already exist.

Thanks for any support!
 
It looks promising but I am not good at scripting so would it be possible for me to request those edits? or maybe you could tell me how to do i myself?
thanks for the script though it wll solve some of the problems.
Also is it possible to show a small message box when an item fails to be equipped with the reason why in it? for example if the weapon needs 20 alignment i says it does.
 
The next version will have a requirements window that will say the requirements and an error catcher on why you couldn't equip a weapon.

1) Should be able to do with current version
Code:
  # * Weapon Requirements
  #    Description : To Use A Skill, Item (In Battle) or Equipment, You
  #                  Must Have specific weapon equipped.
  #    Setup : Weapon = { object_id => weapon_id, ... }
  #
2) Should be able to use current version
Code:
  # * Game Variable Requirements (ALL)
  #    Description : To Use A Skill, Item (In Battle) or Equipment, All
  #                  Variables Must Be Equal to, Less Than, Less Than or Equal
  #                  To, Greater Than, or Greater Than Or Equal A Value.
  #    Setup : Variable_All = {object_id => {variable_id => 
  #                            [n, '<operator>'], ... }, ... }
  #
  # * Game Variable Requirements (One)
  #    Description : To Use A Skill, Item (In Battle) or Equipment, one
  #                  Variable Must Be Equal to, Less Than, Less Than or Equal
  #                  To, Greater Than, or Greater Than Or Equal A Value.
  #    Setup : Variable_All = {object_id => {variable_id => 
  #                            [n, '<operator>'], ... }, ... }
  #
3) That isn't so much as of a requirement, but I love skill systems. I will throw one together soon.
4) Just use the variables as in number 2
 
Sorry. With the update of the SDK and dozens of scripts I want to release, it is taking some time. I have literally updated every script, and quite a few scripts got some overhauls. I am working on this new version great, since it will be the last for a while (time to work on starter kits and such).
 
O thanks, hey mr.seph, i cant use the req script, that not work... i follow all instrucctions.

i use this:

Code:
    module Weapons
      #---------------------------------------------------------------------
      # * Requirements
      #---------------------------------------------------------------------
      Actor          = {}
      Class          = {}
      Skill_All      = {}
      Skill_One      = {}
      Armor_All      = {}
      Armor_One      = {}
      Level          = {}
      Stat_All       = {001 => {'atk' => [100, '<==>']}}
      Stat_One       = {}
      State_Have_All = {}
      State_Have_One = {}
      State_Dont_All = {}
      State_Dont_One = {}
      Switch_All     = {}
      Switch_One     = {}
      Variable_All   = {}
      Variable_One   = {}
      # Leave This Constant Alone
      Weapon         = {}

i want: the weapon 001 ( i intent with 1 so), req a equal attk of 100, and i have an atk of 20 and i can use the weapon...what is my problem?????

can you make a writing example?
 
I'm having a similar problem:

#========================================================================
# ** Skills
#========================================================================

module Skills
#---------------------------------------------------------------------
# * Requirements
#---------------------------------------------------------------------
Actor = {}
Class = {}
Skill_All = {}
Skill_One = {}
Weapon = {}
Armor_All = {}
Armor_One = {}
Level = {}
Stat_All = {}
Stat_One = {}
State_Have_All = {}
State_Have_One = {}
State_Dont_All = {}
State_Dont_One = {}
Switch_All = {}
Switch_One = {}
Variable_All = {}
Variable_One = {
82 => {2 => [0, '>']},
83 => {2 => [0, '<']},
84 => {2 => [0, '==']}
}

The 3 skill (IDs 82, 83, 84) need to have either a positive alignment (var ID 2), a negative or a neutral (ie 0 alignment) yet even though I have a negative alignment (and I checked this by displaying the variable in game) I can still use the pos alignment skill.
Do I need to use any call scripts? for example either of these:

#---------------------------------------------------------------------
# * Can Use? Test
#---------------------------------------------------------------------
def self.can_use?(actor, object_id = 0)
# Return False If Skills Doesn't Exist
return false if $data_skills[object_id].nil?
# Return Test For All Requirements
return EIS_Requirements.can_use?(actor, object_id, self)
end
end
 
@mephisto: it should be this:

Code:
Stat_All       = {1 => {'atk' => [100, '<==>']}}

But what are you using <==> for? I believe you want to use '>='

@satan112: It isn't necessary to call anything. That is just syntax for scripters if they want to further this system.

I am seeing a few errors in my coding (as minor as they are). I will check over everything and see if I can't find anything wrong.
 
Thats quite strange then.
Any idea why it isn't stopping the skill being used.
If it is any help I amtrying to use the skill IN battle would it be a different case if it was from the menu?
 
Here's a few bugs in the system I see so far:
Code:
  #--------------------------------------------------------------------------
  # * Requirements Test : Stats One
  #--------------------------------------------------------------------------
  def self.has_one_stat?(actor, list = {})
    list.each do |stat_name, parameters|
      if eval "actor.#{stat_name} #{parameters[1]} #{parameters[0]}"
        return true 
      end
    end
    return true
  end
Should be
Code:
  #--------------------------------------------------------------------------
  # * Requirements Test : Stats One
  #--------------------------------------------------------------------------
  def self.has_one_stat?(actor, list = {})
    list.each do |stat_name, parameters|
      if eval "actor.#{stat_name} #{parameters[1]} #{parameters[0]}"
        return true 
      end
    end
    return false
  end

Code:
  #--------------------------------------------------------------------------
  # * Requirements Test : Variables One
  #--------------------------------------------------------------------------
  def self.one_variables?(list = {})
    list.each do |variable_id, parameters|
      if eval ("$game_variables[#{variable_id}] #{parameters[1]} " +
                   "#{parameters[0]}")
        return true 
      end
    end
    return true
  end
Should be
Code:
  #--------------------------------------------------------------------------
  # * Requirements Test : Variables One
  #--------------------------------------------------------------------------
  def self.one_variables?(list = {})
    list.each do |variable_id, parameters|
      if eval ("$game_variables[#{variable_id}] #{parameters[1]} " +
                   "#{parameters[0]}")
        return true 
      end
    end
    return false
  end

I think that's the problem.
 

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