• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

adding charges on a item each hit

Status
Not open for further replies.
Level 6
Joined
Sep 24, 2015
Messages
174
Hello,

I'm trying to do a trigger wich is :

A hero manipulates an item, manipulated item = collect darkness, on every hits on an ennemi building or unit it adds +1 charge on the item, every 666 charges the gold income/sec is improved by 1 for the player who has the hero manipualting this item, If owner of hero manipulating item writes -free it removes the item , creates a spell instead for the hero, the spell will replace the item and will have the same function like the item.

Is that possible?

also I tried doing it but there is no "add charges on an item" only "set remaining charges"

and is there a Damage Engine required for a such item?
 
Yes, this will need DamageEngine. I'm not fond of using charges simply to store a number, but you can use its custom value.

  • Attack with item
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to False
      • DamageEventTarget is A structure Equal tk True
      • DamageEventSource has item <your item> Equal to True
    • Actions
      • Item - Set the custom value of <your item> to ((Custom value of <your item>) + 1)
      • If (Multiple conditions)
        • If - Conditions
          • (Custom value of <your item>) Equal to 666
        • Then - Actions
          • -------- You can add that function regarding gold increase here --------
          • Item - Set the custom value of <your item> to 0
        • Else - Actions
 
Level 6
Joined
Sep 24, 2015
Messages
174
It's not working, did the same trigger but it's not adding charges on the item.

  • Collect darkness
    • Event
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to* FALSE
      • (DamageEventTarget is A building) Equal to* TRUE
      • (DamageEventSource has an item of type Collect Darkness) Equal to* TRUE
      • (Item-type of (Item being manipulated)) Equal to* Collect Darkness
  • Actions
    • Objet - Set the custom value of (Item being manipulated) to ((Custom value of (Item being manipulated)) + 1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Custom value of (Item being manipulated)) Equal to* 666
      • Then - Actions
        • Joueur - Add ((Custom value of (Item being manipulated)) + 1) to (Owner of (Item being manipulated)) Or Current
      • Else - Actions
 
Last edited:
Level 6
Joined
Sep 24, 2015
Messages
174
still not working...

  • Collect darkness
    • Evénements
      • Partie - DamageEvent becomes Egal Ã* 1.00
    • Conditions
      • IsDamageSpell Egal Ã* FALSE
      • (DamageEventTarget is Un bâtiment) Egal Ã* TRUE
      • (DamageEventSource has an item of type Collect Darkness) Egal Ã* TRUE
      • (Item-type of (Item being manipulated)) Egal Ã* Collect Darkness
    • Actions
      • Set ColDarkness = (Item being manipulated)
      • Objet - Set the custom value of ColDarkness to ((Custom value of ColDarkness) + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • (Custom value of ColDarkness) Egal Ã* 666
        • Alors - Actions
          • Joueur - Add ((Custom value of ColDarkness) + 1) to (Owner of ColDarkness) Or actuel
        • Sinon - Actions
 
Level 6
Joined
Sep 24, 2015
Messages
174
I tried this but it's not working either...

  • Collect darkness
    • Event
      • Game - DamageEvent becomes Equal to* 1.00
    • Conditions
      • IsDamageSpell Equal to* FALSE
      • (DamageEventTarget is A building) Equal to* TRUE
      • (DamageEventSource has an item of type Collect Darkness) Equal to* TRUE
      • (Item-type of (Item carried by DamageEventSource of type Collect Darkness)) Equal to* Collect Darkness
    • Actions
      • Item - Set the custom value of (Item carried by DamageEventSource of type Collect Darkness) to ((Custom value of (Item carried by DamageEventSource of type Collect Darkness)) + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Item carried by DamageEventSource of type Collect Darkness)) Equal to* 666
        • Then - Actions
          • Player - Add ((Custom value of (Item carried by DamageEventSource of type Collect Darkness)) + 1) to (Owner of (Item carried by DamageEventSource of type Collect Darkness)) Current gold
        • Else - Actions
 
Level 6
Joined
Sep 24, 2015
Messages
174
Hmmm are you actually testing this until it hits the custom value of 666?

Also, I don't think this is going to work. Maybe try changing it to Owner of damage source?

  • (Owner of (Item carried by DamageEventSource of type Collect Darkness))

