• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Fix on spell

Status
Not open for further replies.

xplicitjohn

X

xplicitjohn

As much as you will rant on how nooby my triggering skills are, ill still post for help and fix/modification.

I neeed help on when a player cast's a skill. The player,the players allies and buildings wont get hurt by the damage. And can someone help me fix the skill to make it leakless and look better? I know my triggering skills are noob so please dont rage.

And i also need fix on this as i use too many waits :/

  • Request Bomb Raid
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Request Air Strike
    • Actions
      • Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + has requested Air Strike.)
      • Wait 3.00 seconds
      • Sound - Play Warning <gen>
      • Game - Display to (All players) for 10.00 seconds the text: |cffff0000An air st...
      • Sound - Play RU_1mc_airstrike_01_R <gen>
      • Wait 10.00 seconds
      • Game - Display to (All players) for 10.00 seconds the text: |cffff0000Incoming ...
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) Invulnerable
      • Wait 3.00 seconds
      • Unit - Cause (Triggering unit) to damage circular area after 4.00 seconds of radius 4000.00 at (Center of Tower Region <gen>), dealing 500.00 damage of attack type Chaos and damage type Normal
      • Special Effect - Create a special effect at (Center of North <gen>) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at (Random point in Region 028 <gen>) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Special Effect - Create a special effect at (Random point in Region 028 <gen>) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at (Random point in Region 028 <gen>) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Special Effect - Create a special effect at (Random point in Region 028 <gen>) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at (Random point in Region 028 <gen>) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Special Effect - Create a special effect at (Random point in Region 028 <gen>) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Special Effect - Create a special effect at (Random point in Region 028 <gen>) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at (Random point in Region 028 <gen>) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at (Random point in Region 028 <gen>) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Special Effect - Create a special effect at (Random point in Region 028 <gen>) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Special Effect - Create a special effect at (Random point in Region 028 <gen>) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at (Random point in Region 028 <gen>) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Special Effect - Create a special effect at (Random point in Region 028 <gen>) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Wait 3.00 seconds
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) Vulnerable
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
You're picking players, not units.

Replace the Pick players with this:

  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
      • Set u1 = (Picked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (u1 is alive) Equal to True
          • (u1 belongs to an enemy of (Owner of (Triggering unit))) Equal to True
        • Then - Actions
        • Else - Actions
Modify the conditions if needed.

You should fix the leaks yourself for learning purposes.

http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
 

xplicitjohn

X

xplicitjohn

You're picking players, not units.

Replace the Pick players with this:

  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
      • Set u1 = (Picked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (u1 is alive) Equal to True
          • (u1 belongs to an enemy of (Owner of (Triggering unit))) Equal to True
        • Then - Actions
        • Else - Actions
Modify the conditions if needed.

You should fix the leaks yourself for learning purposes.

http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
On my original script the picked players are still getting dmged
 
You are picking every player, but you add an action which refers to a unit. When you pick a player from a player group, you will refer to the player as "Picked player". Player != unit, obviously. Picked unit would be used in a Unit Group action.
Do this:
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Tower Region <gen>) matching (((Matching unit) is a building) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit)) Equal to True) and do (Actions)
      • Loop - Actions
        • Unit - Cause (Triggering unit) to damage (Picked unit) dealing 4000 damage of Attack type Spells and Damage Type Normal
Remove the Waits, they are blocking the trigger to recognise what unit belongs to an ally of the caster or not.
You can use a timed trigger to avoid the use of waits:
  • Tr
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hashtable = (Last created hashtable)
  • Trigger2
  • Events
    • Unit - A unit Begins channeling an ability
  • Conditions
    • (Ability being cast) Equal to Request Air Strike
  • Actions
    • Set HowManyTimes = 7
    • Hashtable - Save HowManyTimes as 0 of (Key(Triggering unit)) in Hashtable
    • Unit Group - Add (Triggering unit) to AirGroup
    • Trigger - Turn on Trigger <gen>
  • Trigger
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (AirGroup is empty) Equal to False
      • Then - Actions
        • Unit Group - Pick every unit in AirGroup and do (Actions)
          • Loop - Actions
            • Set Timer = (Load 0 of (Key(Picked unit)) in Hashtable)
            • If (All conditions are true) then do (Actions) else do (Actions)
              • If - Conditions
                • Timer Greater than 0
              • Then - Actions
                • Hashtable - Save (Timer - 1) as 0 of (Key(Picked unit)) in Hashtable
                • Set Point1 = (Random point in Region 028 <gen>)
                • Special Effect - Create a special effect at Point1 using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
                • Special Effect - Destroy (Last created special effect)
                • Custom script: call RemoveLocation (udg_Point1)
              • Else - Actions
                • Unit Group - Remove (Picked unit) from AirGroup
                • Hashtable - Clear all child hashtables of (Key(Picked unit)) in Hashtable
                • Unit - Order (Triggering unit) to Stop
      • Else - Actions
        • Trigger - Turn off (This trigger)
HowManyTimes and Timer are Integer variables. The hastable action is "Hashtable - Save Integer".

For more about hashtables: http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/

Edit: Just noticed that Maker said the same thing about players.
 
Status
Not open for further replies.
Top