[Trigger] Poison Cloud Special Effects[ Need Help]

Status
Not open for further replies.
Level 2
Joined
Jan 30, 2014
Messages
12
Hi there.

I am trying to add a special effect to a hero ability called Poisoned Cloud that uses acid bomb as a base ability that does damage over time but without the armor reduction.

here is the trigger i used to make the special effect that is suposed to be kinda like mass disease cloud.

TempPos1 and 2 are point variables.
EffectCount is a string variable


Untitled Trigger 001

Events
- Unit - A unit Begins casting an ability
Conditions - (Ability being cast) Equal to Poisoned Cloud
Actions - Set TempPos1 = (Target point of ability being cast)
Set EffectCount = 0
Trigger - Turn on Untitled Trigger 002 <gen>

Untitled Trigger 002

Events
-Time - Every 0.05 seconds of game time
Conditions
Actions
-Set EffectCount = EffectCount+1
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
EffectCount Equal to 15
Then - Actions
Trigger - Turn off Untitled Trigger 002 <gen>
Custom script: call RemoveLocation(udg_TempPos1)
Else - Actions
Set TempPos2 = (TempPos1 offset by (Random real number between 0.00 and 600.00) towards (Random angle) degrees)
Special Effect - Create a special effect at TempPos2 using Abilities\Spells\Undead\PlagueCloud\PlagueCloudCaster.mdl

Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_TempPos2)

Thats what i did and it doesnt work. Could someone help me?
i spent about 5 hours just trying to do this and i was completely new to triggers and still am.
 
Level 27
Joined
Sep 26, 2009
Messages
2,485
I assume the effect PlagueCloudCaster has animations? Like birth,stand and death? If so, you cannot immediately destroy last created effect, because it will immediately play the "death" animation, which in this case is most likely the halt of any new particles.

Also, is "EffectCount" really a string variable or an integere variable?
 
Level 2
Joined
Jan 30, 2014
Messages
12
Thanks for the reply. I set effectcount as a string. Also how could i use the disease cloud for the special effect? Also the animation doesn't appear at all when i test it. This whole trigger seems to do nothing at all.
 
Level 27
Joined
Sep 26, 2009
Messages
2,485
Change the effect for e.g. Holy Light, I think this effect has no death animation. Do it only to see if the Holy Light effect appears in game. If it does appear, the problem is in the effect (that it has various animations), if it doesn't appear, the problem is in the trigger itself.


As for the effect count, imo it's easier to use integer variable :)
 
Level 2
Joined
Jan 30, 2014
Messages
12
I tried it and i changed the effectcount to integer. The holy light does work. So is there no way to add cloud effect?
 
Level 27
Joined
Sep 26, 2009
Messages
2,485
Well, there is. I can think of three options:
a) Make the cloud a unit (dummy unit to be exact) and spawn units, the downside is that the performance drops a lot faster if you have too many units clustered together

b) Leave it as an effect, but index it and periodically remove all effects from indexes X up to indexes Y, deindex the remaining and repeat. This is a more complicated approach, but it has the advantage of better performance.
(e.g., you create 5 of those effects, so the first 5 will have indexes 1-5, the next 5 will have 6-10 and so on... then you remove the first five -> move indexes of all remaining effects down by 5)

c) edit Plague Cloud effect (or better said: create your own by basing it off the original one), remove its birth and death animations. Change the duration of Stand animation to some good time (e.g. 1-2 seconds, or however long you want them in game). This is a good approach, if you know how to edit models.
 
Level 2
Joined
Jan 30, 2014
Messages
12
Ok thanks a bunch I'll try the c as it lets me keep the effect for some time without dealing with triggers.
 
Level 2
Joined
Jan 30, 2014
Messages
12
Btw can i create the effect in World Editor? Or do i need to use some other software?
 
Level 2
Joined
Jan 30, 2014
Messages
12
i am trying to extract using mpq master and then edit with war3modeleditor. will that work?
 
Level 2
Joined
Jan 30, 2014
Messages
12
this is the edited version please see if it could work. also how do i add this into ability file? i tried creating a new file called poisoned cloud in war3 file which contains all the files but i couldnt locate it in World editor.
 

Attachments

  • PlagueCloudCaster.mdx
    1.1 KB · Views: 40
Level 2
Joined
Jan 30, 2014
Messages
12
the effect is finally showing up but it doesn't stop. could you help me with that?Another thing is the effect takes place even before i cast it. that maybe the cause but not sure as holy light didn't continue on forever even though the effect appeared when i start the map.
 
Level 2
Joined
Jan 30, 2014
Messages
12
the trigger seems to be really messed up. here is the map i used. The first thing is the clouds showing up as soon as u start the game starts even though no one had cast it and the warden hasn't learnt it either.the second is that when u cast the spell once in 2 casts only 2 clouds appear. the clouds keep spawning at the same place even if targets are away.Try casting the ability on the peasant far to your north. the effect still appears where the other peasants are.
 

Attachments

  • random.w3x
    18.6 KB · Views: 51
Level 27
Joined
Sep 26, 2009
Messages
2,485
Ok, I took a look at what you posted:

