• 🏆 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] Contangious Disease Cloud

Status
Not open for further replies.
Level 7
Joined
Dec 14, 2012
Messages
192
Hello there.

I need help with a certain Trigger. I am not the best Triggerer, so bear with my incompetence...
The Trigger is for the ability "Miasma" - an ability based on disease cloud. A Hero ability that should poison enemies around the caster, damaging them over time - and if an enemy died by Miasma dies, they should leave behind a poison cloud that afflicts further enemies with the "Contangion" debuff, another DoT.

So far, the Trigger is at least usable - however, when to Plaguebringer's(THe Hero that has Miasma) are in the game, the variable is overwritten.. I need a fix to that. Additionally, it is important to note: As the Disease Cloud ability has it hardcoded to ALWAYS apply the buff "disease"(That cannot be changed), one needs to put in a line, so that Undead do not benefit from this Trigger.

Anyway, I hope you can help little me~ Here is the trigger:


  • Miasma Setup
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Miasma
    • Actions
      • Set MiasmaCaster = (Triggering unit)
      • Trigger - Turn on Miasma Group <gen>
  • Miasma Group
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of MiasmaCaster)) Equal to True
              • (((Picked unit) has buff Disease) Equal to True) or (((Picked unit) has buff Contangion ) Equal to True)
            • Then - Actions
              • Unit Group - Add (Picked unit) to Miasma_Group
            • Else - Actions
              • Unit Group - Remove (Picked unit) from Miasma_Group
  • Miasma Cloud
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in Miasma_Group) Equal to True
    • Actions
      • Unit - Create 1 Miasma Cloud for (Owner of MiasmaCaster) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Set level of Miasma Contangion DoT for (Last created unit) to (Level of Miasma for MiasmaCaster)
      • Unit - Order (Last created unit) to Neutral Pit Lord - Howl Of Terror
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
The fix to what you want is easy, however I don't think it will get you far. The whole spell will never work efficiently if more than 1 unit in the entire game can use this spell.

If there can be multiple heroes with this ability and:
a) there is a limit that each player can control only one such unit, then the system needs to be MPI (MultiPlayer Instanceable)
b) there is no limit to how many units with this ability a player can control, then the system needs to be MUI (Multi-Unit Instanceable).

Currently, your trigger supports neither - it supports only one unit in the whole game.
So what you need to do: The MiasmaCaster variable needs to be an array - to do that, simply edit the variable in variable editor and check the "Array" box. That will make it array (leave "Size" at the default value that is set there).
If the system needs to be MPI, then you can utilize player's index number (each player has an index, which can be easily accessed via function).
If the system needs to be MUI, then you will need an integer variable for this system that saves the maximum (= last) index used by your system and you will need to utilized indexing.
Either player's index for MPI, or the index variable for MUI will serve as indexes for the MiasmaCaster array.

What you currently have also leaks locations and unit groups.

However before going into all this stuff, there is a more serious technical problem - actually, there are multiple problems.
1) I don't know if I understood what you want correctly, but Disease Cloud ability does not kill affected units - it leaves them at a minimum of 1 hp.

2) I (and some people who posted the same issue on this site) experienced problem with custom Disease Cloud buff - when I edited the buff to show different visual effect, have different icon and different description, in game the original Disease Cloud buff was applied (but dealt the damage of my custom Disease Ability spell), no matter what fields I edited in the buff and in the ability itself.

3) This is the most serious problem - how will you find out who applied the debuff on a unit? Let's say my Footman unit is affected by this Miasma debuff - but how do I find out who afflicted my footman with it? Was it Hero1? Or was it Hero2 or perhaps Hero3?
There is no way to find out who applies buff on a unit than catching when the unit actually casts the spell that applies the buff - but that is not the case with Disease Cloud.
Since Disease Cloud applies DoT, you cannot make a range check to find out who may be the possible caster like with regular auras. That's why I wrote it won't work well if the spell is supposed to work for more than 1 unit in entire game. If only 1 unit ever can cast this spell, then when you find out a unit is afflicted by the Miasma buff, you know who is the caster as well, because there is only one caster... however if there are many possible casters, you'll never know for sure who actually casted it.
 
