Heya I'm trying to make it so that when you click a unit it will tint colour and then when you click it again it goes back to normal. I tried adding the following to the actor events:
UnitClick.Wall_Dirt
=> IsStatus Clicked 1
Set TintColor 96,255,43
Quote from DrSuperEvil:
No. Just add the At Caster term so that it checks the status is 0/1 at the caster (clicked) unit and not any other of your units of the same type.
----
Well the term at (caster) doesn't exist in the UnitClick.
Ye, your problem is the way the engine decides to run actor events, I didn't figure out wether you have some form of control over the ordering or if the engine decides it all at run time. I imagine your current event flow chart looks a bit like this:
Click Unit-> Clicked == 1? -> Set Tint -> Set Clicked == 2 -> Clicked == 2? -> Set Tint -> Set Clicked = 1
I had a similar issue with some things I was testing recently. I have a map file somewhere where I corrected the problem, will take a look to see if I can't find it and post the solution.
The term type is just At and you can set it to caster. Just add it to your events.
In worst case just do like the marauder does for the left and right attack animations using status increment and then when status = 2 it gets set back to 0
for your way, it seems to trigger both events sequentially, so it sets the status before checking the 2nd event. With the increment, this should be irrelevant.
Heya I'm trying to make it so that when you click a unit it will tint colour and then when you click it again it goes back to normal. I tried adding the following to the actor events:
UnitClick.Wall_Dirt
=> IsStatus Clicked 1
Set TintColor 96,255,43
UnitClick.Wall_Dirt
=> IsStatus Clicked 2
ClearTintColor
ActorCreation
StatusSet Clicked 1
UnitClick.Wall_Dirt
=> IsStatus Clicked 1
StatusSet Clicked 2
UnitClick.Wall_Dirt
=> IsStatus Clicked 2
StatusSet Clicked 1
It seems however it causes to trigger the IsStatus Clicked 2 events aswell when you click it once.
Tried adding the At Caster term as well?
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
Quote from DrSuperEvil:
Tried adding the At Caster term as well?
----
Nope, Where should it be added (I'm new to the data editor)?
Just use the marauder actor as reference. Add it beteen all the events where you have IsStatus
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
@DrSuperEvil:
So I guess I'll have to make the tinting an effect/behaviour?
No. Just add the At Caster term so that it checks the status is 0/1 at the caster (clicked) unit and not any other of your units of the same type.
You already have the IS Status term in the events for your actor, all you need to do is add another term.
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
Quote from DrSuperEvil:
No. Just add the At Caster term so that it checks the status is 0/1 at the caster (clicked) unit and not any other of your units of the same type.
----
Well the term at (caster) doesn't exist in the UnitClick.
@DrSuperEvil: Go
Ye, your problem is the way the engine decides to run actor events, I didn't figure out wether you have some form of control over the ordering or if the engine decides it all at run time. I imagine your current event flow chart looks a bit like this:
Click Unit-> Clicked == 1? -> Set Tint -> Set Clicked == 2 -> Clicked == 2? -> Set Tint -> Set Clicked = 1
I had a similar issue with some things I was testing recently. I have a map file somewhere where I corrected the problem, will take a look to see if I can't find it and post the solution.
@Kalekin:
Thanks!
The term type is just At and you can set it to caster. Just add it to your events.
In worst case just do like the marauder does for the left and right attack animations using status increment and then when status = 2 it gets set back to 0
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
@DrSuperEvil:
Yeah I know but it doesn't seem to be there, I know it is at the Marauder however when I try to add the Term it's not there.
Then go to raw data and add it manually.
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
the at - term only appears for events, where it can be used.
@Kueken531:
Strange that it doesn't show up on unitclick then, that's an event afterall
Exactly, but its an event, which does not support a caster or anything like this, thats why the at is irrelevant, thus cannot be used.
If you use for example an effect - event, you can use at again, because an effect has a caster, a target etc.
gonna bump it as I'm still having the problem.
Then do like a marauder since that works and have the click use a status increment and when status = 2 it sets status = 0
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.
Instead of
UnitClick.Wall_Dirt
-> IsStatus Clicked 1
StatusSet Clicked 2
UnitClick.Wall_Dirt
-> IsStatus Clicked 2
StatusSet Clicked 1
Try
UnitClick.Wall_Dirt
StatusIncrement Clicked
UnitClick.Wall_Dirt
-> IsStatus Clicked 3
StatusSet Clicked 1
for your way, it seems to trigger both events sequentially, so it sets the status before checking the 2nd event. With the increment, this should be irrelevant.
@Kueken531:
Alright, it worked when I set
UnitClick.Wall_Dirt
StatusIncrement Clicked
UnitClick.Wall_Dirt
IsStatus 5
StatusSet 1
UnitClick.Wall_Dirt
IsStatus 3
ClearTint
What it did (I think) was that it counts both pressing and releasing as a click for some reason.
Thanks for the help DrSuperEvil and Kueken!
Makes sense, too bad you cannot select a sub-event (like UnitClick.Wall_Dirt.click or UnitClick.Wall_Dirt.release)