• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Help] Remove one item from Hero

Status
Not open for further replies.
Level 2
Joined
Sep 11, 2009
Messages
11
Remove one item from Hero

How to remove an object of hero?

Example: I have 50 ammunition, through a trigger remove 1, 49 left... Remove other, 48 left... etc.

Thanks...

PD: Sorry for my English :p
 
Last edited:
Level 9
Joined
Oct 11, 2009
Messages
477
You need a charged item. assume the maximum ammunition is 50, set its maximum charge through object editor to 50. After that, manipulate(add or subtract) the charge value through triggers. After the charge is depleted, remove the item from the hero.
 
Level 9
Joined
Oct 11, 2009
Messages
477
Yes, as I am saying, each item is a cartridge. When a charge of an item becomes 0, the item is removed. Same as the concept on cartridges, when the cartridge becomes empty of bullets, the cartridge is removed from that hero.

Remember these:
Item = Cartridge
Item charge = Number of bullets
 
Level 9
Joined
Oct 11, 2009
Messages
477
Create a new custom item. Then checked its classification as 'charged' and set its maximum charges based on the number of bullets each cartridge. Your new custom item will stands for the cartridge itself. As for the charge subtraction. Create a trigger like this:
  • Cartridge
    • Events
      • Unit - A unit is attacked
    • Conditions
      • (Attacking unit) has (item of type of (Cartridge)) Equal to True
    • Actions
      • //Your actions here: bullet reduction, etc.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Or you can do based on Gold or Lumber
I've created a test map that your bullet is based on Gold, check it out =D
But I'm having some problem/bug...
If you just shoot without changing your position or whatever, you will notice that the reduction will be doubled each time
How to fix this lol...
 

Attachments

  • Bullet System.w3x
    13.9 KB · Views: 97
Status
Not open for further replies.
Top