SC2Mapster Forums

General > General Chat

Question About "Leashing" Units

  • 5 posts
    #1 Nov 15, 2012 at 08:13 UTC - 0 likes

    I would like to apologize in advance for the leeching/mooching, but I'm stumped on a particular mechanic and was wondering if anyone could give me some hints on how to produce the results I need. I would appreciate any help immensely.

    I'm not sure if any of you are familiar with a game called Island Defense, previously maintained by Agouti, and now recently maintained by Sen, but I made a suggestion for an implementation in the sequel/expansion of our game, and it was met with generally high regard and acceptance. However, our go-to GE developer is uncomfortable with his knowledge on parts of the suggestion, and I'm trying to see if there's a simple way we can get the desired results without going through all kinds of trouble.

    The suggestion in question is this: http://www.sc2id.com/forums/viewtopic.php?f=29&t=5460

    The nitty-gritty of the GE details begins here: http://www.sc2id.com/forums/viewtopic.php?f=29&t=5460&start=80#p160611

    Effectively, what we're trying to accomplish is have a beam up to 8 units in length connecting two identical units, that prevents them from being more than 8 spaces away from each other. If one unit is moved and the other is on "Stop" position (and not "Hold" position), then the uncontrolled unit is dragged along behind the controlled unit. If the units are moved in opposite directions, they are unable to continue moving once they reach the maximum distance apart.

    In addition to that, we want to have an effect that deals damage over time when an enemy unit is adjacent to the beam connecting the two units being linked or when an enemy unit crossed that beam.

    One of the solutions we came up with for the physical linking (the "leash," if you will) is this: http://www.sc2id.com/forums/viewtopic.php?f=29&t=5460&start=100#p160942

    The solution we're thinking about now for the damage over time (as well as an additional stun effect) is this: http://www.sc2id.com/forums/viewtopic.php?f=29&t=5460&start=90#p160891

    Let me know what you think, and if there are any problems that we may encounter, or if there are any easy solutions that we have missed.

    Keep in mind that Sen, our developer, wants to avoid using triggers wherever possible, unless it is the best solution possible.

    Thanks for your help!

    Last edited Nov 16, 2012 by Tehrible
    #2 Nov 16, 2012 at 01:23 UTC - 0 likes

    Does anyone have even a slight inkling of how to make this work?

    #3 Nov 16, 2012 at 07:21 UTC - 0 likes

    For the making the 2 units stay close together I would suggest something along the lines of each unit having a behavior that checks to see if the other unit isn't within a certain range of the other unit and isn't using the move command and orders it to move closer to the other unit until it is within the desired range and which point the behavior stops and orders the unit to stop. You can do this using a Location Range validator. You would need a way to prevent the behavior from activating when the payer orders it to move so perhaps instead of using an issued order Move ability it might be wiser to use an Apply Force effect and use a combine validator to check if the other unit is too far away and the unit isn't using the move command.

    I can provide more details if you require it.

    Assistant Team Leader of "Generic Code" and User of the All-Mighty Data Editor.

    My Amazing Cutscenes

    #4 Nov 16, 2012 at 22:00 UTC - 0 likes

    @Spoolofwhool: Go

    Is there a way to specify which unit is doing the dragging and which unit is being dragged? That's the biggest problem, from what I've gathered from Devs on the SC2ID forums.

    In effect, I want this "force" effect to only affect the unit not being controlled, so that it doesn't interfere with the unit you're controlling. However, I don't want it to be possible to simultaneously control each unit in an opposite direction (because that defeats the purpose of the linking itself).

    #5 Nov 19, 2012 at 01:51 UTC - 0 likes

    Does your solution account for the the fact that you can use the move command on both to make them get farther apart?

  • 5 posts

You must login to post a comment. Don't have an account? Register to get one!