How to fix this.

NeuroToxin

New Member
Reaction score
46
Okay, I am making a spellpack of Soul related spells. And right now I've completed a passive spell in which all units in X range fly to the caster when they die, then they circle around him until used. After this I have a spell which selects one of them, and sends it to a unit to kill itself dealing damage. However, when I have more than one unit, then CirclingUnits[Player number of (Owner of (Triggering unit))] Does not work, as it will select a random unit from both of those, however i want it to be MUI, and Im not sure how to select the unit from the group. Attached is the map.
 

Attachments

  • Soulstealer Pack.w3x
    32.8 KB · Views: 137

Sim

Forum Administrator
Staff member
Reaction score
534
Post the code here. Some users don't have access to Warcraft 3 right now, such as me.
 

NeuroToxin

New Member
Reaction score
46
Alright, here it is, Prepare your eyes. Not sure how to do spoilers.
Trigger:
  • SenseOfTheSouls
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Caster_Value Greater than or equal to 5000
        • Then - Actions
          • Set Caster_Value = 0
        • Else - Actions
          • Set Caster_Value = (Caster_Value + 1)
      • Set Deadunit[Caster_Value] = (Triggering unit)
      • Set Deadunitloc = (Position of Deadunit[Caster_Value])
      • Set MaxRange = 2000.00
      • Set SoulCaster = (Units within MaxRange of Deadunitloc matching ((Level of Sense of the Souls for (Matching unit)) Greater than 0))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in SoulCaster) Greater than 1
        • Then - Actions
          • Unit Group - Pick every unit in SoulCaster and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Number of units in SoulCaster) Equal to 0) or ((Number of units in Circling_Units[(Player number of (Owner of (Picked unit)))]) Greater than or equal to (10 + ((Level of Sense of the Souls for (Picked unit)) x 5)))
                • Then - Actions
                • Else - Actions
                  • Set SoulMaster[Caster_Value] = (Picked unit)
                  • Set SoulMasterLoc = (Position of SoulMaster[Caster_Value])
                  • -------- Angle to move from Deadunitloc to Soulmaster --------
                  • Set Angle[Caster_Value] = (Angle from Deadunitloc to (Position of (Picked unit)))
                  • -------- --------------------------------------------- --------
                  • Unit - Create 1 DUMMY_UNIT for (Owner of (Picked unit)) at Deadunitloc facing Angle[Caster_Value] degrees
                  • Set Dummyunit[Caster_Value] = (Last created unit)
                  • Animation - Change Dummyunit[Caster_Value] flying height to (Random real number between 100.00 and 300.00) at 100.00
                  • Unit Group - Add Dummyunit[Caster_Value] to Dummyunits
                  • Custom script: call RemoveLocation(udg_SoulMasterLoc)
                  • Set Caster_Value = (Caster_Value + 1)
        • Else - Actions
          • Unit Group - Pick every unit in SoulCaster and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Number of units in SoulCaster) Equal to 0) or ((Number of units in Circling_Units[(Player number of (Owner of (Picked unit)))]) Greater than or equal to (10 + ((Level of Sense of the Souls for (Picked unit)) x 5)))
                • Then - Actions
                • Else - Actions
                  • Set SoulMaster[Caster_Value] = (Picked unit)
                  • Set SoulMasterLoc = (Position of (Picked unit))
                  • -------- Angle to move from Deadunitloc to Soulmaster --------
                  • Set Angle[Caster_Value] = (Angle from Deadunitloc to (Position of (Picked unit)))
                  • -------- --------------------------------------------- --------
                  • Unit - Create 1 DUMMY_UNIT for (Owner of (Picked unit)) at Deadunitloc facing Angle[Caster_Value] degrees
                  • Set Dummyunit[Caster_Value] = (Last created unit)
                  • Animation - Change Dummyunit[Caster_Value] flying height to (Random real number between 100.00 and 300.00) at 100.00
                  • Unit Group - Add Dummyunit[Caster_Value] to Dummyunits
                  • Custom script: call RemoveLocation(udg_SoulMasterLoc)
      • Custom script: call RemoveLocation(udg_Deadunitloc)
      • Trigger - Turn on SoS Loop <gen>