- I'm not sure if you just copied those triggers in new map to post it here -- in case you didn't, then make sure you remove "Melee Initialization" trigger that comes with every new map -> it will stop spawning Town Hall with 5 peasants and showing you the "You win" dialogue window.

Problem #1
The first thing is the clouds showing up as soon as u start the game
The reason for this is that you use a periodic trigger, which fires every 0.05 seconds. The trigger is turned on by default, which is why it starts spawning those clouds right from the start of the game.
To switch off trigger, find that trigger, select it (just so you see all the Event/Conditions/Actions you put in it). Above those Events/Conditions/Actions, there is a window for comment and above this window, there are 2 "check" boxes.
* Enabled
* Initially On
--> Both of these are checked by default. However for periodic triggers, which you do not want to fire right from the start of map (like the one you have right now), you need to uncheck the "Initially On" box.
This will disable the trigger and it won't fire, unless you switch it on later, via action
  • Trigger - Turn on *Periodic trigger*
or switch it off via the "Trigger - Turn Off" action.

Problem #2
I'm not sure if it's just a choice of name or something, however I do think you misunderstand the concept of Temp variables -> or better said, Temporal Variables. To not confuse you right off the bat, it's not a special type of variable or something like that - the reason why they are called temporal variables (or tem/temp variables) is that they are created in one trigger, used in that same trigger and removed in that same trigger, without using any delays.
Warcraft executes triggers from the upper-most trigger to the lowermost one, same with actions, it will execute first the uppermost one and gradually go to the bottom most action (though of course, there are exceptions like loops, etc., but that's to be expected).

So if you do this:
  • Trigger A
  • Events
    • *Some event*
  • Conditions
  • Actions
    • Set TempPoint = *positions somewhere*
  • Trigger B
  • Events
    • *Some event*
  • Conditions
  • Actions
    • Unit - Create unit at TempPoint...
Then the "TempPoint" is not temporal variable, because what it points at (in this case, the point variable points at some location) may get overwritten before warcraft executes the Trigger B, which uses TempPoint.

Look at the example below:
  • Trigger A
  • Events
    • *Some event*
  • Conditions
  • Actions
    • Set TempPoint = *position of HUMAN King*
  • Trigger B
  • Events
    • *Some event*
  • Conditions
  • Actions
    • Set TempPoint = *position of ORC Chieftain*
  • Trigger C
  • Events
    • *Some event*
  • Conditions
  • Actions
    • Unit - Create Footman for (owner of HUMAN King) at TempPoint
As I wrote, WC executes triggers from the top-most to the bottom-most triggers. Now you set TempPoint as position of Human King (because TriggerA fires), however if for some reason TriggerB fires as well, that position will get overwritten, hence the Footman from TriggerC will be created by the enemy orc cheftain.
Mostly, if there is any chance that the variable won't be temporal, that during the game, it may get overwritten, just make it a unique variable.

Problem #3
Try casting the ability on the peasant far to your north. the effect still appears where the other peasants are.
The reason for this is simple: You incorrectly set TemPos1 variable.

A little explanation:
1) If the target of the ability is a point (example spells like that are Blizzard or Flame Strike), you need the "targeted point", hence you use this:
  • Set loc = (Target point of ability being cast)
2) If the target of the ability is a unit (e.g. Storm Bolt, Shadow Strike, ...), you need the "position of unit" to get the correct point, so you use this:
  • Set loc = (Position of (Target unit of ability being cast))
Of course the above - position of unit - is used whenever you need the location at which the unit is, so it's not limited only to target of an ability.

Acid Bomb is a spell which targets units, so you need to use the 2) method to get the correct location.
Since you used the method 1) and there was no "target point of ability being cast", it returned null, so the effects were created at offset of location at coordinates [0 , 0], which is the center of the map.

Also do note, in this event:
  • Unit - A unit Stops casting an ability
there is already no "target of ability being cast" or "target point", so it will always return null. You will need to save the target when the caster "Starts the effect of an ability", use a little delay and then spawn the clouds.

Problem #4
The next problem is the "EffectCount" variable. Your trigger will never turn off after 0,75 seconds, because "EffectCount" will never reach number 15.
String is a sequence of symbols - in fact, any symbols.

In actual game you first do this:
  • Set EffectCount = 0
Which saves inside EffectCount a string consisting of 1 symbol (in this case, the symbol is '0'). Later, you change it to to

  • Set EffectCount = EffectCount+1
which is a string consisting of 13 symbols. There won't happen any mathematical function (summation in this case), because the '+' is taken as a symbol not as a mathematical function.

So you will never get this condition as TRUE:
  • EffectCount Equal to 15
because you compare if string "EffectCount+1" is the same as string "15", which it clearly is not.

To fix this, you need an actual integer variable (integers are numbers without decimal point) and use the "arithmetic" function presented in the list. Then you need to do an integer comparison and check if the variable is equal to 15.



Do note:
Your spell is not MUI - meaning if 2 or more units cast this spell at around the same time, the spell will bug - in this case, it won't be such a big bother, I think it would create less clouds at one unit, however it may be more problematic with other spells.
 
Level 2
Joined
Jan 30, 2014
Messages
12
Thanks for going through the trouble of fixing all that. I'll implement them and give u the result
 
Status
Not open for further replies.
Top