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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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