Trigger:
  • SoS Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 0 to Caster_Value, do (Actions)
        • Loop - Actions
          • Set SoulMasterLoc = (Position of SoulMaster[(Integer A)])
          • Set Dummyloc = (Position of Dummyunit[(Integer A)])
          • Set Angle[(Integer A)] = (Angle from Dummyloc to SoulMasterLoc)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Distance between Dummyloc and SoulMasterLoc) Less than or equal to 200.00) and ((Dummyunit[(Integer A)] is in Circling_Units[(Player number of (Owner of SoulMaster[(Integer A)]))]) Equal to False)
            • Then - Actions
              • Unit Group - Remove Dummyunit[(Integer A)] from Dummyunits
              • Unit Group - Add Dummyunit[(Integer A)] to Circling_Units[(Player number of (Owner of SoulMaster[(Integer A)]))]
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Dummyunit[(Integer A)] is in Circling_Units[(Player number of (Owner of SoulMaster[(Integer A)]))]) Equal to True
                • Then - Actions
                  • Custom script: call RemoveLocation(udg_Offset)
                  • Set CirclingAngle[(Integer A)] = (CirclingAngle[(Integer A)] + 5.00)
                  • Set Offset = (SoulMasterLoc offset by 200.00 towards CirclingAngle[(Integer A)] degrees)
                  • Unit - Move Dummyunit[(Integer A)] instantly to Offset
                • Else - Actions
                  • Set Offset = (Dummyloc offset by 20.00 towards Angle[(Integer A)] degrees)
                  • Unit - Move Dummyunit[(Integer A)] instantly to Offset
          • Custom script: call RemoveLocation(udg_SoulMasterLoc)
          • Custom script: call RemoveLocation(udg_Offset)
          • Custom script: call RemoveLocation(udg_Dummyloc)
Trigger:
  • SSLearn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Sense of the Souls
    • Actions
      • Unit - Add Send Soul to (Triggering unit)
      • Unit - Set level of Send Soul for (Triggering unit) to (Level of Sense of the Souls for (Triggering unit))

Trigger:
  • SSCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Send Soul
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SS_Integer Greater than or equal to 2999
        • Then - Actions
          • Set SS_Integer = 0
        • Else - Actions
          • Set SS_Integer = (SS_Integer + 1)
      • Set SS_Target[SS_Integer] = (Target unit of ability being cast)
      • Set SS_Damage[SS_Integer] = (10 + ((Level of (Ability being cast) for (Triggering unit)) x 10))
      • Set SS_Casters = (Units in (Playable map area) matching ((Matching unit) Equal to (Triggering unit)))
      • Unit Group - Pick every unit in SS_Casters and do (Actions)
        • Loop - Actions
          • Set SS_Caster[SS_Integer] = (Picked unit)
      • Set SS_Dummy[SS_Integer] = (Random unit from (Units in (Playable map area) matching (((Matching unit) is in SS_Casters) Equal to True))) //HERES THE PROBLEM
      • Unit Group - Remove SS_Dummy[SS_Integer] from Circling_Units[(Player number of (Triggering player))]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Dummyunit[SS_Integer] Equal to No unit
        • Then - Actions
          • Game - Display to (All players) the text: No Souls, Please Ac...
          • Set SS_Target[SS_Integer] = No unit
          • Set SS_Dummy[SS_Integer] = No unit
          • Set SS_Damage[SS_Integer] = 0
          • Custom script: call DestroyGroup(udg_SS_Casters)
        • Else - Actions
          • Custom script: call DestroyGroup(udg_SS_Casters)
          • Trigger - Turn on SSLoop <gen>

Trigger:
  • SSLoop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 0 to SS_Integer, do (Actions)
        • Loop - Actions
          • Set SS_Dummyloc = (Position of SS_Dummy[(Integer A)])
          • Set SS_TargetLoc = (Position of SS_Target[(Integer A)])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between SS_TargetLoc and SS_Dummyloc) Less than or equal to 150.00
            • Then - Actions
              • Custom script: call RemoveLocation(udg_SS_Dummyloc)
              • Custom script: call RemoveLocation(udg_SS_TargetLoc)
              • Game - Display to (All players) the text: Damaging
              • Unit - Cause SS_Caster[(Integer A)] to damage SS_Target[(Integer A)], dealing (Real(SS_Damage[(Integer A)])) damage of attack type Spells and damage type Normal
              • Unit - Remove SS_Dummy[(Integer A)] from the game
              • Set SS_Target[(Integer A)] = No unit
            • Else - Actions
              • Set SS_Dummyloc = (Position of SS_Dummy[(Integer A)])
              • Set SS_TargetLoc = (Position of SS_Target[(Integer A)])
              • Set SS_Angle[(Integer A)] = (Angle from SS_Dummyloc to SS_TargetLoc)
              • Set SS_Offset = (Dummyloc offset by 20.00 towards Angle[(Integer A)] degrees)
              • Unit - Move SS_Dummy[(Integer A)] instantly to SS_Offset, facing Angle[(Integer A)] degrees
              • Game - Display to (All players) the text: Moving
              • Custom script: call RemoveLocation(udg_SS_Dummyloc)
              • Custom script: call RemoveLocation(udg_SS_TargetLoc)
              • Custom script: call RemoveLocation(udg_SS_Offset)
 

DioD

New Member
Reaction score
57
1) dead units have no buffs...
2) Where is debug output...

ofc it very very hard to add some debug messages to notify about variables condition's results and other stuff, but may be at least try to do it?
 

