This is for the Gorge - Web ability in my natural selection map. Basically if a unit crosses a web, it "breaks" the web and ensnares them.
I used a collision check behavior on a missile, constantly firing it from one invisible dummy unit to another, in order to check if any units pass a "line", in this case walking through the "web strand". Like a strand of spider silk.
My problem is that if the missile hits a target enemy and applies the "ensnared by web" behavior, the dummy unit that fired it needs to be destroyed.
This is a simplified layout of how I have it set up, for reference. This may not be necessary to answer my question, but perhaps it can offer insight.
The basic idea is:
Create dummy unit at target point of ability
Dummy unit spawns with behavior that immediately expires, causing it to search for another nearby dummy unit
If it finds another dummy unit, it is issued an order to attack the other dummy unit
The dummy unit's weapon launches a missile which has a behavior that periodically searches for nearby enemies
If the missile collides with an enemy, it applies the "Ensnared by Web" effect and kills itself
Unit: Web Dummy
Behavior: Web Strand Origin
Weapon: Web Strand
Weapon: Web Strand
Effect: Web Strand (Launch Missile)
Effect: Web Strand (Launch Missile)
Unit: Web Strand Projectile
Unit: Web Strand Projectile
Behavior: Web Strand Collide
Behavior: Web Strand Collide
Period: 0.125
Period count: -1
Periodic Effect: Web Strand Collision Check
Behavior: Web Strand Collision Check
Search - Arc: 360
Search - Radius: 0.5
Search - Effect: Web Strand Ensnare (Apply Behavior)
Search - Filter: Enemy, Not Structure, Missile, etc
Behavior: Web Strand Origin
Expire effect: Find Web Strand Target
Duration: 0.1
Effect: Find Web Strand Target
Search - Arc: 360
Search - Radius: 6
Search - Effect: Web Strand Attack Target Dummy (Issue Order)
Search - Filter: (filters for other dummy web launcher units)
Effect: Web Strand Attack Target Dummy
Ability: Attack
Ability Command: 0
Value: Target
If the missile collides, the dummy unit that fired the missile should die.
I copied the "Suicide" effect to make a "Kill Source" effect, changed the impact target "Source Unit", and tried calling that on the "Behavior - Death Response - Effect" of the "collision check" behavior.
Also tried it as "Search - Include - Source Unit", "Search - Include - Effect: Kill Source" on the "collision search" effect, also did not work.
I think having the "collision check" behavior automatically attached to the missile means that anything the "collision check" behavior triggers does not have any reference to the launching dummy unit.
tl;dr:
Unit fires missle
Missile has behavior to search area for unit collision and kill itself it if collides
If missile reaches target unit, nothing should happen
If missile search finds enemy with collision check, unit that launched missile should be destroyed
Try giving the missile unit a behaviour with the search function for other units, and an apply behaviour to the target unit on the launch ability. The missile search has a Unit Compare Behaviour Count validator that excludes the target unit.
As for the self destruct of the caster try having an apply buff to casting unit that is removed if the missile reaches the target dummy combined with a search on the web collision effect that kills any units with the buff?
An alternative would be to purely have the missile as a visual effect and to use a periodic effect to do all the dirty work since with the periodic effect you could link the apply web, destroy missile model and caster self destruct into the same effect tree.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
This is for the Gorge - Web ability in my natural selection map. Basically if a unit crosses a web, it "breaks" the web and ensnares them.
I used a collision check behavior on a missile, constantly firing it from one invisible dummy unit to another, in order to check if any units pass a "line", in this case walking through the "web strand". Like a strand of spider silk.
My problem is that if the missile hits a target enemy and applies the "ensnared by web" behavior, the dummy unit that fired it needs to be destroyed.
This is a simplified layout of how I have it set up, for reference. This may not be necessary to answer my question, but perhaps it can offer insight. The basic idea is:
Unit: Web Dummy
Weapon: Web Strand
Effect: Web Strand (Launch Missile)
Unit: Web Strand Projectile
Behavior: Web Strand Collide
Behavior: Web Strand Collision Check
Behavior: Web Strand Origin
Effect: Find Web Strand Target
Effect: Web Strand Attack Target Dummy
If the missile collides, the dummy unit that fired the missile should die.
I copied the "Suicide" effect to make a "Kill Source" effect, changed the impact target "Source Unit", and tried calling that on the "Behavior - Death Response - Effect" of the "collision check" behavior. Also tried it as "Search - Include - Source Unit", "Search - Include - Effect: Kill Source" on the "collision search" effect, also did not work.
I think having the "collision check" behavior automatically attached to the missile means that anything the "collision check" behavior triggers does not have any reference to the launching dummy unit.
tl;dr:
bump
Try giving the missile unit a behaviour with the search function for other units, and an apply behaviour to the target unit on the launch ability. The missile search has a Unit Compare Behaviour Count validator that excludes the target unit.
As for the self destruct of the caster try having an apply buff to casting unit that is removed if the missile reaches the target dummy combined with a search on the web collision effect that kills any units with the buff?
An alternative would be to purely have the missile as a visual effect and to use a periodic effect to do all the dirty work since with the periodic effect you could link the apply web, destroy missile model and caster self destruct into the same effect tree.
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