Trigger not working

smileyguyx

Member
Reaction score
1
Trying to make a trigger so when a specific unit (randomly picked from a group and spawned) dies it will give a specific effect
i tried this trigger but it doesn't work:
Trigger:
  • Events
    • Unit - A unit owned by Player 11 (Dark Green) Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to EXPLOSION Power Up
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Unit - Add Explosion to Dodger 0003 <gen>
      • Unit - Order Dodger 0003 <gen> to Human Blood Mage - Flame Strike TempPoint
      • Unit - Remove Explosion from Dodger 0003 <gen>
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
base your abilities off the spawn hydra ability, which is casted on death
make a few different abilities if you want to have multiple affects
then
Trigger:
  • Special Death
    • Events
      • A unit casts an ability
    • Conditions
      • Ability cast is equal to (your abil)
    • Actions
      • set Temp_Point[1] = Position of casting unit
      • Unit - Create 1 Dummy Unit at Temp_Point[1] for owner of casting unit facing default building facing degrees (dummy unit should be one that u make that is invulnerable and has a blank model, for a blank model make a .txt file, erase the txt and put mdx, then import it into your map)
      • Unit - Add an expiration timer to Last created unit for 5.0 seconds
      • Unit - Add (Ability you are casting) to last created unit
      • Unit - Order last created unit to (Order String) at position Temp_Point
      • Custom Script: call RemoveLocation(udg_Temp_Point)
 

smileyguyx

Member
Reaction score
1
the spawn hydra skill only has 2 data slots-number of units spawned and unit type...
how do you add extra datas to it, or how do you base it off the "spawn hydra" skill?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
you remove the units that it creates, and just create a shell of a spell out of it, then you can create as many copies as you want and differentiate between them when they are casted... get it?
 

smileyguyx

Member
Reaction score
1
so i use the spell as a trigger to use a different spell?
I can't find exact matches so is this right:
Trigger:
  • Events
    • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Dummy Spell 1
    • Actions
      • Set TempPoint = (Position of (Casting unit))
      • Unit - Create 1 Dummy for (Owner of (Casting unit)) at (Center of (Playable map area)) facing Default building facing degrees
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Explosion to (Last created unit)
      • Unit - Order (Last created unit) to Human Blood Mage - Flame Strike TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)

Also the spell "explosion" is based of kael's flame strike is that casing problems?
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
All you have to do is create a dummy unit with Locust and the Flame Strike model. Put that unit into the Spawn Hydra ability and add the ability to the powerup. When the powerup dies, it should create one of the dummy units at its position, which will then play the Flame Strike explosion animation.
 

smileyguyx

Member
Reaction score
1
GFreak45, i tried your trigger (using what i believe to be the most similar options available) but i still cant get it to work (to have it so when the unit dies the effect happens) though it seems to have worked very rarely
KaerfNomekop what do you mean by "locust"? is it a skill? a model?
ive attatched my map so please can you fix it (anyone..?)
 

Attachments

  • Dodgeball.w3x
    48.1 KB · Views: 232

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
locust is the ability that the "locusts" from locust swarm have, it is an ability that renders the unit invulnerable and unclickable
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
You seem to have misunderstood. Spawn Hydra is a passive ability, meaning that the ability is never "cast". What it does is that it spawns a unit, so there was no need to create another unit in the trigger either. My suggestion was that you add the Locust ability to the spawned unit-type, so that it looks just like an effect.

Here's the updated version. I just deleted some dummies, changed a bit of the abilities and the triggers in the Activate Spells category. Everything else is untouched.
 

Attachments

  • Dodgeball 2.w3x
    47.9 KB · Views: 233

XeRo13g

New Member
Reaction score
3
Trying to make a trigger so when a specific unit (randomly picked from a group and spawned) dies it will give a specific effect
i tried this trigger but it doesn't work:
Trigger:
  • Events
    • Unit - A unit owned by Player 11 (Dark Green) Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to EXPLOSION Power Up
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Unit - Add Explosion to Dodger 0003 <gen>
      • Unit - Order Dodger 0003 <gen> to Human Blood Mage - Flame Strike TempPoint
      • Unit - Remove Explosion from Dodger 0003 <gen>

If you only need the effect, just use special effects.
Trigger:
  • Events
    • Unit - A unit owned by Player 11 (Dark Green) Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to EXPLOSION Power Up
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_TempPoint)