NeuroToxin

New Member
Reaction score
46
1) dead units have no buffs...
2) Where is debug output...

ofc it very very hard to add some debug messages to notify about variables condition's results and other stuff, but may be at least try to do it?

1. I didn't want buffs.
2. I had it in there, but i removed it.
3. im thinking about using custom value.

EDIT: I got the spinning working with Custom Value, however, now my other trigger wont work, it says moving/damaging, but its not.
Trigger:
  • SenseOfTheSouls
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Caster_Value Greater than or equal to 5000
        • Then - Actions
          • Set Caster_Value = 0
        • Else - Actions
          • Set Caster_Value = (Caster_Value + 1)
      • Set Deadunit[Caster_Value] = (Triggering unit)
      • Set Deadunitloc = (Position of Deadunit[Caster_Value])
      • Set MaxRange = 2000.00
      • Set SoulCaster = (Units within MaxRange of Deadunitloc matching ((Level of Sense of the Souls for (Matching unit)) Greater than 0))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in SoulCaster) Greater than 1
        • Then - Actions
          • Unit Group - Pick every unit in SoulCaster and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Number of units in SoulCaster) Equal to 0) or ((Number of units in Circling_Units[(Custom value of (Picked unit))]) Greater than or equal to (10 + ((Level of Sense of the Souls for (Picked unit)) x 5)))
                • Then - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is in SoS_Casters) Equal to False
                    • Then - Actions
                      • Unit Group - Add (Picked unit) to SoS_Casters
                      • Unit - Set the custom value of (Picked unit) to CustomValue
                      • Set CustomValue = (CustomValue + 1)
                    • Else - Actions
                  • Set SoulMaster[Caster_Value] = (Picked unit)
                  • Set SoulMasterLoc = (Position of SoulMaster[Caster_Value])
                  • -------- Angle to move from Deadunitloc to Soulmaster --------
                  • Set Angle[Caster_Value] = (Angle from Deadunitloc to (Position of (Picked unit)))
                  • -------- --------------------------------------------- --------
                  • Unit - Create 1 DUMMY_UNIT for (Owner of (Picked unit)) at Deadunitloc facing Angle[Caster_Value] degrees
                  • Set Dummyunit[Caster_Value] = (Last created unit)
                  • Unit - Set the custom value of Dummyunit[Caster_Value] to (Custom value of (Picked unit))
                  • Animation - Change Dummyunit[Caster_Value] flying height to (Random real number between 100.00 and 300.00) at 100.00
                  • Unit Group - Add Dummyunit[Caster_Value] to Dummyunits
                  • Custom script: call RemoveLocation(udg_SoulMasterLoc)
                  • Set Caster_Value = (Caster_Value + 1)
        • Else - Actions
          • Unit Group - Pick every unit in SoulCaster and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Number of units in SoulCaster) Equal to 0) or ((Number of units in Circling_Units[(Custom value of (Picked unit))]) Greater than or equal to (10 + ((Level of Sense of the Souls for (Picked unit)) x 5)))
                • Then - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is in SoS_Casters) Equal to False
                    • Then - Actions
                      • Unit Group - Add (Picked unit) to SoS_Casters
                      • Unit - Set the custom value of (Picked unit) to CustomValue
                      • Set CustomValue = (CustomValue + 1)
                    • Else - Actions
                  • Set SoulMaster[Caster_Value] = (Picked unit)
                  • Set SoulMasterLoc = (Position of (Picked unit))
                  • -------- Angle to move from Deadunitloc to Soulmaster --------
                  • Set Angle[Caster_Value] = (Angle from Deadunitloc to (Position of (Picked unit)))
                  • -------- --------------------------------------------- --------
                  • Unit - Create 1 DUMMY_UNIT for (Owner of (Picked unit)) at Deadunitloc facing Angle[Caster_Value] degrees
                  • Set Dummyunit[Caster_Value] = (Last created unit)
                  • Unit - Set the custom value of Dummyunit[Caster_Value] to (Custom value of (Picked unit))
                  • Animation - Change Dummyunit[Caster_Value] flying height to (Random real number between 100.00 and 300.00) at 100.00
                  • Unit Group - Add Dummyunit[Caster_Value] to Dummyunits
                  • Custom script: call RemoveLocation(udg_SoulMasterLoc)
      • Custom script: call RemoveLocation(udg_Deadunitloc)
      • Custom script: call DestroyGroup(udg_SoulCaster)
      • Trigger - Turn on SoS Loop <gen>

