[Need Info] "Leashing" a unit to another one?

Status
Not open for further replies.
Level 27
Joined
Jul 6, 2008
Messages
11,326
Anyone has any clue how to "leash" one unit to another, using ability or behaviors? Example: I have a unit A. I have a unit B. Unit B has a behavior/toggle-able ability that makes targeted unit A become leashed to it. If Unit B uses another ability, unit A follows a certain order or receives a behavior. The leashing can be disabled, thus freeing unit A from the effects, and you can have more than one A and B units, so the B unit's abilities must only affect it's own leashed unit.
 
Hey Tleno ;) Long time no see !
You can make a hashtable which stores the casters on the first column and the units attached to it in the according line.
Then with other triggers detecting units order, you check for example when a certain spell is cast if the caster is is the first column of the hashtable and stuff happen to the linked units (same line).

I hope you understand my point ^^ otherwise I could show it with simple GUI triggers if you want. (but I never opened SC2 editor so it would be wc3 for the example)

Hope you're doing fine !
 
Level 27
Joined
Jul 6, 2008
Messages
11,326
Hey Tleno ;) Long time no see !
You can make a hashtable which stores the casters on the first column and the units attached to it in the according line.
Then with other triggers detecting units order, you check for example when a certain spell is cast if the caster is is the first column of the hashtable and stuff happen to the linked units (same line).

I hope you understand my point ^^ otherwise I could show it with simple GUI triggers if you want. (but I never opened SC2 editor so it would be wc3 for the example)

Hope you're doing fine !
Thanks GolluM, nice to see you're still around! In any case, erm, I was thinking of achieving this with data - I mean, abilities like Adept's psionic transfer seem to have some sort of connection that work two ways without trigger involvement.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
You can make a hashtable which stores the casters on the first column and the units attached to it in the according line.
This makes no sense. What on earth is a hashtable in StarCraft II?

You need to explain what you mean by "leash" more clearly. Some stuff from Heroes of the Storm might help as there they have various pets, camps and abilities which can be described as leashing.

If you want a unit to stay within a certain distance of another unit you can give that unit a behaviour with a distance comparison validator, which if the unit is beyond a certain distance it either teleports (aka Diablo 2 style, with appropriate effect) or orders it to move to the source unit.
 
Level 27
Joined
Jul 6, 2008
Messages
11,326
This makes no sense. What on earth is a hashtable in StarCraft II?

You need to explain what you mean by "leash" more clearly. Some stuff from Heroes of the Storm might help as there they have various pets, camps and abilities which can be described as leashing.

If you want a unit to stay within a certain distance of another unit you can give that unit a behaviour with a distance comparison validator, which if the unit is beyond a certain distance it either teleports (aka Diablo 2 style, with appropriate effect) or orders it to move to the source unit.
Well I just want to have units keep track of who affected them by certain behaviours. Say, I have a caster unit. It casts an ability applying behaviour onto the target unit. You have multiple casters of same type, they all target different units. I pick one of casters, and use its instant efect ability that only affects the unit it previously targeted, applying certain effect to it - not other targets affected by other casters, just it. I figured I can use Nova's dominate persistent to keep track of whether caster and target are both alive, but I want to expand it further. Also, this particular persistent checks whether caster and target are alive every 0.2 seconds, should I lenghten the period if I intend on using many units "leashed" to one another this way?
 
Level 27
Joined
Jul 6, 2008
Messages
11,326
Triggers could be used for the instant effect ability. You can pull the caster and target units from a behaviour and use them to run another effect from caster to target with the appropriate trigger action.
Can you do it with just data? I have trouble understanding it's proper mechanism, but it seems Protoss Adept has something like that.
 
Status
Not open for further replies.
Top