• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Mass Teleport for friendly units you don't own

Status
Not open for further replies.
Level 11
Joined
Oct 9, 2015
Messages
721
Unit starts the effect of a ability -> start timer -> timer expires = pick every units within range of caster (condition: picked unit is not owned by owner of caster AND owner of picked unit is an ally of owner of caster) -> move picked units to the target of ability being cast, create visual and sound effects of mass teleport.

Maybe this ?
 
Level 9
Joined
Feb 17, 2009
Messages
291
Hey thanks! I need to make more use of timers like everyone else. I have one major issue with this trigger though - If you use Mass Teleport you can click on the minimap to target the nearest unit to your cursor. When doing this, the game does not think you have actually clicked a target, and so the trigger doesn't work. Is there a way to work around this?
 
Level 11
Joined
Oct 9, 2015
Messages
721
maybe try targeting the nearest town hall from the point of ability being cast ? pick every units whitin (number) of target point of ability being cast -> picked unit equal to town hall -> set PointVariable = position of picked unit
 
Level 9
Joined
Feb 17, 2009
Messages
291
Well I decided to make this an instant spell since I am not knowledgable enough to make this a trigger that works for any number of players casting it simultaneously (isn't that what MUI means? one of those cryptic acronyms no one ever defines out loud). So the timer wasn't necessary. I decided to stop using Mass Teleport and instead just make a Channel and warp everyone via trigger instead of only friendly units.
 

Kyrbi0

Arena Moderator
Level 44
Joined
Jul 29, 2008
Messages
9,487
Multi-Unit Instanceability. I'm surprised you couldn't find it in any coding tutorials here... Anyway, it's just a way of saying "can 2 (or more) units cast this same spell & have it work right?". It's separate but closely related to MPI, Multi-Player Instanceability.

Dark Summoning is your friend.
 
Level 11
Joined
Oct 9, 2015
Messages
721
I think it needs some adjustments as to the number of units to be teleported etc. but I guess this is the base for what you want, it's MPI (multi player instanceability) but you can make it MUI (multi unit instanceability)
PS: Change the Chicken unit for a dummy unit and remove the location leaks
  • Mass Teleport Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mass Teleport
    • Actions
      • Set CastPoint[(Player number of (Owner of (Triggering unit)))] = (Target point of ability being cast)
      • Set Caster[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
      • Unit - Create 1 Chicken for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
  • Mass Teleport Finish
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Chicken
      • (Caster[(Player number of (Owner of (Triggering unit)))] is alive) Equal to True
    • Actions
      • Unit Group - Pick every unit in (Units within 700.00 of CastPoint[(Player number of (Owner of (Triggering unit)))]) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A town-hall-type unit) Equal to True
            • Then - Actions
              • Set CastPoint[(Player number of (Owner of (Triggering unit)))] = (Position of (Picked unit))
            • Else - Actions
      • Unit Group - Pick every unit in (Units within 700.00 of (Position of (Triggering unit))) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) is an ally of (Owner of (Triggering unit))) Equal to True
            • Then - Actions
              • Unit - Move (Picked unit) instantly to CastPoint[(Player number of (Owner of (Triggering unit)))]
            • Else - Actions
 
Level 9
Joined
Feb 17, 2009
Messages
291
Multi-Unit Instanceability. I'm surprised you couldn't find it in any coding tutorials here... Anyway, it's just a way of saying "can 2 (or more) units cast this same spell & have it work right?". It's separate but closely related to MPI, Multi-Player Instanceability.

Dark Summoning is your friend.

Oooh yes there we are. I visit the spell section sometimes but I generally avoid actual code myself. So in this case I was actually talking about MPI it would seem?

Also I've literally never used dark summoning until just now (lol only been modding for ten years) but that spell targets only your own units, and then they come to you.
 

Kyrbi0

Arena Moderator
Level 44
Joined
Jul 29, 2008
Messages
9,487
Oooh yes there we are. I visit the spell section sometimes but I generally avoid actual code myself. So in this case I was actually talking about MPI it would seem?
I guess? Both are important for melee considerations (which is what I'm concerned with).

Shyster said:
Also I've literally never used dark summoning until just now (lol only been modding for ten years) but that spell targets only your own units, and then they come to you.
Meh, I wasn't sure if it could be modified to target allies as well, or just 'all living units' or whatever.

You are forgetting: Dummy Casters. They can be made for whichever player you like (including Neutral Hostile), and IIRC it can be modified to target enemies. DC's do a lot of work. : )

Personally, I have just found that spell to be useful to the nth degree. I have found creative applications for it all over the place; even very recently. : )
 
Level 9
Joined
Feb 17, 2009
Messages
291
I think it needs some adjustments as to the number of units to be teleported etc. but I guess this is the base for what you want, it's MPI (multi player instanceability) but you can make it MUI (multi unit instanceability)
PS: Change the Chicken unit for a dummy unit and remove the location leaks

Hmm...the cast time issue is resolved now, thank you :) idk why I never thought of using a dummy like that. The issue I'm having is -- if you click on a point instead of a unit, they warp to that point. I want this ability to only be able to warp you to a friendly unit (warping to a point would be crazy overpowered in my map). That includes if you click on the minimap which is always a point target ofc.

