I used the "attach model to unit" trigger event to have my hero riding up on the elevator. Now that it's at the top, I use "move unit instantly" to put the actual hero unit there, but I need to get rid of the actor. I have it saved to a variable, but there's no "destroy actor" trigger event. I tried sending it a "destroy" message, but it didn't work. I see all kinds of trigger actions that can create actors, but none that can destroy one. I even tried the "kill actor model" action and it didn't work, either.
Attach Raynor to Origin on (Actor for Space Elevator (Terrain object doodad) [125.00, 29.00])
Variable -Set Actor2 = (Last created actor)
And then later:
Actor -Kill actor model Actor2
I've tried killing it, sending it a Destroy message, everything I could think of. When there are so many ways to create actors attached to stuff, I don't know why they wouldn't include a "Remove Actor" trigger action. Or "Destroy Actor". Or "Hide Actor". Or "Make Actor Not Be Here Any More."
Attach Raynor to Origin on (Actor for Space Elevator (Terrain object doodad) [221.00, 29.00])
Variable -Set Actor = (Last created actor)
Actor -Send message "SetTintColor 255,0,255" to actor Actor
This is what I did, and nothing changed. He should have turned pink, correct?
I've tried and it seems to work? Only thing is when attaching a unit on a unit it bugs a bit telling there are 2 persisting actors. But the attached unit is tinted and attached.
Is your unit created? Raynor on the elevator? And if you test if the actor =/= no actor to see if the variable is the problem?
Attach Raynor to Origin on (Actor for Space Elevator (Terrain object doodad) [221.00, 29.00])
Variable -Set Actor = (Last created actor)
Actor -Send message "SetTintColor 255,0,255" to actor Actor
General -If (Conditions) then do (Actions) else do (Actions)
If
Actor != No Actor
Then
UI -Display "True" for (All players) to Subtitle area
Else
UI -Display "False" for (All players) to Subtitle area
When I test this it prints "True", so I know the actor is getting assigned.
Could it be because I'm attaching it to a doodad instead of a unit?
EDIT: Honestly I'm starting to wonder if this whole thing is even worth the effort... I'm going to try an idea for a workaround tomorrow, I'll get back to you.
You'll realize that it in facts creates two actors, where one is 'SiteHosted', which is some sort of link I assume (not well aware about Actors). Thus by using LastCreated action you only get the referece to ModelHosted. Although this is the essential one in fact, so it surprising if it doesn't respond to 'Destroy' message.
Anyway, you can also utilize actor cheats to get some more information about currently living actors (what could help finding out the cause), i.e.: ActorInfoDisplay ActorLiveDump
Could it be because I'm attaching it to a doodad instead of a unit?
You should not be capable of doing this, since it would not pass type checking, I'm assuming you're using "Attach Model To Actor". Which should actually work, because it has different implementation (if that's not the deprecated version without postfix '2'):
Oh, wait. I just realized the implementation above uses Message to create the actor, as oposed to "ActorCreate" function. Thus you have to use "Last Created Actor by Message" to obtain valid reference in this scenario.
I used the "attach model to unit" trigger event to have my hero riding up on the elevator. Now that it's at the top, I use "move unit instantly" to put the actual hero unit there, but I need to get rid of the actor. I have it saved to a variable, but there's no "destroy actor" trigger event. I tried sending it a "destroy" message, but it didn't work. I see all kinds of trigger actions that can create actors, but none that can destroy one. I even tried the "kill actor model" action and it didn't work, either.
Well, perhaps you could use "remove actor"?
I dunno, could be wrong.
Perhaps the dr could help?
My projects : The Hammer of Dawn, Noir : Automata, Noir : Evolution, Noir : Ascension, Hammer of Dawn Revamp
Many awesome projects : Custom Campaign Initiative
Something for the community : A Small Letter of Thanks, SC2mapster Classic Skin - Alevice
There is no “Remove Actor” trigger action that I could find.
Why you not just using a Model type actor?
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
And then later:
I've tried killing it, sending it a Destroy message, everything I could think of. When there are so many ways to create actors attached to stuff, I don't know why they wouldn't include a "Remove Actor" trigger action. Or "Destroy Actor". Or "Hide Actor". Or "Make Actor Not Be Here Any More."
Does it respond to a Set Tint Color message?
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
This is what I did, and nothing changed. He should have turned pink, correct?
I've tried and it seems to work? Only thing is when attaching a unit on a unit it bugs a bit telling there are 2 persisting actors. But the attached unit is tinted and attached.
Is your unit created? Raynor on the elevator? And if you test if the actor =/= no actor to see if the variable is the problem?
Working on projects:
When I test this it prints "True", so I know the actor is getting assigned.
Could it be because I'm attaching it to a doodad instead of a unit?
EDIT: Honestly I'm starting to wonder if this whole thing is even worth the effort... I'm going to try an idea for a workaround tomorrow, I'll get back to you.
'No actor' pretty much evaluates to null, so it only tests whether the variable holds a reference, but doesn't check whether this reference is valid.
You could use "Actor Get Text" to display information about what that actor reference essentially holds.
Also, if you inspect internal implementation of this function:
You'll realize that it in facts creates two actors, where one is 'SiteHosted', which is some sort of link I assume (not well aware about Actors). Thus by using LastCreated action you only get the referece to ModelHosted. Although this is the essential one in fact, so it surprising if it doesn't respond to 'Destroy' message.
Anyway, you can also utilize actor cheats to get some more information about currently living actors (what could help finding out the cause), i.e.:
ActorInfoDisplay
ActorLiveDump
You should not be capable of doing this, since it would not pass type checking, I'm assuming you're using "Attach Model To Actor". Which should actually work, because it has different implementation (if that's not the deprecated version without postfix '2'):
---
Oh, wait. I just realized the implementation above uses Message to create the actor, as oposed to "ActorCreate" function. Thus you have to use "Last Created Actor by Message" to obtain valid reference in this scenario.
Previously known as: SomeoneTookMyNameTT