Level 7
Joined
Dec 14, 2012
Messages
192
The fix to what you want is easy, however I don't think it will get you far. The whole spell will never work efficiently if more than 1 unit in the entire game can use this spell.

If there can be multiple heroes with this ability and:
a) there is a limit that each player can control only one such unit, then the system needs to be MPI (MultiPlayer Instanceable)
b) there is no limit to how many units with this ability a player can control, then the system needs to be MUI (Multi-Unit Instanceable).

Currently, your trigger supports neither - it supports only one unit in the whole game.
So what you need to do: The MiasmaCaster variable needs to be an array - to do that, simply edit the variable in variable editor and check the "Array" box. That will make it array (leave "Size" at the default value that is set there).
If the system needs to be MPI, then you can utilize player's index number (each player has an index, which can be easily accessed via function).
If the system needs to be MUI, then you will need an integer variable for this system that saves the maximum (= last) index used by your system and you will need to utilized indexing.
Either player's index for MPI, or the index variable for MUI will serve as indexes for the MiasmaCaster array.
So it would need to look something like this, or? Anything special I'd need to edit with the other Triggers?
  • MiasmaArray Setup
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Miasma
    • Actions
      • Set MiasmaCasterArray[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
      • Trigger - Turn on MiasmaArray Group <gen>

What you currently have also leaks locations and unit groups.

I Really need someone to teach me how to fix these things... looked at tutorials and stuff, but I always ams o unsure when I try and stop trying... Meh, I feel like I am too timid to even try. Kinda stupid, I know ~.~

1) I don't know if I understood what you want correctly, but Disease Cloud ability does not kill affected units - it leaves them at a minimum of 1 hp.
I know that, but this is fine with me. After all, the unit just needs to die while affected.

2) I (and some people who posted the same issue on this site) experienced problem with custom Disease Cloud buff - when I edited the buff to show different visual effect, have different icon and different description, in game the original Disease Cloud buff was applied (but dealt the damage of my custom Disease Ability spell), no matter what fields I edited in the buff and in the ability itself.
Hence why I check for the "Disease Cloud" debuff. I noticed this nuisance already - but at least it damages appropriate.


3) This is the most serious problem - how will you find out who applied the debuff on a unit? Let's say my Footman unit is affected by this Miasma debuff - but how do I find out who afflicted my footman with it? Was it Hero1? Or was it Hero2 or perhaps Hero3?
There is no way to find out who applies buff on a unit than catching when the unit actually casts the spell that applies the buff - but that is not the case with Disease Cloud.
Since Disease Cloud applies DoT, you cannot make a range check to find out who may be the possible caster like with regular auras. That's why I wrote it won't work well if the spell is supposed to work for more than 1 unit in entire game. If only 1 unit ever can cast this spell, then when you find out a unit is afflicted by the Miasma buff, you know who is the caster as well, because there is only one caster... however if there are many possible casters, you'll never know for sure who actually casted it.
Well... you nailed it. This is the biggest problem. I came here to solve this, as I find the idea rather fitting to the Hero I gave it and would not want to give it up. It makes up a lot of his damage output, as the "Contangion" and Miasma's "Disease Cloud" stack, making this very deadly in extended fight.
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
The trigger you posted should work if each player controls only one such hero (else the array slot gets overwritten).

To fix leaks, you simply have to use appropriate custom script. All are listed here: http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
The only problem you may encounter is that you remove stuff that you still need and then wonder why your triggers don't work as intended.

As for what I wrote in problem 3), there is no simple fix to this - there's simply no way to effectively determine which hero affected the unit with the debuff, unless you make a very fast loop that picks all units and iterates them - however that is really inefficient and it will drop down your performance.

Another option is that you completely trigger your own Disease Cloud spell - basically that you create some kind of DoT that you apply manually via dummies on nearby units. That way you know who applied the debuff, since you are manually applying it.
 
Status
Not open for further replies.
Top