Equipting items

duderock101

Check out my 2 Player Co-op RPG!
Reaction score
71
I started to get intrested into attachments after reading one of the tuts.

I was hoping to make two systems for personal use, but i just have no idea how to do them.

1. I want a person to pick up the item, and it to be auto equipped, i know how to display attachments, i was just wondering how i would detect if the unit was already carrying a weapon. If they were, then the item would get dropped instantly.

2. I was wanting the items to be in the units inventory, and when they used the item they equiped it, it remained in the inventory but you could see the weapon in the units hand and they got the weapons stat increases.

I know how to attach weapons to units, just not how to detect if theres already one attached. If anyone could shed light to this dark hole then +rep and good karma, or bad karma what ever u want.

~~~Duderock101~~~
 

Komaqtion

You can change this now in User CP.
Reaction score
469
1. Well, maybe use Custom Values of the units... And if custom value of (Hero manipulating item) equal to 1 (This means he has a weapon) then drop the item ? :eek:
This is probably easiest achieved by having all weapons in a specific item-class...
Then when a hero loses an item, and he has 0 item of item-class e.g Permanent, then set custom value to 0 or 2 or something :D

2. For this, it's probably easiest to have 2 items, with the same description and stuff, just one ofthe has no stat bonuses...
Then, when he uses the "non-bonus" item, he recieves the "bonus" item... Giving him the stats, and attachments :D
 

Denegoth

New Member
Reaction score
18
I think I get the idea of what you're asking. Here is the equip system in my map, feel free to edit it to fit with your request.

Equip

Trigger:
  • BronzeAxe
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Bronze Axe
    • Actions
      • -------- Check if you already have a weapon equipped --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WeaponEquipped[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000You can o...
          • Skip remaining actions
        • Else - Actions
      • -------- This is an Item-Type variable. This is to add the item back when you unequip it --------
      • Set Weapon[(Player number of (Owner of (Triggering unit)))] = Bronze Axe
      • -------- An edited Item Damage Bonus --------
      • Set WeaponAttack[(Player number of (Owner of (Triggering unit)))] = Weapon Bonus (Bronze Axe)
      • -------- This is just Slow Aura set to Self with 0% speed adjusting. This is just so I can show the buff "Bronze Axe" --------
      • Set WeaponBuff[(Player number of (Owner of (Triggering unit)))] = WeaponHeld (Bronze Axe)
      • -------- This is so you can only have one weapon at a time --------
      • Set WeaponEquipped[(Player number of (Owner of (Triggering unit)))] = True
      • -------- Weapon Type is not required, but I put it in to make stuff like Woodcutting more convenient, so I don't have to check every type of Axe --------
      • Set WeaponType[(Player number of (Owner of (Triggering unit)))] = Axe
      • -------- From what I can tell, you will want to remove this part --------
      • Item - Remove (Item being manipulated)
      • -------- Add the skills --------
      • Unit - Add WeaponAttack[(Player number of (Owner of (Triggering unit)))] to (Triggering unit)
      • Unit - Add WeaponBuff[(Player number of (Owner of (Triggering unit)))] to (Triggering unit)
      • Unit - Add Unequip to (Triggering unit)


Unequip

Trigger:
  • Unequip
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Unequip
    • Actions
      • -------- Removes the bonuses --------
      • Unit - Remove WeaponAttack[(Player number of (Owner of (Triggering unit)))] from (Triggering unit)
      • Unit - Remove WeaponBuff[(Player number of (Owner of (Triggering unit)))] from (Triggering unit)
      • -------- If you plan to remove the "Remove Item" from the equip trigger, remove this also --------
      • Hero - Create Weapon[(Player number of (Owner of (Triggering unit)))] and give it to (Triggering unit)
      • -------- Sets the variables to nothing --------
      • Set Weapon[(Player number of (Owner of (Triggering unit)))] = (Item-type of No item)
      • Set WeaponEquipped[(Player number of (Owner of (Triggering unit)))] = False
      • Set WeaponType[(Player number of (Owner of (Triggering unit)))] = None
      • -------- Removes the ability to unequip --------
      • Unit - Remove Unequip from (Triggering unit)


Make sure to attach the weapon attachment to the Slow Aura.
 

Sunchips

New Member
Reaction score
6
Ive made a really nice system for equipping :p but it lets you equip 11 different kind of items (helmets, weapons, boots etc.) want me to post my map im working on so that you can look at the triggers? :p I also use attachments when you equip weapons ^^
 

Scary Nachos

Castro flashing Gang Signs!
Reaction score
45
1. Well, maybe use Custom Values of the units... And if custom value of (Hero manipulating item) equal to 1 (This means he has a weapon) then drop the item ? :eek:
This is probably easiest achieved by having all weapons in a specific item-class...
Then when a hero loses an item, and he has 0 item of item-class e.g Permanent, then set custom value to 0 or 2 or something :D

2. For this, it's probably easiest to have 2 items, with the same description and stuff, just one ofthe has no stat bonuses...
Then, when he uses the "non-bonus" item, he recieves the "bonus" item... Giving him the stats, and attachments :D

Use this. For #2 Use the +1 Armor Abbility, and have it give 0 armor, then attach it from there.
 

Denegoth

New Member
Reaction score
18
Use this. For #2 Use the +1 Armor Abbility, and have it give 0 armor, then attach it from there.

It'l work well unless you wish to use Custom values for anything else. I preferred to do mine as a completely different system as I'm likely to use custom values later on.

It also helps to have inventory space.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top