Okay, so I've got a trigger set up and I'm looking for it to do 2 things. It does 0.5 of that correctly.
Get Oxygen 01
Events
Unit - Any Unit Enters Oxygen Gain 01
Local Variables
Conditions
Oxygen == false
Actions
Actor - Attach Mobile Oxygen Field to Head on (Triggering unit)
Variable - Set Oxygen Bubble = (Last created actor)
Environment - Set time of day to 21:00:00
Variable - Set Oxygen = true
This is the 0.5 that it does correctly. It properly attaches the Oxygen Bubble, but for some reason; however eventually the bubble goes away. I'd rather just attach the model rather than making a whole unit out of it because when it creates the model the bubble does it's spawning animation, but when I did it as a unit it was just instant on the character. Same thing when it came to removing it through triggers.
How do I make it so the model doesn't automatically go away? What it seems like to me is that it's playing through all of it's animations: birth, stand, then death.
This doesn't manage to work at all. I've got 5 different lights set up based on time but it doesn't seem to change the lighting when it changes the time. On map initialization I have it set to the proper light set. Should I just scrap the idea of changing the time and just constantly change the light set and make each of those times their own light set?
Well, the strange thing is that if I turn the bubble into a unit and attach the unit, it'll play 'stand' for forever, but it won't play the 'birth' and 'death' animation. It's like it's only creating a one-shot model to play through all of it's animations and dies, even if I tell it to play 'stand' forever. I think I'm going to have to read up on the data editing tutorials and figure out how to make the unit play it's animation on birth and death since that seems like it's the only way to maintain the bubble model.
For those that know the data editor, I thought I'd throw this out there because maybe that's part of it, but the model type is based on 'PersistantSpellFX.' I tried changing it's parent to 'Unit' to see if that would make a difference and it didn't.
Do you need the bubble to move and play its animation? or is it just frozen and then dies?
Again you can if you like freeze the animation after it is created. In the actor Events +
you can use an event ActorCreation and an action - Animation set paused.
If you want to freeze it in the middle of the animation, and not at actor creation, then the event should be Age Reached
I was just using a pure model, there was no actor involved. The actor was a generic actor being created through the trigger 'attach model to unit.' If I start to play with actors, which I think I'm going to do for this, I might as well see if I can get it to play it's birth before creating it.
I would rather it play it's animation to make it look nicer, it would look a little strange if the animation was frozen.
Events
Unit - Any Unit Enters Oxygen Gain 02
Local Variables
Conditions
Oxygen == false
Actions
Variable - Set Oxygen = true
Actor - Attach Mobile Oxygen Field to Head on (Triggering unit) (This is the actual Attach Actor action rather than Attach Model)
Variable - Set Oxygen Bubble = (Last created actor)
Environment - Set lighting to Castanar (Outside), blending over 3.0 seconds
The lighting changes now, which makes me a happy camper, so that is solved.
I added a couple of events to the actor's data and it plays the birth animation now; however, I'm having a problem killing the actor now. Killing the model when I was using that was cake and to me, logic dictates that the method in which I had to kill the model (by killing the generic actor it created) should be the same method to kill this actor. But for some reason it's not doing the trick.
Here is the removal trigger.
Events
Unit - Any Unit Enters Oxygen Lose 02
Local Variables
Conditions
Oxygen == true
Actions
Variable - Set Oxygen = false
Environment - Set lighting to Castanar (Default), blending over 3.0 seconds
Actor - Kill actor model Oxygen Bubble
'Oxygen Bubble' is a global variable I'm using to store the actor that is being created. When I was attaching a model, it worked fine with storing the generic actor and killing it. That is not the case when I'm using the actual actor.
In the data editor, this is what I have going on for Actor Events
Actor Creation
Create SoundEmitter Doodad_OxygenField
Actor Creation
AnimPlay Birth Birth
Actor Creation
AnimPlay Stand Stand PlayForever
Actor Destruction
AnimPlay Death Death
Actor Destruction
Destroy
That kill actions only work with generic model. For actors, you need to send message to them, something like suicide or such. ( I dont know about these things). Actor in sc2 is like, actor who act on the game.
That kill actions only work with generic model. For actors, you need to send message to them, something like suicide or such. ( I dont know about these things). Actor in sc2 is like, actor who act on the game.
Awesome little tip, was able to send it a message to play it's death animation; however, if I sent it a message to 'Destroy' it crashes my game. I'm just curious if anyone else has that problem with getting an actor to die, if it's something with my actor/model (not the other way around), or if something of mine is just damaged, like my install, and needs a repair.
Here is a recreation of what's going down in my map.
Okay, posting this just in case someone else has this issue, because I know I won't be the only one to goober this. Then again it could just be something on my end that didn't like what was happening.
My game was crashing upon issuing a message to the actor to 'Destroy' itself because there already was an actor event for ActorDestruction -> destroy. As soon as I removed that actor event the message stopped crashing my game and the actor now destroys properly.
However, it doesn't want to play the death animation through the actor event ActorDestruction -> PlayAnim. I have to send a message to the actor to play that animation and do a wait timer for it's duration before nuking the thing.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Okay, so I've got a trigger set up and I'm looking for it to do 2 things. It does 0.5 of that correctly.
Get Oxygen 01
Events
Unit - Any Unit Enters Oxygen Gain 01
Local Variables
Conditions
Oxygen == false
Actions
Actor - Attach Mobile Oxygen Field to Head on (Triggering unit)
Variable - Set Oxygen Bubble = (Last created actor)
Environment - Set time of day to 21:00:00
Variable - Set Oxygen = true
This is the 0.5 that it does correctly. It properly attaches the Oxygen Bubble, but for some reason; however eventually the bubble goes away. I'd rather just attach the model rather than making a whole unit out of it because when it creates the model the bubble does it's spawning animation, but when I did it as a unit it was just instant on the character. Same thing when it came to removing it through triggers.
How do I make it so the model doesn't automatically go away? What it seems like to me is that it's playing through all of it's animations: birth, stand, then death.
This doesn't manage to work at all. I've got 5 different lights set up based on time but it doesn't seem to change the lighting when it changes the time. On map initialization I have it set to the proper light set. Should I just scrap the idea of changing the time and just constantly change the light set and make each of those times their own light set?
I'm guessing the bubble's "stand" animation isn't permanent, so you should freeze its animation after its created.
@38dedo: Go
Well, the strange thing is that if I turn the bubble into a unit and attach the unit, it'll play 'stand' for forever, but it won't play the 'birth' and 'death' animation. It's like it's only creating a one-shot model to play through all of it's animations and dies, even if I tell it to play 'stand' forever. I think I'm going to have to read up on the data editing tutorials and figure out how to make the unit play it's animation on birth and death since that seems like it's the only way to maintain the bubble model.
For those that know the data editor, I thought I'd throw this out there because maybe that's part of it, but the model type is based on 'PersistantSpellFX.' I tried changing it's parent to 'Unit' to see if that would make a difference and it didn't.
Do you need the bubble to move and play its animation? or is it just frozen and then dies?
Again you can if you like freeze the animation after it is created. In the actor Events + you can use an event ActorCreation and an action - Animation set paused.
If you want to freeze it in the middle of the animation, and not at actor creation, then the event should be Age Reached
@38dedo: Go
I was just using a pure model, there was no actor involved. The actor was a generic actor being created through the trigger 'attach model to unit.' If I start to play with actors, which I think I'm going to do for this, I might as well see if I can get it to play it's birth before creating it.
I would rather it play it's animation to make it look nicer, it would look a little strange if the animation was frozen.
Okay, so here's what I've got going on now.
Events
Unit - Any Unit Enters Oxygen Gain 02
Local Variables
Conditions
Oxygen == false
Actions
Variable - Set Oxygen = true
Actor - Attach Mobile Oxygen Field to Head on (Triggering unit) (This is the actual Attach Actor action rather than Attach Model)
Variable - Set Oxygen Bubble = (Last created actor)
Environment - Set lighting to Castanar (Outside), blending over 3.0 seconds
The lighting changes now, which makes me a happy camper, so that is solved.
I added a couple of events to the actor's data and it plays the birth animation now; however, I'm having a problem killing the actor now. Killing the model when I was using that was cake and to me, logic dictates that the method in which I had to kill the model (by killing the generic actor it created) should be the same method to kill this actor. But for some reason it's not doing the trick.
Here is the removal trigger.
Events
Unit - Any Unit Enters Oxygen Lose 02
Local Variables
Conditions
Oxygen == true
Actions
Variable - Set Oxygen = false
Environment - Set lighting to Castanar (Default), blending over 3.0 seconds
Actor - Kill actor model Oxygen Bubble
'Oxygen Bubble' is a global variable I'm using to store the actor that is being created. When I was attaching a model, it worked fine with storing the generic actor and killing it. That is not the case when I'm using the actual actor.
In the data editor, this is what I have going on for Actor Events
Actor Creation
Create SoundEmitter Doodad_OxygenField
Actor Creation
AnimPlay Birth Birth
Actor Creation
AnimPlay Stand Stand PlayForever
Actor Destruction
AnimPlay Death Death
Actor Destruction
Destroy
Seems like more people are coming online. Curious if anyone knows what I'm doing wrong and why the trigger isn't killing the actor.
That kill actions only work with generic model. For actors, you need to send message to them, something like suicide or such. ( I dont know about these things). Actor in sc2 is like, actor who act on the game.
@progammer: Go
Alright, I'll play around with it. Of course the generic actor is easy to kill since that's the one that eventually drops it's animation.
Thanks for the tip.
Awesome little tip, was able to send it a message to play it's death animation; however, if I sent it a message to 'Destroy' it crashes my game. I'm just curious if anyone else has that problem with getting an actor to die, if it's something with my actor/model (not the other way around), or if something of mine is just damaged, like my install, and needs a repair.
Here is a recreation of what's going down in my map.
@Mienk: Go
Okay, posting this just in case someone else has this issue, because I know I won't be the only one to goober this. Then again it could just be something on my end that didn't like what was happening.
My game was crashing upon issuing a message to the actor to 'Destroy' itself because there already was an actor event for ActorDestruction -> destroy. As soon as I removed that actor event the message stopped crashing my game and the actor now destroys properly.
However, it doesn't want to play the death animation through the actor event ActorDestruction -> PlayAnim. I have to send a message to the actor to play that animation and do a wait timer for it's duration before nuking the thing.