For my map, i am making a unit which is meant to be capable of passing through other units while it is moving, while regaining collision if it is stationary.
The way I'm handling this is with a Buff behavior which modifies the State Flag 'Suppress Collision', which reduces the unit's collision radius to 0.
This works, more or less. When it's moving, it'll gain the buff and pass through other units, then it'll become solid while it's stationary. Unfortunately, doing it this way makes it so groups of this unit, of which you will be able to get many in the map, are able to pass through each-other, as they have no collision radius. I'd like to set it up differently, so despite not colliding with units of other types, they still can't stack up.
I'm at a bit of a loss as to 'how', though. Any help here would be appreciated.
[If there's another thread with the answer that i just wasn't able to find, link it to me?]
You could try giving them a seperate collision that is not disabled upon movement. I think the Aberration uses one of those, which allows it to walk over smaller Zerg units while still colliding with other Aberrations.
I 'could' give them the colossus-styled collision, which would let them interact with each-other while still passing through other units, but i still don't know how i could enable / disable that as needed. I've got to cover two states of collision here; [1] Colossus-style, [2] Regular ground unit. The problem is that i can't figure out how to have a unit switch between the two smoothly...
I imagine you could simulate the desired effect by using Morph abilites to switch between two units, identical except for their collision flags.
Let's say your unit is a Marine.
In this case, you would change the ID of the Marine to "MarineStanding" and add the Editor Suffix "(Standing)" to help you differentiate between the two. Duplicate your Marine (along with its actor) and change its name to "Marine" and ID to "MarineMoving", with the Editor Suffix "(Moving)". From here, uncheck all collision flags on the unit Marine (Moving) and check only one of the unused collision flags. This enables all Marine (Moving) units to collide with each other.
Create two buttions, one called "Moving Mode" and one called "Standing Mode". Icon and tooltips do not matter since these will be added into an inaccessible submenu on each unit's command card.
Next we need to add a Morph ability to enable them to switch between the two. Create a Morph ability called "Moving Mode". Under the (Basic) Stats: Flags + field you would check the Ignore Placement and Ignore Collision boxes. Set the button for Execute under the (Basic) Ability: Commands^ + field to Moving Mode. Under the (Basic) Ability: Info^ + field, right click and add a value, setting the unit to Marine (Moving Mode).
Repeat the above process, creating a Morph ability this time called "Standing Mode" and setting the parameters accordingly.
Duplicate the "Not Moving" validator and rename it "Moving". Change the (Basic) Validator: Compare field to Greater Than.
Add an Issue Order effect called "Morph to Moving Mode". Add the validator "Not Moving" in the Effect: Validators + field. Set the (Basic) Effect: Ability field to Moving Mode and the (Basic) Effect: Unit + field to Caster. Repeat this step, calling the effect "Morph to Standing Mode", validator Moving, and ability "Standing Mode".
Create a Buff behavior called "Marine Moving". Set the (Basic) Stats: Period^ field to 0.0625. Set the (Basic) Effect: Effect - Periodic field to Morph to Moving Mode. Set the (Basic) Behavior: Validators (Disable) + field to Moving. Repeat this step with another Buff behavior called "Marine Standing", filling in the appropriate fields.
Now back to the Units tab. Add a separate command card to the Marine (Moving) unit. Add the Standing Mode ability to its ability array. Create a new command card and add the Standing Mode button with the Standing Mode ability. Add both the Marine Moving and Marine Standing behaviors to its behavior array. Repeat this step with the Marine (Standing) unit, adding the ability Moving Mode to a new command card in addition to both behaviors.
You should now have the functionality you are looking for... I did this to accomplish something similar: I had a small unit with a large shield model and a radius that matched the shield model. Upon running out of shields, it automatically lowered its radius, so that units had to move closer in to attack it.
For my map, i am making a unit which is meant to be capable of passing through other units while it is moving, while regaining collision if it is stationary.
The way I'm handling this is with a Buff behavior which modifies the State Flag 'Suppress Collision', which reduces the unit's collision radius to 0.
This works, more or less. When it's moving, it'll gain the buff and pass through other units, then it'll become solid while it's stationary. Unfortunately, doing it this way makes it so groups of this unit, of which you will be able to get many in the map, are able to pass through each-other, as they have no collision radius. I'd like to set it up differently, so despite not colliding with units of other types, they still can't stack up.
I'm at a bit of a loss as to 'how', though. Any help here would be appreciated.
[If there's another thread with the answer that i just wasn't able to find, link it to me?]
You could try giving them a seperate collision that is not disabled upon movement. I think the Aberration uses one of those, which allows it to walk over smaller Zerg units while still colliding with other Aberrations.
I 'could' give them the colossus-styled collision, which would let them interact with each-other while still passing through other units, but i still don't know how i could enable / disable that as needed. I've got to cover two states of collision here; [1] Colossus-style, [2] Regular ground unit. The problem is that i can't figure out how to have a unit switch between the two smoothly...
I imagine you could simulate the desired effect by using Morph abilites to switch between two units, identical except for their collision flags.
Let's say your unit is a Marine.
In this case, you would change the ID of the Marine to "MarineStanding" and add the Editor Suffix "(Standing)" to help you differentiate between the two. Duplicate your Marine (along with its actor) and change its name to "Marine" and ID to "MarineMoving", with the Editor Suffix "(Moving)". From here, uncheck all collision flags on the unit Marine (Moving) and check only one of the unused collision flags. This enables all Marine (Moving) units to collide with each other.
Create two buttions, one called "Moving Mode" and one called "Standing Mode". Icon and tooltips do not matter since these will be added into an inaccessible submenu on each unit's command card.
Next we need to add a Morph ability to enable them to switch between the two. Create a Morph ability called "Moving Mode". Under the (Basic) Stats: Flags + field you would check the Ignore Placement and Ignore Collision boxes. Set the button for Execute under the (Basic) Ability: Commands^ + field to Moving Mode. Under the (Basic) Ability: Info^ + field, right click and add a value, setting the unit to Marine (Moving Mode).
Repeat the above process, creating a Morph ability this time called "Standing Mode" and setting the parameters accordingly.
Duplicate the "Not Moving" validator and rename it "Moving". Change the (Basic) Validator: Compare field to Greater Than.
Add an Issue Order effect called "Morph to Moving Mode". Add the validator "Not Moving" in the Effect: Validators + field. Set the (Basic) Effect: Ability field to Moving Mode and the (Basic) Effect: Unit + field to Caster. Repeat this step, calling the effect "Morph to Standing Mode", validator Moving, and ability "Standing Mode".
Create a Buff behavior called "Marine Moving". Set the (Basic) Stats: Period^ field to 0.0625. Set the (Basic) Effect: Effect - Periodic field to Morph to Moving Mode. Set the (Basic) Behavior: Validators (Disable) + field to Moving. Repeat this step with another Buff behavior called "Marine Standing", filling in the appropriate fields.
Now back to the Units tab. Add a separate command card to the Marine (Moving) unit. Add the Standing Mode ability to its ability array. Create a new command card and add the Standing Mode button with the Standing Mode ability. Add both the Marine Moving and Marine Standing behaviors to its behavior array. Repeat this step with the Marine (Standing) unit, adding the ability Moving Mode to a new command card in addition to both behaviors.
You should now have the functionality you are looking for... I did this to accomplish something similar: I had a small unit with a large shield model and a radius that matched the shield model. Upon running out of shields, it automatically lowered its radius, so that units had to move closer in to attack it.
Custom Campaign Initiative | Mapster Community Project: Data Wizards
Starcraft II: Unsung Rebels, a custom campaign for Starcraft II
SC2Saver, a way to create saved games via trigger
Frustrated with the editor and would like answers in real time? Join the SC2Mapster Discord!