I have attempted to make a spell in the data editor that works like this:
A spellcaster casts "Teleport" at target unit. That unit is immediately teleported back to the closest Nexus, CC or Hatchery owned by that player.
For example, player A casts Teleport at Player B's Hydralisk. It is teleported to the closest Hatchery owned by Player B.
I just can not get this spell to work properly in the data editor. Units are always teleported to the wrong structure - Player A's units are teleported to Player B's Hatchery, and so on... >.<
Is it possible to build this spell in the trigger editor?
I am decent at the data editor and can build most of the stuff I want, but I am quite weak at the trigger editor. Instructions suitable for a dummy would be appreciated! : D
You could do this in the data editor. I don't know that you can teleport the unit to the closest Town Hall, but I think what you're asking is basically like Recall except the target isn't an area, but a unit. If that's the case, you can change the target of the ability to a Unit. I don't know off the top of my head how to exactly go about doing this, I would need to look directly at it. But it's somewhat possible with Triggers. Triggers are almost exclusively reserved for map events and gameplay initialization, such as button panels and cameras. You might be able to do something with an Unit Uses Ability event and Move Unit Instantly action, but it would be easier imo to just change the target of the preexisting Recall ability
the problem I have with the data editor solution is that I fail to make units teleport to their own town hall. The spell never checks for that, it teleports the wrong players units to the wrong town halls. Maybe there is a better solution with triggers?
Oof, I don't know how to fix that so I'm not going to waffle something XD DrSuperEvil usually checks around here and he's REALLY good with the Data Editor, he might be able to help.
You pretty much would use an Effect - Instant ability that uses a global Search Area effect that has the filters set to player that uses a Teleport Effect which teleports the caster to the target. You then validate the teleport effect based on Unit Type.
Search area effect and set target filters to match the player or make an effect that applies a buff to unit with search area effect which teleports it to the HQ
Thank you, the problem is that when I use "Player" the teleport effect always teleports all units to my town hall since I am the "player", it never teleports the corresponding unit to its owner's town hall. That is the problem I have - how to teleport every unit to its corresponding town hall? (Player 1 units to player 1's town hall, player 2 units to player 2's town hall, and so on)
THANK YOU!!! The trigger works!! Ahhh I am so glad that it works..
I agree with you - this should be doable in the data editor and I have built the entire spell. But for some reason that I cannot understand, units are not teleported to their corresponding town hall and I don't know why T_T ... but your trigger fixes that!
May I bother you with two additional short questions? (I promise, then I will be quiet)
1) How do I make the Event in the trigger check for an effect or a behavior? My ability adds a buff or an effect to the targeted unit, then it becomes teleported by the trigger. I find no good Event for that :O 2) Now units are teleported "inside" the town hall model and it looks odd. Is it possible to teleport it next to the structure? In the data editor there is a field "Placement range" that places teleported units near a structure. I check in the trigger fields for "Points" and I find X,Y,Z offsets, but the town halls migh be on different locations on different maps.. Hmm
Tip for anyone finding this thread in the future - if your teleported unit gets stuck "inside" a building that it is teleported to, you can make your ability give it the unit a Wander behaviour and then remove if after 1 second. This makes your teleported unit go into a random direction, thus moving away from your building and not being stuck anymore.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have attempted to make a spell in the data editor that works like this:
A spellcaster casts "Teleport" at target unit. That unit is immediately teleported back to the closest Nexus, CC or Hatchery owned by that player.
For example, player A casts Teleport at Player B's Hydralisk. It is teleported to the closest Hatchery owned by Player B.
I just can not get this spell to work properly in the data editor. Units are always teleported to the wrong structure - Player A's units are teleported to Player B's Hatchery, and so on... >.<
Is it possible to build this spell in the trigger editor?
I am decent at the data editor and can build most of the stuff I want, but I am quite weak at the trigger editor. Instructions suitable for a dummy would be appreciated! : D
Any ideas how to build it? Is it even possible?
You could do this in the data editor. I don't know that you can teleport the unit to the closest Town Hall, but I think what you're asking is basically like Recall except the target isn't an area, but a unit. If that's the case, you can change the target of the ability to a Unit. I don't know off the top of my head how to exactly go about doing this, I would need to look directly at it. But it's somewhat possible with Triggers. Triggers are almost exclusively reserved for map events and gameplay initialization, such as button panels and cameras. You might be able to do something with an Unit Uses Ability event and Move Unit Instantly action, but it would be easier imo to just change the target of the preexisting Recall ability
KSNumedia's Assets: Custom Models for campaigns and mods!
Thanks for your reply,
the problem I have with the data editor solution is that I fail to make units teleport to their own town hall. The spell never checks for that, it teleports the wrong players units to the wrong town halls. Maybe there is a better solution with triggers?
Oof, I don't know how to fix that so I'm not going to waffle something XD DrSuperEvil usually checks around here and he's REALLY good with the Data Editor, he might be able to help.
KSNumedia's Assets: Custom Models for campaigns and mods!
You pretty much would use an Effect - Instant ability that uses a global Search Area effect that has the filters set to player that uses a Teleport Effect which teleports the caster to the target. You then validate the teleport effect based on Unit Type.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
I am resuming this project and I have the same issue - units are teleported to the nearest town hall, never to their own town hall :(
I want player 2 units to be teleported to player 2's town hall, player 3 units to be teleported to player 3's town hall, and so on.
Any ideas how to make this in the data or trigger editor?
Search area effect and set target filters to match the player or make an effect that applies a buff to unit with search area effect which teleports it to the HQ
In reply to RaptorKirad:
Thank you, the problem is that when I use "Player" the teleport effect always teleports all units to my town hall since I am the "player", it never teleports the corresponding unit to its owner's town hall. That is the problem I have - how to teleport every unit to its corresponding town hall? (Player 1 units to player 1's town hall, player 2 units to player 2's town hall, and so on)
You can try using the behavior with effect and set unit to source, not caster, maybe this will work. If not then use triggers
In reply to RaptorKirad:
Thanks, I experimented with source now, I can't get it to match the corresponding unit to the player's town hall : (
I believe it can be done through data editor, but easier solution would be triggers of course.
In reply to RaptorKirad:
THANK YOU!!! The trigger works!! Ahhh I am so glad that it works..
I agree with you - this should be doable in the data editor and I have built the entire spell. But for some reason that I cannot understand, units are not teleported to their corresponding town hall and I don't know why T_T ... but your trigger fixes that!
May I bother you with two additional short questions? (I promise, then I will be quiet)
1) How do I make the Event in the trigger check for an effect or a behavior? My ability adds a buff or an effect to the targeted unit, then it becomes teleported by the trigger. I find no good Event for that :O
2) Now units are teleported "inside" the town hall model and it looks odd. Is it possible to teleport it next to the structure? In the data editor there is a field "Placement range" that places teleported units near a structure. I check in the trigger fields for "Points" and I find X,Y,Z offsets, but the town halls migh be on different locations on different maps.. Hmm
1. You can use either "Effect used" event or "Unit behavior changes" event
2. Instead of "Position of unit" use "Point with offset" or "Point with polar offset" and then set the point to "Position of unit"
Tip for anyone finding this thread in the future - if your teleported unit gets stuck "inside" a building that it is teleported to, you can make your ability give it the unit a Wander behaviour and then remove if after 1 second. This makes your teleported unit go into a random direction, thus moving away from your building and not being stuck anymore.