• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Condition Problem

Status
Not open for further replies.
Level 7
Joined
Mar 13, 2008
Messages
205
Before I say anything: Yes, I am aware that there are tons of threads on this exact subject, but I haven't found at least one that is solved, so...

I have an auto-cast ability "Static Charge". This ability basically adds damage on every attack, but it also has one effect that I have a problem with. Each time a unit uses Static Charge, the target becomes charged, AKA gains a buff for 10 seconds. What I want is that when the charged unit dies it releases the explosion in area around it, damaging units.

Now, here is the deal, I have no problem with making ability or damage dealing, but with condition: "Dying unit has a buff" since, as far as I learned, it can't be checked if dying unit has a buff, and I can't think of any other condition to use. Here's the trigger for better understanding (It's very simple; I know):

  • Static Charge
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) has buff Static Charge (Stacking)) Equal to True
    • Actions
      • Environment - Create a 1.00 second Normal ripple deformation at (Position of (Dying unit)) with starting radius 0.00, ending radius 200.00, and depth 45.00, using 0.20 second ripples spaced 50.00 apart
      • Special Effect - Create a special effect at (Position of (Dying unit)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Cause (Killing unit) to damage circular area after 0.00 seconds of radius 200.00 at (Position of (Dying unit)), dealing 75.00 damage of attack type Spells and damage type Unknown
So, if there is a more efficient way to do this and you know it please help. If you decide to help please take this into consideration:

Me and JASS are like fire & water, so please try help me come up with a solution in GUI first, JASS should be like a final solution:(:(:(

P.S: I'm not the expert with GUI either, so posting the trigger of your solution would be helpful alot.

+Rep to those who help.

!!~Thanks in advance~!!
 
Last edited:
Level 7
Joined
Mar 13, 2008
Messages
205
maybe a periodic triggers that checks every some .xx seconds if the unit has buff then set a boolean for that unit to true (I suggest saving the boolean in a hasthtable) then check if the boolean is true when the unit dies.... maybe .03 or even .1 seconds is okay..

...Did I forgot to mention I'm a little n00bish when it comes to GUI as well? If you could post a trigger of what you mean it would be very helpful.
 
First Add the hero into a unit group at the start or when he is picked...
  • Events
  • Conditions
  • Actions
    • Unit Group - Add Hero to HeroGroup
then use this trigger to check if he has buff and then add him into a group(based on apocalypse's suggestion) its easier cause you wont need a hashtable to make it MUI instead of using a boolean
  • Events
    • Time - Every .03 seconds of gametime
  • Conditions
  • Actions
    • Unit Group - Pick every units in HeroGroup then do
      • actions
        • If
          • PickedUnit has buff static equal to true
        • then
          • Add Pick unit to StaticGroup
        • else
          • Remove Picked unit from StaticGroup
then when he dies just check if the unit is in group StaticGroup....

  • Events
    • Unit - A unit dies
  • Conditions
    • TriggeringUnit is in StaticGroup equal to true
  • Actions
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
First Add the hero into a unit group at the start or when he is picked...
  • Events
  • Conditions
  • Actions
    • Unit Group - Add Hero to HeroGroup
then use this trigger to check if he has buff and then add him into a group(based on apocalypse's suggestion) its easier cause you wont need a hashtable to make it MUI instead of using a boolean
  • Events
    • Time - Every .03 seconds of gametime
  • Conditions
  • Actions
    • Unit Group - Pick every units in HeroGroup then do
      • actions
        • If
          • PickedUnit has buff static equal to true
        • then
          • Add Pick unit to StaticGroup
        • else
          • Remove Picked unit from StaticGroup
then when he dies just check if the unit is in group StaticGroup....

  • Events
    • Unit - A unit dies
  • Conditions
    • TriggeringUnit is in StaticGroup equal to true
  • Actions

Thank you for creating my idea, saves me time :p
 
Level 7
Joined
Mar 13, 2008
Messages
205
I didn't ignore your idea, but I asked for it to be presented in GUI since:

"Or you could add the unit to a unit group, then check whether the dying unit is in the unit group = true.
If it's true, he has the buff, if it's false, he doesn't.

Of course, you need to remove the unit from the unit group once the 10 seconds are over :p
"

-didn't really help me (I said I wasn't very good at triggering, so I could not understand what you where saying)

But Adiktuz gave me a good picture of what should I do... that is all.

The thread should be over, but you just seem to keep on posting what seems to me like bitching for me not acknowledging your idea. I am aware that you helped, but I didn't think it was that big of a deal if Adiktuz gets my thanks, you are full 'o' rep anyway. But, if it's the "thanks" or "rep" that you are after, well here:

ap0calypse, thanks for your help, have some rapzors.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I didn't ignore your idea, but I asked for it to be presented in GUI since:

"Or you could add the unit to a unit group, then check whether the dying unit is in the unit group = true.
If it's true, he has the buff, if it's false, he doesn't.

Of course, you need to remove the unit from the unit group once the 10 seconds are over :p
"

-didn't really help me (I said I wasn't very good at triggering, so I could not understand what you where saying)

But Adiktuz gave me a good picture of what should I do... that is all.

The thread should be over, but you just seem to keep on posting what seems to me like bitching for me not acknowledging your idea. I am aware that you helped, but I didn't think it was that big of a deal if Adiktuz gets my thanks, you are full 'o' rep anyway. But, if it's the "thanks" or "rep" that you are after, well here:

ap0calypse, thanks for your help, have some rapzors.

My first post actually was literally what I said: I wanted to thank Adiktuz...
Some people give rep, some people do not, that's just how it is.
 
Status
Not open for further replies.
Top