• 🏆 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!

[Spell] Energy charge

Status
Not open for further replies.
Level 3
Joined
Oct 31, 2014
Messages
55
hello, i created a spell based on roar, that increases the base damage of the unit, but i wanted it to last just one attack, its there any way to remove the buff after the first attack is done?
 
Level 3
Joined
Oct 31, 2014
Messages
55
yeah but i dont know how to make it work, i downloaded dds, imported it, tried to make the variables and tried to make something simple and it didnt work :/, also dont know how to make that specific thing that i want
 
Level 25
Joined
Sep 26, 2009
Messages
2,383
You don't have a Damage Detection System (DDS) in your map.
The event "Unit is attacked" is not an event for damage detection (as it ain't even precise to begin with and has nothing to do with damage itself).

Also, I just took a quick look at your variables to verify if you imported DDS or not and I saw you're creating way too many variables.

Instead of creating unique variable for each player (e.g. kills1 for player 1 and kills2 for player 2, etc. up to player 12), learn to use arrays.
That way you will have kills[] and as an index you will use player's number - e.g. kills[5] for player 5. It will simplify and optimize your triggers too.
 
Level 3
Joined
Oct 31, 2014
Messages
55
i just realized that the dds is a map with triggers, i thought that you have to import the archive in your map ._. , i mean, didnt check that the thing i was downloading was a map.
well now im really concerned about the dmg reduction ability and how to set the amount
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
OOOOOOOOOOOOOOOOOOOOOOKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK

That map is a bit large to just find one simple thing.
I suggest re-organizing and cleaning the triggers at least.

But anyway here is your trigger:
  • Carga de energia
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) has buff Carga de energia ) Equal to True
    • Actions
      • Wait 0.50 seconds
      • Unit - Remove Carga de energia buff from (Attacking unit)
You use "Unit - A unit Is attacked" as the event.
The problem is that when "A unit Is attacked", the unit is not attacked YET.
Example: I want to hit you with my sword. To do that, I have to swing my sword at you. When my sword hits you, you gain damage.

Start swinging sword = A unit Is attacked
Sword hits you = A unit Takes damage

(Time difference = Unit - Combat - Attack X - Animation Damage Point (udpX) - real)
(Object editor - Units)

You check if the target has a buff that it will gain in a few moment of time.
You have to use the event "A unit Takes damage". For that you need a DDS (Damage Detection System) to be able to use the event.
In this case you don't need anything specific so it is very simple.

I have a system that you can use and is not very hard to implement. (see attached file)
You can also use this system, but I don't know how it works so I can't help you with that.

For the other things in your map... idc what you have XD
But you should indeed, as Nichilus said, clean everything up.
 

Attachments

  • test.w3x
    19.6 KB · Views: 39
Level 3
Joined
Oct 31, 2014
Messages
55
i know my map is a little messy :p.
i would really like to know how to use dds because a have other ideas
question, i have the physical damage detector for GUI, that's a dds? if not pass me a link plz :p
 
Level 25
Joined
Sep 26, 2009
Messages
2,383
After you import it the trigger would be as follows:
  • Untitled Trigger 001
    • Events
      • Game - damageEventTrigger becomes Equal to 1.00
    • Conditions
      • (source has buff Carga de energia) Equal to True
    • Actions
      • Unit - Remove Carge de energia buff from source
The variable in the event is set to 1.00 by the DDS. It means that a unit took damage (yet, it is before the damage is applied).
So the event means "unit takes damage" and you simply check if the source (that's a variable used by this system and it is the one who damaged unit) has your buff you want. If yes, you remove the buff from the source.
 
Status
Not open for further replies.
Top