3 abilities, 2 Trigger questions and a Random trigger.

hopy

Active Member
Reaction score
64
Well as always I've saved all my questions for one threat to save some spam on the forums. (Not that you will realy notice it).

I'll edit this post every time a question is awnsered to show that I've got my awnser and add the solutions to the question in case someone else has the same problem later.

I apologize for the many grammer and spelling errors in this post, english is not my main language and although I tried my best to make as few mestakes as posible but it's far from perfect, so if you're bored and good at english please let me know if I made a mestake and I'll try to learn from it and remember it.


Question one: Anger ability - Fixed, thank you. :).
Well then, the first problem is about an ability called Anger:
Angers a unit causing it to go into rage giving it more attack power. This unit will attack both friendly and enemy players.

Trigger:
  • Anger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Anger [Mediator]
    • Actions
      • Set Angry_Unit = (Target unit of ability being cast)
      • Set Point = (Position of Angry_Unit)
      • Unit - Create 1 Dummy Unit for (Owner of Angry_Unit) at Point facing Default building facing degrees
      • Unit - Add Anger [Dummy] to (Last created unit)
      • Unit - Set level of Anger [Dummy] for (Last created unit) to (Level of Anger [Mediator] for (Triggering unit))
      • Unit - Order (Last created unit) to Orc Shaman - Bloodlust Angry_Unit
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • For each (Integer A) from 1 to (6 + ((Level of Anger [Mediator] for (Triggering unit)) x 3)), do (Actions)
        • Loop - Actions
          • Set Unit_Group = (Units within 700.00 of Angry_Loc matching ((((Matching unit) is A structure) Not equal to True) and ((((Unit-type of (Matching unit)) Not equal to Gold Mine) or ((Unit-type of (Matching unit)) Not equal to Dummy Unit [Anti Magic Field])) and ((Unit-type of (
          • Unit Group - Pick every unit in Unit_Group and do (Actions)
            • Loop - Actions
              • Set Random_Unit = (Random 1 units from Angry_Group)
              • Unit Group - Pick every unit in Random_Unit and do (Unit - Order Angry_Unit to Attack (Picked unit))
              • Custom script: call DestroyGroup( udg_Random_Unit )
          • Custom script: call DestroyGroup (udg_Unit_Group)
          • Wait 1.50 seconds
      • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at Point facing Default building facing degrees
      • Unit - Order Angry_Unit to Stop


Anger [Mediator] is a Custom ability based on Frost Nova, it adds a buff to the unit, deals no damage and has no AoE (0) and the targets allowed are: air,enemies,friend,ground,neutral,non-hero,organic.
Anger [Dummy] is a Custom dummy ability based on Bloodlust and just increases attack and movement speed.

- Angry_Unit is a Unit Variable
- Point is a point variable (O'rly?)
- Unit_Group is a unit group variable (I'm so original with names).
- Random_Unit is also a unit variable I believe

The effect: Everyone gets the Anger buff, even though the AoE is 0, I should base it on a different ability but I think there was a reason I based it on Frost Nova.
After everyone suddenly is pissed off because of an Anger debuff they don't do what they're told and just attack their enemies.

I've only tested it on Computer players and Neutral Hostile so far, but it's supposed to work against those as well.

The awnser:


Question 2: Rapid Killing - Fixed, Thank you.
This ability does something like:
Allows the Archer to hit up to 3 targets at once on attack as well as get bonuses from elemental attacks for a short duration. - Fire deals 10% more damage. - Ice has 20% more ranged and a 0.5 second shorter Cool Down. - Nature can hit an aditional target.

In short: Switches between a different type of a custom Barrage afther every shot.

Trigger:
  • Rapid Killing
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rapid Killing [Archer]
    • Actions
      • Set Rapid_Killing[1] = Rapid Killing [Nature]
      • Set Rapid_Killing[2] = Rapid Killing [Ice]
      • Set Rapid_Killing[3] = Rapid Killing [Fire]
      • Wait (10.50 + (3.00 x (Real((Level of Rapid Killing [Archer] for (Triggering unit)))))) game-time seconds
      • Unit - Remove Rapid Killing [Nature] from (Triggering unit)
      • Unit - Remove Rapid Killing [Ice] from (Triggering unit)
      • Unit - Remove Rapid Killing [Fire] from (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Else - Actions

Trigger:
  • Rapid Killing Attack
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) has buff Rapid Killing ) Equal to True
    • Actions
      • Wait 1.90 game-time seconds
      • Unit - Remove Rapid Killing [Nature] from (Triggering unit)
      • Unit - Remove Rapid Killing [Ice] from (Triggering unit)
      • Unit - Remove Rapid Killing [Fire] from (Triggering unit)
      • Set Interger = (Random integer number between 1 and 3)
      • Unit - Add Rapid_Killing[Interger] to (Attacking unit)
      • Unit - Set level of Rapid_Killing[Interger] for (Attacking unit) to (Level of Rapid Killing [Archer] for (Attacking unit))


Rapid Killing [Archer] is a custom ability based on Berserk because: It's a self cast instant ability that adds a buff and in Rapid Killing's it's first design it also increased attack speed by 50%, even though I doubt that'll work with Barrage for it has a cooldown.
Rapid Killing [Nature]/[Fire]/[Ice] are all based on Barrage only with a different missile animation and some different stats.
Rapid_Killing[] is an ability array variable thingy.
Interger is an ... you get 3 guesses. :D

(Now that I read the trigger again after some time, does the (Triggering Unit) still work after the wait?).

Anyways, I see multiple and sometimes all three of the missile animations at once, so I thought she had all the abilities at once. I tested it and turns out the barrage abilities don't get removed until the duration is over. Can anyone see what's causing that?

(And yea the Ability variables are normally set at Map Initialization or however you'd spell that but I added them to this trigger for now to make it easier to post).


Question 3: Multi Shot - Still need some help please.

Well not hard to guess but it's basically: Fire a custom dummy ability at 3 targets at once for one shot.

Now what I wanted to ask was: Is it possible to make sure that the dummy abilities are only fired at targets in front of the Archer? I know I've seen a backstab ability a long time ago and I think this would the same way but I'm not sure how this can be triggered, so I would appreciate it if someone could give me a hint or two. :)

The Question: How do I make sure only units in front of the casting units are selected (in a Unit Group).


Question 4: A unit is attacked events - Fixed, Thank you.
Today I read somewhere that the 'A unit is attacked' event is bugged and can somehow be triggered multiple times by holding the Stop button or something like that... I don't know if that's true so I wanted to ask:
- Is this true?
- How do I prevent people from using it?
- Is it important that I prevent this?

The awnser:
"A unit is attacked" event triggers when something starts its attack on a unit. Let me elaborate the stages of attacking:
Order -> Get in Range -> Start attack with animation -> Projectile Trajectory (if any) -> Damage

So essentially the event fires off at the "Start attack with animation" stage, rather than the damage stage. So lets say someone does this:

Start attack with animation -> Someone taps "S", ordering the unit to stop its attack and canceling the attack -> No attack + No damage dealt.
So here, the attack didn't really happen fully, but whatever triggers you make with that event will still run....so it can be abused.

So the solution is a Damage Detection System. A system that tracks damage dealt instead of the attack orders. Here's Weep's GUI Friendly Damage Detection System.

Question 5: Waits in Loops - Fixed, Thank you. :)
Well, someone told me once that Waits in loops don't matter, but that stuff like (Target unit of ability being cast) can get overwriten. Well afther not using my editor for a while and afther an update suddenly alot of abilities started to bug that worked perfectly befor, afther some inspecting I found out that all of these triggers used a loop with a wait in it.

(This could also be the reason Question 1 doesn't work?).

An example of such a trigger is:
Trigger:
  • Triple Slash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Triple Slash [Blade Master]
    • Actions
      • Set TS_Hero = (Triggering unit)
      • Set TS_Target = (Target unit of ability being cast)
      • Set TS_Damage2 = (24.00 + ((Real((Hero level of TS_Hero))) + (((Real((Level of Command Aura [Blade Master] for (Triggering unit)))) x 10.00) + ((Real((Level of Triple Slash [Blade Master] for TS_Hero))) x 5.00))))
      • Unit - Pause (Triggering unit)
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Animation - Change FlS_Caster's animation speed to (110.00 + ((Real((Level of Triple Slash [Blade Master] for TS_Hero))) x 20.00))% of its original speed
          • Special Effect - Create a special effect attached to the origin of Omni_Caster using Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
          • Animation - Play TS_Hero's attack slam animation
          • Special Effect - Destroy (Last created special effect)
          • Unit - Cause TS_Hero to damage TS_Target, dealing TS_Damage2 damage of attack type Hero and damage type Normal
          • Wait (0.90 - ((Real((Level of Triple Slash [Blade Master] for (Triggering unit)))) x 0.10)) seconds
      • Animation - Change FlS_Caster's animation speed to 100.00% of its original speed
      • Unit - Unpause (Triggering unit)


This one used to work perfectly but since last time it only plays his slam animation once...

So I would like to get an clear awnser to this question now: Do waits in loops cause it to bug or not? I've asked this before, multiple times in fact, and everytime people told me something different. xD

The awnser:

At first, I need to tell something.It seems you are using integer A with all your triggers, but while using an integer A loop with wait, if another trigger use it too, bad things can happen :p Because there is no difference between integer A and an integer variable.

Some retards say "waits doesn't work inside loops, don't use them".No they are working fine with integer loops.But the only problem is, you can't use (target unit of ability being cast) after a wait.But it doesn't matter since you put him inside a variable.


Question 6: The Most Important One: Random Command - Still need some help please.
Well since some of my abilities ain't MUI and I personally prefer everyone to have a different hero I tried to make every hero only be selectable once. This all worked fine until I tried to make a random trigger. The random trigger works fine but the heroes are still pickable after that.

The Normal Hero pick Trigger:
Trigger:
  • Blade Master
    • Events
      • Unit - A unit enters Hero Blade Master <gen>
    • Conditions
      • Hero[1] Equal to 0
      • (Unit-type of (Triggering unit)) Equal to Wisp [Hero pick]
    • Actions
      • Set Hero[1] = 1
      • Set Player[1] = (Owner of (Triggering unit))
      • Animation - Change Blademaster 0185 <gen>'s vertex coloring to (15.00%, 15.00%, 15.00%) with 50.00% transparency
      • Set Point = (Center of Start Lokation <gen>)
      • Unit - Create 1 Blademaster for (Owner of (Triggering unit)) at Point facing Default building facing degrees
      • Game - Display to (All players matching (((Matching player) is an ally of (Owner of (Triggering unit))) Equal to True)) the text: (|cffff0000A player has chosen: |r + ((Name of (Last created unit)) + .))
      • Selection - Select (Last created unit) for (Owner of (Last created unit))
      • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Start Lokation <gen>) over 0.00 seconds
      • Unit - Remove (Triggering unit) from the game
      • Sound - Play Sound[1] at 100.00% volume, attached to (Last created unit)
      • Hero - Create Potion of Healing start and give it to (Last created unit)
      • Hero - Create Potion of Healing start and give it to (Last created unit)
      • Hero - Create Potion of Healing start and give it to (Last created unit)
      • Game - Display to (All players matching (((Matching player) is an ally of (Owner of (Triggering unit))) Equal to True)) the text: Blademaster. Thoug...
      • Custom script: call RemoveLocation (udg_Point)

Hero[] is an Intreger array variable, this one is used to check if the hero is still avalible.
Player[] is a player array variable, this is used in a different trigger so it's not realy important here.
Point is a ... point!
Sound[] is an sound array variable set in the next trigger:

The Variable set trigger... ?
Trigger:
  • Intialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Sound[1] = HeroBladeMasterReady1 <gen>
      • Set _Total_hero = 25
      • Set _Random_Count = 25
      • Set _Random_Array[1] = Blademaster
      • For each (Integer A) from 1 to 25, do (Actions)
        • Loop - Actions
          • Set _Random_Data[(Integer A)] = (Integer A)

(Repeat the Sound[] x25 with different sounds and numbers as well as the Random_Array[] x25 for all the heroes).

The Random Trigger:
Trigger:
  • Random Command
    • Events
      • Player - Player 1 (Red) types a chat message containing -random as An exact match
    • Conditions
      • (Number of units in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
    • Actions
      • Set _Random_Hero = (Random integer number between 1 and _Random_Count)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Hero[_Random_Data[_Random_Hero]] Equal to 0
        • Then - Actions
          • Set Point = (Center of Start Lokation <gen>)
          • Unit - Create 1 _Random_Array[_Random_Data[_Random_Hero]] for Player 1 (Red) at Point facing Default building facing degrees
          • Game - Display to (All players matching (((Matching player) is an ally of (Owner of (Triggering unit))) Equal to True)) the text: (A player has chosen: + ((Name of (Last created unit)) + .))
          • Selection - Select (Last created unit) for (Owner of (Last created unit))
          • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Start Lokation <gen>) over 0.00 seconds
          • Set _Random_Data[_Random_Hero] = _Random_Count
          • Set _Random_Count = (_Random_Count - 1)
          • Custom script: call RemoveLocation (udg_Point)
          • Set Hero[_Random_Data[_Random_Hero]] = 1
          • Set Player[_Random_Data[_Random_Hero]] = (Owner of (Triggering unit))
          • Hero - Create Potion of Healing start and give it to (Last created unit)
          • Hero - Create Potion of Healing start and give it to (Last created unit)
          • Hero - Create Potion of Healing start and give it to (Last created unit)
          • Sound - Play Sound[_Random_Data[_Random_Hero]] at 100.00% volume, attached to (Last created unit)
        • Else - Actions
          • Set _Random_Hero = (Random integer number between 1 and _Random_Count)
          • Trigger - Run (This trigger) (checking conditions)

(Does that condition leak?)

Anyways, my plan for this Random Trigger is check if Hero[Random Number set in Random_Hero] is still available, if not it will run the trigger again and roll a different number until an available number is rolled.

After that it does what the normal trigger also does and sets Hero[_Random_Data[_Random_Hero]] = 1 so that should make that number unavailable in the normal trigger (Condition: Hero[1] Equal to 0)

At first I thought that I used the wrong number variables and that I made a wrong hero unavailable but I could still pick every other hero...

So basically everything seems to work (although I'm not sure if the sound works) exept for the Set Hero[blahblah] = 1...

Can someone see what's wrong here?
(I used http://world-editor-tutorials.thehel...n.php#triggers for my random trigger and edited it a bit).


Anyways, +rep for any solved question and thanks in advance.
I will reply as soon as possible with the results of tests and such, but it takes some time to load everything on my map.

And even though I did my best to make everything as detailed as posible let me know if you need any more information or if I forgot to mention anything.

~Antisora
 

Jedi

New Member
Reaction score
63
Please don't save your questions next time =) I will try to answer others late, but question 4 seems short.

A unit is attacked event fires when a unit attemp to attack, I mean when an archer hold is bow to attack enemy, event fires.But for melee heroes, this problem is not that big.(etc barathum greater bash, rikimaru backstap seems use this event and there is not a big problem)

This is not a BUG, as event said, this is ATTACK EVENT.
 

hopy

Active Member
Reaction score
64
Haha I'm sorry. :p I thought it would be easier for people this way.

Anyways.. So basicly if I'd press stop every time it's about to attack you can trigger something without triggering a cooldown on the attack.

How important is it to prevent this? And.. how do I prevent this?
 

sentrywiz

New Member
Reaction score
25
This is one hell of a long thread... and I got this feeling in my gut I need to scroll as down as I can as fast as possible to see how long it is. And its long...

Will try to read it, and not get bored :p


1)


What happens: Everyone gets the Anger buff, even though the AoE is 0, I should base it on a different ability but I think there was a reason I based it on Frost Nova.
Afther everyone suddenly is pissed off because of an Anger debuff they don't do what they're told and just attack their enemies.

Is there a problem in the trigger you posted (the one that doesn't work) or you didn't make the other where enemies who get Anger Debuff do shitty random chaotic things?

2)


Ook... I don't know the Barrage ability, was that a demolition tank's ability for hitting multiple air units?

3)


I followed a GUI tutorial once about Backstab but it didn't work or I messed up somewhere. Unlikely me.
Sure it can be done unit is either:

-Infront of the Archer
-OR NOT behind the Archer

I think that sounds logical, as in two ways to make the spell. Find a backstab ability, snuff it a little then just put NOT EQUAL in boolean. Or make the whole thing yourself...


4)
Oh its very abusing. Example, you make an unfair spell and give it to some poor shmoe unit like a peasant. The example stands that on attack, if the attacked unit has the example spell, he will gain 10 life. Just example, stay with me here. Now this is where abusing gets:

-An attack doesn't need to be completed for spell to work
-An attack can be missed and cause spell to work (I only think, haven't tested)
-A stopped attack manually or otherwise will also trigger the effect

Now imagine a Footman attacking the Peasant. Hit one, he swings the sword, peasant gets healed... but because there is nothing to heal and the attack lands after the heal, the peasant gets no heal and only damaged the first time. After that, because he lost some health, he will get healed before the attack. This is somewhat ok, because if he would die from an attack, the spell will heal micro seconds before that attack occurs. That is why its bugged and abusing.

I'm not sure how to prevent this. Use Jass's damage system rather than GUI attacking unit? I know I will, once I learn Jass.


5)
Well, waits in loops don't happen for me. I have older non-patched version of Warcraft but I can't use waits in loops and hope for them to work. They don't... the editor SKIPS the part where the loops is and if there is no end to the trigger after the loop, trigger doesn't end at all.

So I CAN'T really say this is for everyone, but waits in loops don't work for me.


6)
In the actions of the first trigger, put "Turn off this trigger" and don't place it anywhere else. Its the first thing to run.
It runs again because you haven't disabled the event. Another unit can go into that region and get blademaster, even though you removed the unit from "showing" but your region still applies. That is why you can turn off the trigger at the start to prevent further activation. And this is only for units that walk into the region.

For your random trigger, you need to turn it off for the player that wrote -random. I'll give you my stroke of genius right now, because I thought of this but I'm not sure it will work or that it is correctly chosen, as I only made it this minute.

Trigger:
  • Player Group - Pick every player in (All players matching ((Triggering player) Equal to Player 1 (Red))) and do (Trigger - Turn off (This trigger))


As I said, to this problem so that a player cannot random more than once this might work but might also not. I'm sure there is a better way, but this is all I got for that random trigger.
 

Jedi

New Member
Reaction score
63
At first, I need to tell something.It seems you are using integer A with all your triggers, but while using an integer A loop with wait, if another trigger use it too, bad things can happen :p Because there is no difference between integer A and an integer variable.

Question 5
Some retards say "waits doesn't work inside loops, don't use them".No they are working fine with integer loops.But the only problem is, you can't use (target unit of ability being cast) after a wait.But it doesn't matter since you put him inside a variable.

Question 1
Are you sure about Random_Unit is a unit variable, you are picking every unit in Random_Unit :D

Edit:How can I add a map =)
http://rapidshare.com/files/406095905/Angry.w3x
 

hopy

Active Member
Reaction score
64
Alright, once again I'm very sorry for posting all of it in one post, I'll cut it into multiple posts next time. :p

And thank you both for the replies.

-Infront of the Archer
-OR NOT behind the Archer

Right, I'll search for a backstab trigger than. :p


-An attack doesn't need to be completed for spell to work
-An attack can be missed and cause spell to work (I only think, haven't tested)
-A stopped attack manually or otherwise will also trigger the effect

D: Evilness, lazy Blizz not adding a "Unit gets damaged" event or something.
I found this thing called a GDD (GUI Damage Detection) It's supposed to track damage done and stuff... I'll see if I can figure out how it works and how to use it.


Well, waits in loops don't happen for me.
Some retards say "waits doesn't work inside loops, don't use them".No they are working fine with integer loops.But the only problem is, you can't use (target unit of ability being cast) after a wait.But it doesn't matter since you put him inside a variable.

<,< xD As always. :D Although since that trigger (And the other triggers using waits in loops) used to work for me I think Jedi is right on that one.
Even though I'm still not realy sure how to fix that trigger in that case.

In the actions of the first trigger, put "Turn off this trigger" and don't place it anywhere else. Its the first thing to run.
It runs again because you haven't disabled the event. Another unit can go into that region and get blademaster, even though you removed the unit from "showing" but your region still applies. That is why you can turn off the trigger at the start to prevent further activation. And this is only for units that walk into the region.
Well for that I used
Trigger:
  • Conditions
    • Hero[1] Equal to 0

Trigger:
  • Set Hero[1] = 1

Trigger:
  • Set Hero[_Random_Data[_Random_Hero]] = 1

Even though I should've done that using Booleans rather than an Intreger it should both use. Since a Boolean is a 0 or a 1 anyways. :p

At first, I need to tell something.It seems you are using integer A with all your triggers, but while using an integer A loop with wait, if another trigger use it too, bad things can happen :p Because there is no difference between integer A and an integer variable.
Edit: Never mind just noticed the For each (Integer AngryInteger) from 1 to 6, do (Actions) in your trigger. :p
Thank you. :)

Or would that still cause the loop to stop when another loop is started?

Are you sure about Random_Unit is a unit variable, you are picking every unit in Random_Unit :D
Ehm, yea you're right. :p I made most of this threat from my head and I don't remember every variable, I made a mestake it seems. :p


Perfect! Thank you very Much!

+rep to the both of ye. :)
 

hopy

Active Member
Reaction score
64
BUMP...

Still haven't got everything awnsered yet... sorry for the long post but just ... read one question and awnser that one...
 

Moridin

Snow Leopard
Reaction score
144
Could you update the first post telling us which questions have been answered and which questions have not?(Edit: I just realised you've done this already) Also specify which part you need more elaboration on. Otherwise if we want to answer your queries we need to read through your gigantic post + all the replies :p....which is pretty daunting.

Question 4: A unit is attacked events - Still need some help please.
Today I read somewere that 'A unit is attacked events' are bugged and can somehow be triggered multiple times by holding the Stop button or something like that... I don't know if that's true so I wanted to ask:
- Is this true?
- How do I prevent people from using it?
- Is it important that I prevent this?

"A unit is attacked" event triggers when something starts its attack on a unit. Let me elaborate the stages of attacking:

Order -> Get in Range -> Start attack with animation -> Projectile Trajectory (if any) -> Damage

So essentially the event fires off at the "Start attack with animation" stage, rather than the damage stage. So lets say someone does this:

Start attack with animation -> Someone taps "S", ordering the unit to stop its attack and canceling the attack -> No attack + No damage dealt.

So here, the attack didn't really happen fully, but whatever triggers you make with that event will still run....so it can be abused.

For ex: If we have a trigger that gives a unit extra damage per "attack", we don't want someone to be able to do imba damage by spamming attack orders and stop orders. However, if we use this event, that's exactly what will happen.

---- Alright, now that I've detailed what it is and how it can be exploited, I'm going to tell you how to "fix" this problem----

Note: You might not want to fix it at all. It really depends on your spell/triggered ability. Most of the time you want the unit to fully attack, which is why people say that the original event "bugs" up. In truth, it isn't buggy. It's just meant to do something slightly different from what we want.

So the solution is a Damage Detection System. A system that tracks damage dealt instead of the attack orders. Here's Weep's GUI Friendly Damage Detection System.

You can make you own rough system as well. Essentially, there is the event "Unit - A unit takes damage" in Specific unit events, not generic unit events. We enable this for all units by using this action:

Trigger - Add Event to Trigger

...to give that specific event for a specific unit to a certain trigger where you want damage detection. Essentially you detect and collect all the units in the map (or entering the map later) and then make an event for each unit. :)
 

hopy

Active Member
Reaction score
64
Thank you very much for your post Moridin, it was clear and I learned from it. :)

I had a look at that Damage detection and I'm not 100% sure how to import it and use it in a trigger but I'll try to figure that one out.

Thanks again, now I finaly know how, were to fix it. +rep

I think I found out why Rapid Killing (Question 2) didn't work as well...
I had:
Trigger:
  • Unit - Remove Rapid Killing [Nature] from (Triggering unit)

And Triggering unit should've been Attacking Unit... quite the dumb mestake and I should've seen that ages ago. Sorry.

I updated my post and it should be a bit more readable now. Only question that I realy need awnsered is 6 now.

By the way Moridin, were did you get your name from? One of my friends has a Death Knight called Morridin and I believe he got that name from a book. :p
 

Moridin

Snow Leopard
Reaction score
144
By the way Moridin, were did you get your name from? One of my friends has a Death Knight called Morridin and I believe he got that name from a book.
Reply With Quote
I got the name Moridin from a book as well :p. It's called the Wheel of Time. It just kinda stuck after I started using it. If you see a Moridin or a Moridin239 (especially the 239) it's me.

---Comments on Question 6---

(Does that condition leak?)
If you mean this: "Hero[_Random_Data[_Random_Hero]] Equal to 0"
Answer: No it doesn't leak.

"Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Start Lokation <gen>) over 0.00 seconds"
This action in the first trigger leaks a point. You should use the Point variable you have set earlier.

------------------------I think this is why your trigger doesn't work:-----------------------------

In the trigger (Initialization) you have the actions:
Trigger:
  • For each (Integer A) from 1 to 25, do (Actions)
    • Loop - Actions
      • Set _Random_Data[(Integer A)] = (Integer A)


This sets the "_Random_Data[]" variable array to numbers from 1 to 25, depending on Integer A.

Now over here, in the trigger "Random Command" you have the condition:

Trigger:
  • Hero[_Random_Data[_Random_Hero]] Equal to 0


...which will never satisfy itself (never return true) because in the earlier trigger Integer A is never 0.
 

hopy

Active Member
Reaction score
64
I see, we got the name from the same book, a pretty awesome book. :D
I'm currently reading book 3, but the friend I was talking about read all 12/13 of them.

"Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Start Lokation <gen>) over 0.00 seconds"
This action in the first trigger leaks a point. You should use the Point variable you have set earlier.

And yet another dumb mestake... Thank you for pointing that one out.

And the condition I ment for the leak was:
(Units owned by (Triggering player) matching (((Matching unit) is A Hero)
Since it's a unit group.

This sets the "_Random_Data[]" variable array to numbers from 1 to 25, depending on Integer A.

Now over here, in the trigger "Random Command" you have the condition:

Trigger:
  • Hero[_Random_Data[_Random_Hero]] Equal to 0


...which will never satisfy itself (never return true) because in the earlier trigger Integer A is never 0.

Wait...
Step by step:
- Set _Random_Hero = 1 (example - Random number 1-25)
- If Hero[1[1]] = equal to 1

Because
Set _Random_Data[(Integer A)] = (Integer A)

So the number in Random_Data is equal to it's Array, because Random_Data[1] = 1
Random_Data[2] = 2
Random_Data[3] = 3
etc

So if Random_Hero is 1, Random Data becomes Random_Data[1] and Random_Data[1] is 1. So Hero[1] ?

And I think that Random_Data prevents the same units from being picked again.
 

Kling[o]

New Member
Reaction score
7
Question 3: Multi Shot - Still need some help please.

Well not hard to guess but it's basicly: Fire a custom dummy ability at 3 targets at once for one shot.

Now what I wanted to ask was: Is it posible to make sure that the dummy abilities are only fired at targets in front of the Archer? I know I've seen a backstab ability a long time ago and I think this would the same way but I'm not sure how this can be triggered, so I would appriciate it if someone could give me a hint or two.

The Question: How do I make sure only units in front of the casting units are selected (in a Unit Group).

Simply make a point offset infront of the caster and make a unit group which pick people around that point.
 

Moridin

Snow Leopard
Reaction score
144
Wait...
Step by step:
- Set _Random_Hero = 1 (example - Random number 1-25)
- If Hero[1[1]] = equal to 1

Because
Set _Random_Data[(Integer A)] = (Integer A)

So the number in Random_Data is equal to it's Array, because Random_Data[1] = 1
Random_Data[2] = 2
Random_Data[3] = 3
etc

So if Random_Hero is 1, Random Data becomes Random_Data[1] and Random_Data[1] is 1. So Hero[1] ?

And I think that Random_Data prevents the same units from being picked again.

Oh Right! woops. I didn't see that you were using the Hero[] array. One thing though, couldn't you have just used:

Hero[_Random_Hero]

? Because the array _Random_Data[] will return the value of whatever _Random_Hero was, so you're just using a (seemingly) useless variable call?

------------------------
Also, I realise that when the trigger is run again manually using the Trigger - Run trigger command, you have lost your "Triggering Player". I would suggest using 2 variables to solve this:

Current_Player - Player variable
Random_Index - Boolean variable

Essentially, you store the Triggering Player in Current_Player and if you have to run the trigger again manually you set the Random_Index = True. That way you use the stored variable instead of failing to call (Triggering Player). Likewise, when a hero is finally picked for that player, you need to set the boolean back to false...so the trigger runs as normal. Don't worry about it not being MUI, because its instant.

-------------
Another note: You can debug your triggers yourself to see whats going wrong by putting "Game - Text message" actions in the middle. This would allow you to see exactly where the trigger is acting till, or how its acting up, from within game.
 

hopy

Active Member
Reaction score
64
Simply make a point offset infront of the caster and make a unit group which pick people around that point.

Now that's something I haden't tought of yet, I was thinking about a unit group conditions with angels and stuff.

One thing though, couldn't you have just used:
Hero[_Random_Hero]

I'm not sure why that's there either to be honest. Got the main part of the trigger from: http://world-editor-tutorials.thehelper.net/herotavern.php#triggers .

But I think it has something to do with:
Set _Random_Data[_Random_Hero] = _Random_Count
That way Random_Data[1] (example) = 25 ... ?
So than...
Set Hero[_Random_Data[_Random_Hero]] = 1

Becomes: Hero[25] ?

That's realy confusing... I never liked this trigger. xD

Also, I realise that when the trigger is run again manually using the Trigger - Run trigger command, you have lost your "Triggering Player".

Ah, I'll fix that right away.

QUOTE
Another note: You can debug your triggers yourself to see whats going wrong by putting "Game - Text message" actions in the middle. This would allow you to see exactly where the trigger is acting till, or how its acting up, from within game.
I have tried that before but it didn't help me to figure out what was wrong... atleast I do know in what area the problem lies (Random_Data?) so I'll try again focussing on that one.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top