Trigger:
  • SoS Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 0 to Caster_Value, do (Actions)
        • Loop - Actions
          • Set SoulMasterLoc = (Position of SoulMaster[(Integer A)])
          • Set Dummyloc = (Position of Dummyunit[(Integer A)])
          • Set Angle[(Integer A)] = (Angle from Dummyloc to SoulMasterLoc)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Distance between Dummyloc and SoulMasterLoc) Less than or equal to 200.00) and ((Dummyunit[(Integer A)] is in Circling_Units[(Custom value of SoulMaster[(Integer A)])]) Equal to False)
            • Then - Actions
              • Unit Group - Remove Dummyunit[(Integer A)] from Dummyunits
              • Unit Group - Add Dummyunit[(Integer A)] to Circling_Units[(Custom value of SoulMaster[(Integer A)])]
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Dummyunit[(Integer A)] is in Circling_Units[(Custom value of SoulMaster[(Integer A)])]) Equal to True
                • Then - Actions
                  • Custom script: call RemoveLocation(udg_Offset)
                  • Set CirclingAngle[(Integer A)] = (CirclingAngle[(Integer A)] + 3.50)
                  • Set Offset = (SoulMasterLoc offset by 200.00 towards CirclingAngle[(Integer A)] degrees)
                  • Unit - Move Dummyunit[(Integer A)] instantly to Offset
                • Else - Actions
                  • Set Offset = (Dummyloc offset by 20.00 towards Angle[(Integer A)] degrees)
                  • Unit - Move Dummyunit[(Integer A)] instantly to Offset
          • Custom script: call RemoveLocation(udg_SoulMasterLoc)
          • Custom script: call RemoveLocation(udg_Offset)
          • Custom script: call RemoveLocation(udg_Dummyloc)

Trigger:
  • SSLearn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Sense of the Souls
    • Actions
      • Unit - Add Send Soul to (Triggering unit)
      • Unit - Set level of Send Soul for (Triggering unit) to (Level of Sense of the Souls for (Triggering unit))

Trigger:
  • SSCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Send Soul
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SS_Integer Greater than or equal to 2999
        • Then - Actions
          • Set SS_Integer = 0
        • Else - Actions
          • Set SS_Integer = (SS_Integer + 1)
      • Set SS_Caster[SS_Integer] = (Triggering unit)
      • Set SS_Target[SS_Integer] = (Target unit of ability being cast)
      • Set SS_Damage[SS_Integer] = (10 + ((Level of (Ability being cast) for (Triggering unit)) x 10))
      • Set SS_Casters = (Units in (Playable map area) matching ((Custom value of (Matching unit)) Equal to (Custom value of (Triggering unit))))
      • Unit Group - Remove SS_Dummy[SS_Integer] from Circling_Units[(Custom value of (Triggering unit))]
      • Set SS_Dummy[SS_Integer] = (Random unit from SS_Casters)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Dummyunit[SS_Integer] Equal to No unit
        • Then - Actions
          • Game - Display to (All players) the text: No Souls, Please Ac...
          • Set SS_Target[SS_Integer] = No unit
          • Set SS_Dummy[SS_Integer] = No unit
          • Set SS_Damage[SS_Integer] = 0
          • Custom script: call DestroyGroup(udg_SS_Casters)
        • Else - Actions
          • Custom script: call DestroyGroup(udg_SS_Casters)
          • Trigger - Turn on SSLoop <gen>

Trigger:
  • SSLoop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 0 to SS_Integer, do (Actions)
        • Loop - Actions
          • Set SS_Dummyloc = (Position of SS_Dummy[(Integer A)])
          • Set SS_TargetLoc = (Position of SS_Target[(Integer A)])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between SS_TargetLoc and SS_Dummyloc) Less than or equal to 150.00
            • Then - Actions
              • Custom script: call RemoveLocation(udg_SS_Dummyloc)
              • Custom script: call RemoveLocation(udg_SS_TargetLoc)
              • Game - Display to (All players) the text: Damaging
              • Unit - Cause SS_Caster[(Integer A)] to damage SS_Target[(Integer A)], dealing (Real(SS_Damage[(Integer A)])) damage of attack type Spells and damage type Normal
              • Unit - Remove SS_Dummy[(Integer A)] from the game
              • Set SS_Target[(Integer A)] = No unit
            • Else - Actions
              • Set SS_Dummyloc = (Position of SS_Dummy[(Integer A)])
              • Set SS_TargetLoc = (Position of SS_Target[(Integer A)])
              • Set SS_Angle[(Integer A)] = (Angle from SS_Dummyloc to SS_TargetLoc)
              • Set SS_Offset = (Dummyloc offset by 20.00 towards Angle[(Integer A)] degrees)
              • Unit - Move SS_Dummy[(Integer A)] instantly to SS_Offset, facing Angle[(Integer A)] degrees
              • Game - Display to (All players) the text: Moving
              • Custom script: call RemoveLocation(udg_SS_Dummyloc)
              • Custom script: call RemoveLocation(udg_SS_TargetLoc)
              • Custom script: call RemoveLocation(udg_SS_Offset)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top