I'm somewhat new to the data side of the editor, so please forgive me if this seems a stupid question. I am creating a Mech style map with selectable arm weapons. I have run into a problem while creating one of the weapons and attaching it to the Mech unit.
When the player selects the 'Next' button to see the OmegaCannon weapon, the main OmegaCannon model is created and attaches just fine, but there is a second ModelAnimationStyleContinuous (Yamato charge-up) that is supposed to spawn inside the Omega Cannon model.
This model fails to show, until the player has clicked back and forth several times (consequently destroying and recreating the OmegaCannon actor). After the 2 or 3 repetitions, the Yamato animation finally shows up and is attached perfectly inside the OmegaCannon model.
Finally, continuing to toggle back and forth between Mech weapons will now properly spawn the Yamato animation, but will not destroy previous Yamato animations.
Here is a YouTube video as an example of what is happening (in the video, the OmegaCannon is the Vulcan Cannon):
Does anyone have any suggestions or ideas about possible causes? Thanks!!!!
Thanks for peeking in!! I use triggers and actor messages to create and attach the actors.
When the next button is clicked, the arm actors are cycled from a trigger using "Actor - Attach Actor to Unit"
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Actor - Send message "Destroy Immediate" to actor Players[l_PLayer].Hardpoint[l_PLayer_Selected_HardPoint].CurrentActorModel
Actor - Attach MechaItems[l_PLayer_Race][l_PLayer_Viewing_Item].Item_Actor_LEFT to Players[l_PLayer].Hardpoint[l_PLayer_Selected_HardPoint].AttachmentPoint on l_PLayer_Mecha
Variable - Set Players[l_PLayer].Hardpoint[l_PLayer_Selected_HardPoint].CurrentActorModel = (Last created actor)
-------------------------------------------------------------------------------------------------------------------------------------------------------------
.
.
.
.
That bit creates the main arm piece - called OmegaCannon (L). The Yamato animation (called OmegaCannonPretty) that I want created inside the cannon is created with actor events:
.
.
.
.
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Actor Name Actor Type Parent
OmegaCannon (L) Model CActorModel
Event:
Event 4 + ActorCreation:Create MechaOmegaCannonPretty
Actor Name Actor Type Parent
OmegaCannonPretty Model ModelAnimationStyleContinuous (None)
Hosting:
Host + OmegaCannon_L:Implicit:Implicit:(None):Disabled
Host Site Operations + SOpAttachWeapon01:Disabled:Disabled
-------------------------------------------------------------------------------------------------------------------------------------------------------------
The OmegaCannonPretty actor will eventually be created after cycling the arms - for some reason it just takes 2 or 3 cycles of previous/next. And then it won't die...
I must be doing something wrong, because I have a similar problem with attaching launch models for a different weapon. On the other weapon, the launch models won't appear until the weapon has fired two or three times, but then they work great!
I experienced similar issues post-1.5. I was able to fix them by creating the subsequent attachment actors within the primary attachment with an event like this:
Actor Creation
Create OmegaCannonPretty
instead of using the same event the primary attachment uses.
I tried that, but same result - the yamato animation only appears after the 3rd cycle. I may have messed though, so I'll go back and try that again.
DrSuperEvil, the only trigger I have that manipulates actors is that very short function, just those lines I pasted in. Maybe I'll try creating the main arm model and attaching it separately, instead of using "Actor - Attach Actor to Unit" to do it all in one go.
Looks like I found it - the Yamato charge up doesn't have a birth animation. By default, the ModelAnimationStyleContinuous I was using for the animation used the BSD AnimBracketState to play a birth animation on actor creation.
I changed the event to a Play animation: Stand and now it always appears! Gah, that was way too frustrating....
EDIT: It wasn't the animation, but actually the model type the ModelAnimationStyleContinuous Actor was referencing. Originally, I had created a model LaunchFX. After I switched the model type to a PersistentSpellFX, it worked everytime. The animation had NOTHING to do with it. I thought the model types just changed the preset values for the fields, so I don't know what field on the Model was the problem...
Now I just need to get it to Destroy when its host model is Destroyed...
Hello everyone,
I'm somewhat new to the data side of the editor, so please forgive me if this seems a stupid question. I am creating a Mech style map with selectable arm weapons. I have run into a problem while creating one of the weapons and attaching it to the Mech unit.
When the player selects the 'Next' button to see the OmegaCannon weapon, the main OmegaCannon model is created and attaches just fine, but there is a second ModelAnimationStyleContinuous (Yamato charge-up) that is supposed to spawn inside the Omega Cannon model.
This model fails to show, until the player has clicked back and forth several times (consequently destroying and recreating the OmegaCannon actor). After the 2 or 3 repetitions, the Yamato animation finally shows up and is attached perfectly inside the OmegaCannon model.
Finally, continuing to toggle back and forth between Mech weapons will now properly spawn the Yamato animation, but will not destroy previous Yamato animations.
Here is a YouTube video as an example of what is happening (in the video, the OmegaCannon is the Vulcan Cannon):
Does anyone have any suggestions or ideas about possible causes? Thanks!!!!
How are you getting your actors to be created? Are you applying a behaviour to the unit?
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
Thanks for peeking in!! I use triggers and actor messages to create and attach the actors.
When the next button is clicked, the arm actors are cycled from a trigger using "Actor - Attach Actor to Unit"
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Actor - Send message "Destroy Immediate" to actor Players[l_PLayer].Hardpoint[l_PLayer_Selected_HardPoint].CurrentActorModel
Actor - Attach MechaItems[l_PLayer_Race][l_PLayer_Viewing_Item].Item_Actor_LEFT to Players[l_PLayer].Hardpoint[l_PLayer_Selected_HardPoint].AttachmentPoint on l_PLayer_Mecha
Variable - Set Players[l_PLayer].Hardpoint[l_PLayer_Selected_HardPoint].CurrentActorModel = (Last created actor)
-------------------------------------------------------------------------------------------------------------------------------------------------------------
.
.
.
.
That bit creates the main arm piece - called OmegaCannon (L). The Yamato animation (called OmegaCannonPretty) that I want created inside the cannon is created with actor events:
.
.
.
.
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Actor Name Actor Type Parent
OmegaCannon (L) Model CActorModel
Event:
Event 4 + ActorCreation:Create MechaOmegaCannonPretty
Actor Name Actor Type Parent
OmegaCannonPretty Model ModelAnimationStyleContinuous (None)
Hosting:
Host + OmegaCannon_L:Implicit:Implicit:(None):Disabled
Host Site Operations + SOpAttachWeapon01:Disabled:Disabled
-------------------------------------------------------------------------------------------------------------------------------------------------------------
The OmegaCannonPretty actor will eventually be created after cycling the arms - for some reason it just takes 2 or 3 cycles of previous/next. And then it won't die...
I must be doing something wrong, because I have a similar problem with attaching launch models for a different weapon. On the other weapon, the launch models won't appear until the weapon has fired two or three times, but then they work great!
I experienced similar issues post-1.5. I was able to fix them by creating the subsequent attachment actors within the primary attachment with an event like this:
instead of using the same event the primary attachment uses.
Think this is more a trigger issue than an actor issue.
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
Kueken,
I tried that, but same result - the yamato animation only appears after the 3rd cycle. I may have messed though, so I'll go back and try that again.
DrSuperEvil, the only trigger I have that manipulates actors is that very short function, just those lines I pasted in. Maybe I'll try creating the main arm model and attaching it separately, instead of using "Actor - Attach Actor to Unit" to do it all in one go.
Thanks for the suggestions peeps!
Looks like I found it - the Yamato charge up doesn't have a birth animation. By default, the ModelAnimationStyleContinuous I was using for the animation used the BSD AnimBracketState to play a birth animation on actor creation.I changed the event to a Play animation: Stand and now it always appears! Gah, that was way too frustrating....EDIT: It wasn't the animation, but actually the model type the ModelAnimationStyleContinuous Actor was referencing. Originally, I had created a model LaunchFX. After I switched the model type to a PersistentSpellFX, it worked everytime. The animation had NOTHING to do with it. I thought the model types just changed the preset values for the fields, so I don't know what field on the Model was the problem...
Now I just need to get it to Destroy when its host model is Destroyed...
If it is still created by the host model, you cat set its Host Supporter to ::Creator and add a new event like this:
Otherwise, set the supporter directly to the actor id.
@Kueken531:
Kueken, that worked like a champ - thanks!