• 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.

MPI help

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2013
Messages
1,105
So I'm trying to make a spell that upon being cast will push everyone around them back for 2 seconds, It works for 1 person...but it didn't work with multiple people and some people's got stuck permanently on, so any help would be awesome!

  • Knockback
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Make Way
    • Actions
      • Set Knockback_MaxIndex = (Knockback_MaxIndex + 1)
      • Set Knockback_Caster[Knockback_MaxIndex] = (Triggering unit)
      • Special Effect - Create a special effect attached to the origin of Knockback_Caster[Knockback_MaxIndex] using Abilities\Spells\Undead\Unsummon\UnsummonTarget.mdl
      • Set Knockback_SpcEffec[(Player number of (Triggering player))] = (Last created special effect)
      • Set Knockback_Counter[Knockback_MaxIndex] = 66
      • Trigger - Turn on Knockback Push <gen>
  • Knockback Push
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Knockback_MaxIndex Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • For each (Integer Knockback_CurrentIndex) from 1 to Knockback_MaxIndex, do (Actions)
            • Loop - Actions
              • Set Knockback_Counter[Knockback_CurrentIndex] = (Knockback_Counter[Knockback_CurrentIndex] - 1)
              • Set TempLoc = (Position of Knockback_Caster[Knockback_CurrentIndex])
              • Set Knockback_Group[Knockback_CurrentIndex] = (Units within 225.00 of TempLoc matching (((Matching unit) belongs to an enemy of (Owner of Knockback_Caster[Knockback_CurrentIndex])) Equal to True))
              • Unit Group - Pick every unit in Knockback_Group[Knockback_CurrentIndex] and do (Actions)
                • Loop - Actions
                  • Set Knockback_EnemyLoc[1] = (Position of (Picked unit))
                  • Set Knockback_Angle = (Angle from TempLoc to Knockback_EnemyLoc[1])
                  • Set Knockback_EnemyLoc[2] = (Knockback_EnemyLoc[1] offset by 5.00 towards Knockback_Angle degrees)
                  • Unit - Move (Picked unit) instantly to Knockback_EnemyLoc[2]
                  • Custom script: call RemoveLocation(udg_Knockback_EnemyLoc[1])
                  • Custom script: call RemoveLocation(udg_Knockback_EnemyLoc[2])
              • Custom script: call DestroyGroup(udg_Knockback_Group[udg_Knockback_CurrentIndex])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Knockback_Caster[Knockback_CurrentIndex] is alive) Not equal to True
                      • Knockback_Counter[Knockback_CurrentIndex] Equal to 0
                • Then - Actions
                  • Special Effect - Destroy Knockback_SpcEffec[Knockback_CurrentIndex]
                  • Set Knockback_Caster[Knockback_CurrentIndex] = Knockback_Caster[Knockback_MaxIndex]
                  • Set Knockback_CurrentIndex = (Knockback_CurrentIndex - 1)
                  • Set Knockback_MaxIndex = (Knockback_MaxIndex - 1)
                • Else - Actions
              • Custom script: call RemoveLocation(udg_TempLoc)
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Wow Xonok, I didn't know all you had to do to check for pathing with SetX/Y is check for On/Off Walkability, I was using move instantly I thought it was hard to tell pathing, and I actually like how yours looks a lot better, the only thing is I use custom value else where in my map and I can't have it being fouled up :(. Hm, maybe I'll try and remake mine.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Wow Xonok, I didn't know all you had to do to check for pathing with SetX/Y is check for On/Off Walkability, I was using move instantly I thought it was hard to tell pathing, and I actually like how yours looks a lot better, the only thing is I use custom value else where in my map and I can't have it being fouled up :(. Hm, maybe I'll try and remake mine.

Well, actually the pathability check alone is faulty, as it only checks terrain pathability and not doodads. A solution would be moving an item or unit to the new position and seeing, if they are close enough to where you put them. If not, then the pathing system placed them away and thus, the point is unpathable.

About custom value, it should only be used by unit indexers. Then you can make an endless amount of arrays that save any kind of information and can be linked to the unit, just like custom value(through custom value actually).
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Well after some thought I'm actually just going to figure out a work around for my previous custom value usage and use your guys stuff(w/creds ofc)! Thanks very much for your help. And Purge I just tested that walkability and dang its cool, and works perfectly!
 
Status
Not open for further replies.
Top