You are forgetting: Dummy Casters. They can be made for whichever player you like (including Neutral Hostile), and IIRC it can be modified to target enemies. DC's do a lot of work. : )

So basically I should be smart and avoid doing any of this by just creating one dummy for each player you're allied to, and have them all cast a mass teleport spell at your target? hahaha

Only thing though, I'll have to see if I still have the aforementioned issue with point targets. Cause I'm not sure the AI will understand how to do that. Gonna run and test this now...

EDIT: nevermind this doesn't work, never realized you can't double mass teleport onto one unit.

Personally, I have just found that spell to be useful to the nth degree. I have found creative applications for it all over the place; even very recently. : )

Yeah I thought it was pretty cool after testing it (and I've never seen that ring graphic they used on it in regular Wc3). I'll make sure to check that out.
 
Last edited:
Level 11
Joined
Oct 9, 2015
Messages
721
The trigger will pick the nearest town hall whitin 700 of range from the point you clicked and then teleport the units to the town hall.

EDIT: Change the range of the picking town hall to 1000 and it will work fine. the maximum range you can take your point of ability being cast is 1000, I tought it was 700 because of the area of effect of the ability
 
Last edited:
Level 9
Joined
Feb 17, 2009
Messages
291
The trigger will pick the nearest town hall whitin 700 of range from the point you clicked and then teleport the units to the town hall.

EDIT: Change the range of the picking town hall to 1000 and it will work fine. the maximum range you can take your point of ability being cast is 1000, I tought it was 700 because of the area of effect of the ability

Ok but I didn't want it to work on just town halls, I want it to be castable on any friendly unit or building.

Searching within 1000 fixed the first issue, thanks for that. I am discovering however that by searching all units in a radius, means that if multiple friendly units/buildings are at that target area, there is a good chance you will warp to a unit other than the one you clicked/targeted on the minimap. Like ok say I warp to an ancient protector, and it shows the blue warp thingy on him. But a dryad runs by and is within 1000 range of that ancient protector. The trigger could choose the dryad even if she is 900 distance away from my original target!

Since this spell is usable on the minimap and mass teleport doesn't leave a buff on the target I'm not sure how to discriminate between the "official" target of mass teleport and just another friendly target in range that I DIDN'T target.

Edited: tried to make it less confusing
 
Last edited:
Level 9
Joined
Feb 17, 2009
Messages
291
heres the Mass Teleport ability description: "Teleports 24 of the player's nearby units, including the Archmage, TO A FRIENDLY GROUND UNIT OR STRUCTURE." Maybe you can change the targets allowed in the object editor.

I know what the ability does. It works fine. I will post my triggers and try to clarify...

I've modified the second trigger so it can search for any unit or building. This isn't good enough because it will many times pick another nearby unit, just because it is within 1000 range. How can I change it to always pick the same unit/building target you picked with the actual cast of Mass Teleport? It's kind of confusing.

  • Greater Warp 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mass Teleport
    • Actions
      • Set GreaterWarpTarget[(Player number of (Owner of (Triggering unit)))] = (Target point of ability being cast)
      • Set GreaterWarpCaster[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
      • Set AA_LEAK_Points = (Position of (Triggering unit))
      • Unit - Create 1 Chicken for (Owner of (Triggering unit)) at AA_LEAK_Points facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_AA_LEAK_Points)
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
  • Greater Warp 2
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Chicken
      • GreaterWarp_StillCasting[(Player number of (Owner of (Triggering unit)))] Equal to True //This is handled in 2 other triggers in case you interrupt the cast)
    • Actions
      • Set AA_LEAK_UnitGroups = (Units within 1000.00 of GreaterWarpTarget[(Player number of (Owner of (Triggering unit)))])
      • Unit Group - Pick every unit in AA_LEAK_UnitGroups and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) is an ally of (Owner of (Triggering unit))) Equal to True
              • (Owner of (Picked unit)) Not equal to Neutral Passive
            • Then - Actions
              • Set GreaterWarpTarget[(Player number of (Owner of (Triggering unit)))] = (Position of (Picked unit))
            • Else - Actions
      • Custom script: call DestroyGroup(udg_AA_LEAK_UnitGroups)
      • -------- - --------
      • -------- - --------
      • -------- - --------
      • Set AA_LEAK_Points = (Position of (Triggering unit))
      • Set AA_LEAK_UnitGroups = (Units within 500.00 of AA_LEAK_Points)
      • Unit Group - Pick every unit in AA_LEAK_UnitGroups and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) is an ally of (Owner of (Triggering unit))) Equal to True
              • ((Picked unit) is A structure) Equal to False
            • Then - Actions
              • Unit - Move (Picked unit) instantly to GreaterWarpTarget[(Player number of (Owner of (Triggering unit)))]
            • Else - Actions
      • Custom script: call DestroyGroup(udg_AA_LEAK_UnitGroups)
      • Custom script: call RemoveLocation(udg_AA_LEAK_Points)
 
Status
Not open for further replies.
Top