If you need an actual ability to be cast, you better use a dummy unit. Your trigger may not be functional due to several reasons like: Dodger 0003 is out of the range, doesn't have enough mana due to other casts or it's initial value and so on. Also, you must make sure that no trigger gives an immediate order to the dummy as it enters the region around the dying unit.

Trigger:
  • Events
    • Unit - A unit owned by Player 11 (Dark Green) Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to EXPLOSION Power Up
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Unit - Create 1 Dummy for Player ?? at TempPoint facing Default building facing degrees
      • Set TempUnit = (Last created unit)
      • Unit - Add a 4.00 second Generic expiration timer to TempUnit
      • Unit - Add Flame Strike to TempUnit
      • Unit - Order TempUnit to Human Blood Mage - Flame Strike TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)


Map with the trigger and a sample Dummy unit.
View attachment DummyUnit.w3x
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
damn you have a real habit of posting on threads that were solved with the same solution or a worse one... the current one uses the hydra spawn baby hydras ability which is fired on death, and instead it summons a dummy unit... your trigger just skips the ability completely and goes straight into coding it
 

XeRo13g

New Member
Reaction score
3
… (randomly picked from a group and spawned)

Actually, I don’t quite get this part and thus I didn’t include anything in the code for it. In your initial code, you seem to use a condition for unit-type, so any unit that is “EXPLOSION Power Up” will produce the effects. If you need the effect to have randomness, just add some simple –if- statement.

Trigger:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If – Conditions
    • (Random integer number between 1 and 100) Greater than 80
      • Then – Actions
    • (Insert code here)
      • Else - Actions


damn you have a real habit of posting on threads that were solved with the same solution or a worse one... the current one uses the hydra spawn baby hydras ability which is fired on death, and instead it summons a dummy unit... your trigger just skips the ability completely and goes straight into coding it

Actually, skipping the ability and go straight into coding was my exact intention. I don’t see a reason for using that extra ability. If the solution offered by me is worse, please elaborate, don’t assume it’s obvious.

PS. Stalking my posts and trying to get back for being “told”, won’t help anyone. You only perpetuate what caused this in the first place and cause confusion to new users trying to get their questions answered.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
you did not read the full thread, the randomness is in the ability he adds to the dying unit, he can have as many copies of that ability as he wants and just add them randomly and it will work, your method was much more inefficient

PS. stalking your posts implies i havent checked every single post in the last few months, i work on the computer so i can multitask and browse the forum when i want, just because i call you on doing the same exact thing you accused me of doing when i plainly wasnt doing it
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
but it does require extra actions that arent needed and the trigger has to fire off every death and check the conditions, making it less efficient than using a simple ability, and a spawned unit event
 

XeRo13g

New Member
Reaction score
3
He will need to pick a random unit first, which requires forming a group(which should be avoided as much as possible, especially in GUI). Then add the ability to that unit and it still requires a trigger to detect if the dying unit has the ability or a unit has spawned a summoned unit(the unit spawned by the ability in question).

All these against an % chance integer condition, to a trigger that will most likely run in his map anyway.

The only reason to get into all that, is to use the ability as a flag at the creation of the unit for whatever reason and still...He can use a variable/add classification/manipulate custom value condition, to avoid the mess and extra burden and still avoid forming a group.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
what group are you talking about? there were no groups needed period for what i suggested
you keep confirming my point over and over that you did not actually read the thread, the random ability is added when the unit joins the map, the ability will create the dummy unit when the owner dies automatically, it has an automatic expiration timer built into the ability, i see no reason for a group
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
Trying to make a trigger so when a specific unit (randomly picked from a group and spawned) dies it will give a specific effect
@XeRo13G: There is no picking of a random unit. All he does is create Unit-type[(Random integer)], giving him one of (currently) 3 unit-types to be spawned. The simple step of downloading the map and opening up the trigger editor tells you this. Also, the special effect would give more trouble as the effect intended will not play if destroyed immediately. The ability makes it much easier as the effect is created instantly upon death of that specific unit-type.
 

XeRo13g

New Member
Reaction score
3
I saw the map just fine. That's why I've posted the code, including the dummy unit.

If he needs an effect, he should simply use an effect.
If he needs an ability, he should use that ability.

Using longer or split between triggers code(Manipulate created unit and then again upon death) and the burden of an extra ability(which needs to be preloaded to avoid lag spikes), is sloppy coding and should be avoided unless absolutely necessary.

The point here, is to provide aid to those who post asking, not make your solution -win-.
Please take the time to consider before posting, else you might end up causing confusion to new users who are not yet able to floccinaucinihilipilificate.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top