Ok heres a little video, well i make reaper change his height when i click the button ,but, height changes doesn't make him flying unit and doesn't change his line of sight, maybe theres way to change it when his height level is high enough? and switch it back when he grounds? I didn't found way myself.
If willuwontu's suggestion does not work you could try and give it a morph ability which morph's it to a flying version (Viking style). This would be more MUI than his suggestion as it would support multiple such units per player.
To answer the question we must define what makes a unit to air unit in starcraft 2.
1 Height: The Height of the unit, but it's only visual effect, don't effect anything else. This effect can modified by upgrade or modify unit effect or buff behavior. So it can be used.
2 Plane array: what kind of weapons and abilities effect etc. can target it. Two options here: Air or Ground. So it is air. Without this option a ground melee unit can hit an air unit. it can be changed with upgrade or buff behavior.
3. Movement: It affect on search path, a flying unit ignores every terrain doodad or ground unit, when search a path, just fly over them. It can only modified by upgrade, I found a Jump type behavior that can modify it but simply movement change dont make it fly unit. However it is good option to make jump ability, but it not solves your problem.
4 Collide: it gives what unit types can't be in the same place at the same time, the units that have a same collide can't be in the same place at the same time, air collides a little bit different, they can cross each other or stack/split in(mutalisk stack when player harrassing with mutalisks) while moving, but when they ordered to stop they split out. It can be modified only with upgrade.
So currently you can't change movement and collide to be toogleable, just change with upgrades permanently. If a patch later on make them modifyable with some functions you will can change but until then you can use only transform (morph) ability like viking does and you can change these properties in the second reaper that is flying, and then fly up is equal to a morph abilit that turn ground reaper to flying reaper, and Landing is equal to a morph ability that turn flying reaper into a ground reaper.
ok, what I'm trying to do is change everything and make unit complete Air unit, with movement collide and flags and los, everything, heres trigger i use to change heigh:
As u see in video i met problem, by some reason my trigger morph my unit only if its not moving, u have to stop so it can check ur height and morph ur character and i don't understand why it happens, if i keep changing height while moving, my char won't morph at all, whats the problem?
I suggest you ditch the morph ability and use catalog values to change movers and collisions. This works especially well if the player is only controlling 1 of the unit since it will change the values for all units of that type for that player, which it looks like you're doing.
Here the unit type Raynor01 is becoming uncollidable with cliffs and... I think force fields? I don't remember, but you can look up the order by looking at collisions in the data editor under the unit. Like what willuwontu said you can do this for movement too.
For my map I also made my units ignore terrain height so that if they flew over a higher cliff they wouldn't automatically fly up with that cliff, but that's because I was dealing with projectiles that were moving in a path.
UnitSetState(u, c_unitStateIgnoreTerrainZ, true);
If you do this you also have to set the unit height to be desired fly height + world height @ point.
I'm not completely certain. You can flip through all the catalog options for unit types to see if you can change how LOS works. Honestly I don't deal with data very often so I don't know how LOS works in the first place haha.
I'm not completely certain. You can flip through all the catalog options for unit types to see if you can change how LOS works. Honestly I don't deal with data very often so I don't know how LOS works in the first place haha.
Am i doing it right?
CatalogReferenceSet(Unit,UNIT_VULTURE_GROUND,Mover, (PlayerGroupLoopCurrent()), "Fly")
can't figure out what to do with collide, it looks like this
Change the second parameter to your desired unit type
Change the third parameter to "Collide", so the Scope is Generic (CUnit), the Field is Collide, and the Index represents the # representation of the collide type.
I don't know if it changes per unit type, but it shouldn't. For example #8 = Ground, #1 = Burrow. I found these numbers by going into the Data Editor, finding my unit, opening the Collide reference and numbering them off from top to bottom (burrow is the first option, and ground is the eighth).
Then when it says to "", put either a 0 or 1 in the value. I believe 0 is disabled and 1 is enabled.
After this the code should look like "Set value of Units Reaper Collide[8] for player ( Triggering Player ) to "1""
This makes all Reapers for the triggering player collide with ground. If the 1 were a 0 they would no longer collide with ground.
Change the second parameter to your desired unit type
Change the third parameter to "Collide", so the Scope is Generic (CUnit), the Field is Collide, and the Index represents the # representation of the collide type.
I don't know if it changes per unit type, but it shouldn't. For example #8 = Ground, #1 = Burrow. I found these numbers by going into the Data Editor, finding my unit, opening the Collide reference and numbering them off from top to bottom (burrow is the first option, and ground is the eighth).
Then when it says to "", put either a 0 or 1 in the value. I believe 0 is disabled and 1 is enabled.
After this the code should look like "Set value of Units Reaper Collide[8] for player ( Triggering Player ) to "1""
This makes all Reapers for the triggering player collide with ground. If the 1 were a 0 they would no longer collide with ground.
That is good solution indeed, I dont suggested it earlier because, it changes all other reaper's settings(as Juxtapozition mentioned it earlier), including enemy one, etc but if you dont use other reapers it can be used.
Ok heres a little video, well i make reaper change his height when i click the button ,but, height changes doesn't make him flying unit and doesn't change his line of sight, maybe theres way to change it when his height level is high enough? and switch it back when he grounds? I didn't found way myself.
use catalog functions to change his mover to air instead of ground.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
If willuwontu's suggestion does not work you could try and give it a morph ability which morph's it to a flying version (Viking style). This would be more MUI than his suggestion as it would support multiple such units per player.
@uroboros1987: Go
To answer the question we must define what makes a unit to air unit in starcraft 2.
1 Height: The Height of the unit, but it's only visual effect, don't effect anything else. This effect can modified by upgrade or modify unit effect or buff behavior. So it can be used.
2 Plane array: what kind of weapons and abilities effect etc. can target it. Two options here: Air or Ground. So it is air. Without this option a ground melee unit can hit an air unit. it can be changed with upgrade or buff behavior.
3. Movement: It affect on search path, a flying unit ignores every terrain doodad or ground unit, when search a path, just fly over them. It can only modified by upgrade, I found a Jump type behavior that can modify it but simply movement change dont make it fly unit. However it is good option to make jump ability, but it not solves your problem.
4 Collide: it gives what unit types can't be in the same place at the same time, the units that have a same collide can't be in the same place at the same time, air collides a little bit different, they can cross each other or stack/split in(mutalisk stack when player harrassing with mutalisks) while moving, but when they ordered to stop they split out. It can be modified only with upgrade.
So currently you can't change movement and collide to be toogleable, just change with upgrades permanently. If a patch later on make them modifyable with some functions you will can change but until then you can use only transform (morph) ability like viking does and you can change these properties in the second reaper that is flying, and then fly up is equal to a morph abilit that turn ground reaper to flying reaper, and Landing is equal to a morph ability that turn flying reaper into a ground reaper.
@ragadozo444: Go
ok, what I'm trying to do is change everything and make unit complete Air unit, with movement collide and flags and los, everything, heres trigger i use to change heigh:
and i also used Imperial God's Morp idea, and it works just perfect, so its Solved now, heres trigger
As u see in video i met problem, by some reason my trigger morph my unit only if its not moving, u have to stop so it can check ur height and morph ur character and i don't understand why it happens, if i keep changing height while moving, my char won't morph at all, whats the problem?
Btw now I'm changing LOS only
Could it be becuz moving breaking morph ability cast? Even if it's instant with no prepare, cast or finish?
Probably, what you could do is replace the unit instead of morphing it.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
I suggest you ditch the morph ability and use catalog values to change movers and collisions. This works especially well if the player is only controlling 1 of the unit since it will change the values for all units of that type for that player, which it looks like you're doing.
Just ripping some code from my old map:
CatalogFieldValueSet(c_gameCatalogUnit, "Raynor01","Collide[1]", UnitGetOwner(u), "0");
CatalogFieldValueSet(c_gameCatalogUnit, "Raynor01","Collide[8]", UnitGetOwner(u), "0");
Here the unit type Raynor01 is becoming uncollidable with cliffs and... I think force fields? I don't remember, but you can look up the order by looking at collisions in the data editor under the unit. Like what willuwontu said you can do this for movement too.
For my map I also made my units ignore terrain height so that if they flew over a higher cliff they wouldn't automatically fly up with that cliff, but that's because I was dealing with projectiles that were moving in a path.
UnitSetState(u, c_unitStateIgnoreTerrainZ, true);
If you do this you also have to set the unit height to be desired fly height + world height @ point.
TY!! I'll try it, what about LOS? Can I uncheck this flag somehow?
@uroboros1987: Go
I'm not completely certain. You can flip through all the catalog options for unit types to see if you can change how LOS works. Honestly I don't deal with data very often so I don't know how LOS works in the first place haha.
Am i doing it right? CatalogReferenceSet(Unit,UNIT_VULTURE_GROUND,Mover, (PlayerGroupLoopCurrent()), "Fly") can't figure out what to do with collide, it looks like this
look at screenshot
@uroboros1987: Go
Use the trigger action "Catalog Field Value Set"
Change the first parameter to "Units"
Change the second parameter to your desired unit type
Change the third parameter to "Collide", so the Scope is Generic (CUnit), the Field is Collide, and the Index represents the # representation of the collide type.
I don't know if it changes per unit type, but it shouldn't. For example #8 = Ground, #1 = Burrow. I found these numbers by going into the Data Editor, finding my unit, opening the Collide reference and numbering them off from top to bottom (burrow is the first option, and ground is the eighth).
Then when it says to "", put either a 0 or 1 in the value. I believe 0 is disabled and 1 is enabled.
After this the code should look like "Set value of Units Reaper Collide[8] for player ( Triggering Player ) to "1""
This makes all Reapers for the triggering player collide with ground. If the 1 were a 0 they would no longer collide with ground.
Ty man
That is good solution indeed, I dont suggested it earlier because, it changes all other reaper's settings(as Juxtapozition mentioned it earlier), including enemy one, etc but if you dont use other reapers it can be used.
@ragadozo444: Go
Actually catalog changes are applied to specific players, so as long as that player only has 1 reaper it's fine.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
@willuwontu: Go
Yeah I realized that when I read again the triggers. :)