Not working :/
 
Level 6
Joined
Sep 24, 2015
Messages
174
Custom value is only used for triggers. It doesn't affect the game at all. Make the "666" smaller for testing purposes so you know the gold is being added properly.

Hmm i lowered the value to 2 and it's not giving any gold to the owner...
 
Level 6
Joined
Sep 24, 2015
Messages
174
Well i put a unit on the map in front of an ennemi structure and basically it should work i don't get why it isn't working...

if you could try doing the trigger and testing it and telling me whats wrong i could learn something ...

Because i'm trying 10000 times other things and it's still not working...

also if you could put the exemple trigger here it would be awesome and helpfull for me...

thanks
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
Well i put a unit on the map in front of an ennemi structure and basically it should work i don't get why it isn't working...

if you could try doing the trigger and testing it and telling me whats wrong i could learn something ...

Because i'm trying 10000 times other things and it's still not working...

also if you could put the exemple trigger here it would be awesome and helpfull for me...

thanks

Oh wait I see it. When youre adding the gold, change this to Owner of damage source
  • (Owner of (Item carried by DamageEventSource of type Collect Darkness))

Also get rid of this condition. You do not need it:
  • (Item-type of (Item carried by DamageEventSource of type Collect Darkness)) Equal to Collect Darkness
 
Level 6
Joined
Sep 24, 2015
Messages
174
I found the way to add charges on an item ! but i still don't know how to add gold, if there is a specific amount of charges, at owner of the item...

  • Collect darkness2
    • Event
      • Game - DamageEvent becomes Equal to* 1.00
    • Conditions
      • IsDamageSpell Equal to* FALSE
      • (DamageEventTarget is A Building) Equal to* TRUE
      • (DamageEventSource has an item of type Collect Darkness) Equal to* TRUE
    • Actions
      • Item - Set charges remaining in (Item carried by DamageEventSource of type Collect Darkness) to ((Charges remaining in (Item carried by DamageEventSource of type Collect Darkness)) + 1)
      • game - Display to (All players) the text: (String((Charges remaining in (Item carried by DamageEventSource of type Collect Darkness))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Charges remaining in (Item carried by DamageEventSource of type Collect Darkness)) Equal to* 2
        • Then - Actions
          • Player - Add ((Charges remaining in (Item carried by DamageEventSource of type Collect Darkness)) + 1) to (Owner of (Item carried by DamageEventSource of type Collect Darkness)) Current gold
          • Game - Display to (All players) the text: (String(((Owner of (Triggering unit)) Or actuel)))
        • Else - Actions
 
Last edited:
Level 37
Joined
Jul 22, 2015
Messages
3,485
I found the way to add charges on an item ! but i still don't know how to add gold, if there is a specific amount of charges, at owner of the item...

  • Collect darkness2
    • Event
      • Game - DamageEvent becomes Equal to* 1.00
    • Conditions
      • IsDamageSpell Equal to* FALSE
      • (DamageEventTarget is A Building) Equal to* TRUE
      • (DamageEventSource has an item of type Collect Darkness) Equal to* TRUE
    • Actions
      • Item - Set charges remaining in (Item carried by DamageEventSource of type Collect Darkness) to ((Charges remaining in (Item carried by DamageEventSource of type Collect Darkness)) + 1)
      • game - Display to (All players) the text: (String((Charges remaining in (Item carried by DamageEventSource of type Collect Darkness))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Charges remaining in (Item carried by DamageEventSource of type Collect Darkness)) Equal to* 2
        • Then - Actions
          • Player - Add ((Charges remaining in (Item carried by DamageEventSource of type Collect Darkness)) + 1) to (Owner of (Item carried by DamageEventSource of type Collect Darkness)) Current gold
          • Game - Display to (All players) the text: (String(((Owner of (Triggering unit)) Or actuel)))
        • Else - Actions

Lol did you just ignore what I said? >.> Reread above.

Also, are you sure you want to use charges to store the number? Couldn't the user accidently "use" the item and lose a charge?
 
Level 6
Joined
Sep 24, 2015
Messages
174
also you can't use the item it's only to show your current charges.

and i need a periodic gold income for add to the player the gold.
 
Status
Not open for further replies.
Top