• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Magic Shell units still vulnerable to Possesion?

Status
Not open for further replies.
Level 7
Joined
Jul 1, 2008
Messages
1,025
Hi there,

I am using the Magic Shell ability, the version which absorbs a set about of damage not the standard version which gives magic immunity. Unfortunately this version of the spell doesn't seem to protect the unit from spells like Possession, it only seems to absorb a set amount of spell damage.

Is there a way I can make so units with Anti Magic spell are immune to spells like possession until the shield is depleted?

Here is a trigger I have tried but it dosnt even seem to be firing?

  • Possesion no Shield
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to (==) Possession (Banshee)
      • ((Target unit of ability being cast) has buff Anti-magic Shell) Equal to (==) True
    • Actions
      • Game - Display to (All players) the text: Trigger Activated
      • Unit - Order (Triggering unit) to Stop
      • Unit - Pause (Triggering unit)
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
Erm... i have an idea, put the units with the anti-magic shell (when they get it) in a unit group. In a loop trigger, pick all units in the unit group and remove the buffs you don't want (Possession in this case). So when the unit gets the anit-magic buff, the loop will run (i recommend 0.05 sec. loop in this case) and remove the Possession buff. I can make a trigger for you, if you find this hard. :)
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,197
this is what he means
  • Untitled Trigger 001
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Anti-magic Shell) Equal to True
            • Then - Actions
              • Unit - Remove Possession buff from (Picked unit)
            • Else - Actions
 
Last edited:
Level 7
Joined
Jul 1, 2008
Messages
1,025
Oh its ok I found a really simple solution! I just based it off the standard Anti Magic Shell but gave it a maximum damage absorbed amount and it now seems to protect units from spells like possession but also can be dispelled by magic damage!

0 must mean infinate in this field.
 
Level 7
Joined
Jul 1, 2008
Messages
1,025
Oops no this isnt fixed, I forgot I had a trigger running. Chaosy I did a variation of your trigger abusing Resistant Skin instead as you can see below. However this is causing lag even in single player. I think asking the game to pick every unit in playable map every 2 seconds is just too much?

It's a strategy map btw so there is lots of units. I am not sure what to do now. Back to square one *sigh*

  • Possesion Give Resistant
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set ALL = (Units in (Playable map area))
      • Unit Group - Pick every unit in ALL and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Multiple ConditionsOr - Any (Conditions) are true
                • Conditions
                  • ((Picked unit) has buff Anti-magic Shell) Equal to (==) True
                  • ((Picked unit) has buff Anti-magic Shell (Extra)) Equal to (==) True
            • Then - Actions
              • Unit - Add Resistant Skin Magic Shell to (Picked unit)
            • Else - Actions
              • Unit - Remove Resistant Skin Magic Shell from (Picked unit)
      • Custom script: call DestroyGroup (udg_ALL)
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
The lag must be in something else. This trigger will not make the game lag that much... it will lag a lot if it loops like every 0.01 or 0.02 seconds and leaves at least 2 leaks per loop... look for something else. I don't think this makes the game lag. You can also do this : in one trigger, with event "Map Initialization", set this ALL group to be "(Units in (Playable map area))" and when a unit enters the map (with the event "Unit enters region", the region is "Playable map area"). Those two triggers will filter all the units in the map, so you don't need a loop trigger. Simply when the map runs, all units that come there with it's initialization are added to the group. Any units that enter the map are added trough the second trigger.
 
Level 7
Joined
Jul 1, 2008
Messages
1,025
The lag is definitely NOT something else. Its not a huge amount of lag but there is a slight jerk in the camera every 2 seconds when panning across during cinematic s, its not that noticeable but it is definitely there. If I disable this trigger it goes.

I get your second suggestion but still I think a trigger that checks itself only when the ability possession is cast is by far my efficient, if only I knew why my original trigger isn't working?
 

Vunjo

Hosted Project: SC
Level 14
Joined
Jul 1, 2010
Messages
1,340
In the trigger you posted, you are literally picking all units in the game, and then checking the conditions. I advise you to pick all units in game matching all your conditions that you have listed. That way, the game will not pick units without the buffs, thus it will not cause the game to lag.
 
Level 7
Joined
Jul 1, 2008
Messages
1,025
In the trigger you posted, you are literally picking all units in the game, and then checking the conditions. I advise you to pick all units in game matching all your conditions that you have listed. That way, the game will not pick units without the buffs, thus it will not cause the game to lag.

Ahh but surely the problem is I also need to pick all units without the buff in order to remove resistant skin afterwards?
 

Vunjo

Hosted Project: SC
Level 14
Joined
Jul 1, 2010
Messages
1,340
If there's no other way, then you could try this. Instead of picking all units in the entire map, you could pick all units in range of the caster(s). It still might be laggy though, but at least it's partly fixed, and resistant skin can be removed.
 
Status
Not open for further replies.
Top