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.

A 2-handed weapon script request

I simply want a script which if I just put the ID of the weapon into the script it becomes 2-handed. What I mean is, a script which a certain weapons become 2-handed, not letting them use shields. I'm not sure if its easy or hard either... Plz help (This will be my only script request ;))
 
Kinda understandable. Utilizing a two-handed weapon would do that.

BUT.... what about the additional slots available (like the gauntlets, boots and etc)? Change one of those into a SHIELD slot and tag all your shields to that type of item.

Example: Set the addtl 'FIFTH' slot to Shield...

Name/Rename the slot:
Code:
EXTRA_SLOT_NAMES = ['Shield','Boots','Amulet']

Change all shields in the database like this...
Bronze Shield(5)
Iron Shield(5)
Mythril Shield(5)
Change the order of your Armor slots (for the equip menu) like so...
Code:
ARMOR_KINDS = [[B]5[/B],2,3,4,6,7]
As you see, I replaced the '1' for shields with the '5' with my extra slot.

There ya go. Two-handed weapon WITH shield usage.
 
You didn't try the slot substitution trick I posted yesterday, didja...

Altered snippet of the Config section:
Code:
  ARMOR_KINDS = [[B]5[/B],2,3,4]#[1,2,3,4,5,6,7]
  # 1 = shield
  # 2 = helmet
  # 3 = armor
  # 4 = acc
  # 5 = and more : extra slot
  EXTRA_SLOT_NAMES = ['Shield'] #['Gauntlet','Boots','Amulet'] 
  # Name of the extra slots in equip window
  # You need as many words as there are '5' or more in armor_kinds
  # The first order of the slots names reflect the order of the 5 in armor_kinds
  # Put (5) or more to in the armor name to have it assigned to the extra slot
Then just put a (5) after the names of all your shields:

Bronze Shield(5)
Iron Shield(5)
Steel Shield(5)
Mythril Shield(5)

I 'know' this works.

As far as the script knows, the 5th substitute slot (pretending to be shields) is merely an extra accessory slot. As that is the case, it won't be disabled when using a two-handed weapon. But by renaming it (EXTRA_SLOT_NAMES) and rearranging the order of the slots (ARMOR_KINDS), the player would never know the difference.
 

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