I wasn't sure where to put my topic but since it's most likely a problem in Data (animations references), I'll ask here.
In my Ikari Warriors project, units can cross a river. When they're in deep water I want them to either be invisible (even to their owner), or to replace the model of the unit to illustrate that the unit is not over the surface (with a shadow blob over its head or something like that).
I tried the Hide Unit action, which would have been a good start if it allowed to keep control of the unit. But it doesn't. Let's drop this.
I tried to replace the model of the unit by a Tetrahedron, which is kind of perfect (because you actually see where you're going, you keep control of the unit, and you still understand you're under the surface).
But when I restore the original unit model (dark zealot, OR marine, depends on which unit is in water) it seems to have lost its stand/walk animations. When the unit starts attacking the animation is still here, but any use of the stand and walk animations seems broken after switching the model and restoring it afterwards. It is most likely because a Tetrahedron doesn't have a stand/walk animation, I guess...
Maybe there is a way to apply a behavior that will do all of this without screwing with the animations? If you know how, please tell me. I'm pretty sure there is a way to either keep the animations references somewhere or restore them through triggers when the unit comes out of water. But so far, no luck.
Do you know of any way to make it look like a unit is diving? I'm kind of lost here because I don't know how I could actually show that the unit is underwater... Everything I try just seem to blow the whole thing up, so I'm probably doing it wrong. If you need more info (screenshot of the trigger maybe), just ask. :)
Just wanted to comment I had this same problem with the Dark Zealot when switching models from a Zealot to Dark Zealot, so you can rule out the Tetrahedron being the problem. It's possibly a glitch. Try testing with other units, ie: Zealot, Marine, Firebat, Dark Templar, etc and see if the same thing happens. If it does, then it's probably something intentional and you need to reapply the walk animations to the models. If it doesn't, it's most likely an oversight.
Now, go into the unit's Actor and create the following Events +
Behavior.Diving.On
Set Opacity 0 over 0
Bheavior.Diving.Off
Set Opacity 1 over 0
you can tweak the "opacity blend time" or whatever to suit your need.
Second, create a new Actor, Model based on ModelAddition. Host + set to _Selectable, and set the Site Operations + as SOpAttachHead. Set your Model to Tetrahedron or whatever you like.
modify Events +
Behavior.Diving.On
Create
Behavior.Diving.Off
Destroy
That should be pretty close to what you want. I'm going from the top of my head and there might be a little thing or 2 to tweak, but I'm fairly certain this will create what you want, without actually "hiding" the unit or whatever else. Just turn it invisible and attach a model to it so you can keep track of it's location visually. And then when it isn't diving, it becomes visible and the attached model is destroyed.
I'll try it tomorrow and see how it goes. I was pretty sure there was something simple to do, I wasn't expecting the opacity would be in the events of a behavior but it's obvious now... I tried multiple times to understand how the attachment methods work too, it's my peeve since I opened the SC2 Editor for the first time... Which is probably why I HATE having to edit anything in these fields... By the way BorgDragon, the part where you explain how to attach a model to a unit using Data will probably be useful in my Sandworm Survival game too. I was using 4 useless actions in a trigger to attach effects to my worm.
Thanks SoulCarveRR, but I think I'll stick to BorgDragon's method since it does exactly what I wanted (it just fits better in this project).
There are still a few things to modify though. It seems the attached model inherits its opacity from the unit. So when my unit dives, the Tetrahedron shows but its opacity is the same as the unit. I tried adding an event to reset the opacity of the shape to 1 but no dice, it seems to be linked to the opacity value of the unit. I also see the shadows of the invisible unit and the tetrahedron, I wonder if there is an event that can hide them too... Aside from that, it's exactly what I wanted. I still have to add a few other things in the behavior in order to fit my expectations (ex: reducing line of sight + disabling weapons) but I already know where it's done so that's no big deal. I'm much more worried about hiding the shadows and having the Tetrahedron show properly...
There's a flag on the ModelAddition actor, Inheritance or something like that, I believe it's near the bottom of the list of modifiable fields. There should be boxes, just uncheck Opacity and Opacity (Local) or whatnot.
Should be able to remove shadows while "diving" aswell, but I've never tried to do that before. Probably an event that has to do with ShadowBlob or whatnot. I remember seeing some actions/messages in the Events + for actual shadows.
You're right, the Inheritance options are actually last in the list of fields. It's in Properties - Inherited Properties. About the events to hide shadows of the diving unit actor, you need to add an event "Set Cast Shadows" to Disable/Enable when the behavior is toggled ON/OFF.
Thanks for the help, another problem solved!
Ikari Warriors v1.0 will be out very, very soon now. :D
I'll add you to the "many thanks goes to" list.
I wasn't sure where to put my topic but since it's most likely a problem in Data (animations references), I'll ask here.
In my Ikari Warriors project, units can cross a river. When they're in deep water I want them to either be invisible (even to their owner), or to replace the model of the unit to illustrate that the unit is not over the surface (with a shadow blob over its head or something like that).
I tried the Hide Unit action, which would have been a good start if it allowed to keep control of the unit. But it doesn't. Let's drop this.
I tried to replace the model of the unit by a Tetrahedron, which is kind of perfect (because you actually see where you're going, you keep control of the unit, and you still understand you're under the surface).
But when I restore the original unit model (dark zealot, OR marine, depends on which unit is in water) it seems to have lost its stand/walk animations. When the unit starts attacking the animation is still here, but any use of the stand and walk animations seems broken after switching the model and restoring it afterwards. It is most likely because a Tetrahedron doesn't have a stand/walk animation, I guess...
Maybe there is a way to apply a behavior that will do all of this without screwing with the animations? If you know how, please tell me. I'm pretty sure there is a way to either keep the animations references somewhere or restore them through triggers when the unit comes out of water. But so far, no luck.
Do you know of any way to make it look like a unit is diving? I'm kind of lost here because I don't know how I could actually show that the unit is underwater... Everything I try just seem to blow the whole thing up, so I'm probably doing it wrong. If you need more info (screenshot of the trigger maybe), just ask. :)
@ZealNaga: Go
Just wanted to comment I had this same problem with the Dark Zealot when switching models from a Zealot to Dark Zealot, so you can rule out the Tetrahedron being the problem. It's possibly a glitch. Try testing with other units, ie: Zealot, Marine, Firebat, Dark Templar, etc and see if the same thing happens. If it does, then it's probably something intentional and you need to reapply the walk animations to the models. If it doesn't, it's most likely an oversight.
@ZealNaga: Go
You can do this very simple.
Apply your behavior when the unit is diving.
Now, go into the unit's Actor and create the following Events +
you can tweak the "opacity blend time" or whatever to suit your need.
Second, create a new Actor, Model based on ModelAddition.
Host + set to _Selectable, and set the Site Operations + as SOpAttachHead. Set your Model to Tetrahedron or whatever you like.
modify Events +
That should be pretty close to what you want. I'm going from the top of my head and there might be a little thing or 2 to tweak, but I'm fairly certain this will create what you want, without actually "hiding" the unit or whatever else. Just turn it invisible and attach a model to it so you can keep track of it's location visually. And then when it isn't diving, it becomes visible and the attached model is destroyed.
@BorgDragon: Go
Thanks to you 2. :)
I'll try it tomorrow and see how it goes. I was pretty sure there was something simple to do, I wasn't expecting the opacity would be in the events of a behavior but it's obvious now... I tried multiple times to understand how the attachment methods work too, it's my peeve since I opened the SC2 Editor for the first time... Which is probably why I HATE having to edit anything in these fields... By the way BorgDragon, the part where you explain how to attach a model to a unit using Data will probably be useful in my Sandworm Survival game too. I was using 4 useless actions in a trigger to attach effects to my worm.
Just to clarify, Behaviors have no Events + field.
It's all done in the Actor's Events + field.
By telling the Zealot's Actor to set opacity to 0 when the Behavior 'Diving' is on it, is how you control that.
And then telling your ModelAddition Actor to be created on the host when the same behavior is on completes your effect.
Or you could create an actor for the specific behavior. Then you could have it apply one the "rocker actors" to the unit to make it look like its actually swimming. http://forums.sc2mapster.com/resources/tutorials/15253-tutorial-data-the-roll-copter-drunk-marauder-etc-by/
@SouLCarveRR: Go
Personally I think those rocker actors just look... bleh.
But that is also an option.
@BorgDragon: Go
The examples look bleh... but you can do some awesome stuff with them.
@SouLCarveRR: Go
Thanks SoulCarveRR, but I think I'll stick to BorgDragon's method since it does exactly what I wanted (it just fits better in this project). There are still a few things to modify though. It seems the attached model inherits its opacity from the unit. So when my unit dives, the Tetrahedron shows but its opacity is the same as the unit. I tried adding an event to reset the opacity of the shape to 1 but no dice, it seems to be linked to the opacity value of the unit. I also see the shadows of the invisible unit and the tetrahedron, I wonder if there is an event that can hide them too... Aside from that, it's exactly what I wanted. I still have to add a few other things in the behavior in order to fit my expectations (ex: reducing line of sight + disabling weapons) but I already know where it's done so that's no big deal. I'm much more worried about hiding the shadows and having the Tetrahedron show properly...
@ZealNaga: Go
There's a flag on the ModelAddition actor, Inheritance or something like that, I believe it's near the bottom of the list of modifiable fields. There should be boxes, just uncheck Opacity and Opacity (Local) or whatnot.
Should be able to remove shadows while "diving" aswell, but I've never tried to do that before. Probably an event that has to do with ShadowBlob or whatnot. I remember seeing some actions/messages in the Events + for actual shadows.
@BorgDragon: Go
You're right, the Inheritance options are actually last in the list of fields. It's in Properties - Inherited Properties. About the events to hide shadows of the diving unit actor, you need to add an event "Set Cast Shadows" to Disable/Enable when the behavior is toggled ON/OFF.
Thanks for the help, another problem solved!
Ikari Warriors v1.0 will be out very, very soon now. :D
I'll add you to the "many thanks goes to" list.