When my unit being placed, I want it to face randomly 0, 90, 180 or 270 angle direction. When I set a unit flag "rotatable", it faces all 360 angles of directions. Otherwise it faces only one angle. So, I want to make it randomly face only 4 angles with data. Any tips?
I could be mistaken, but I don't think that's possible using pure data...
You could manage it with triggers through non-visible attack orders on invisible units (with the weapon's scan never acquiring anything on its own), while the "real" attacks are managed by periodic effects called from a behavior for example, but that's all a little complicated.
1. You need 4 Dummy Effects for example Create Persistent each for each direction to rotate random
2. A set Event randomly choose one of the 4 Effects.
3. an invisible dummy behavior buff with minimal duration > 0 (0.001 or something)
-> Effect on end is set to Dummy Set event. A validator should check the unit is not in build and deactivate the buff (not remove)
check to apply the behavior to your unit
4. Make 4 site operations with your favorite rotate methode.
5. go to your units actor events and add:
Effect: start (dummy effect)
-> Attach offset, methodes direct: Origin, site operation add site operation rotation 1
repeat step 5 for each rotation.
and actor should be rotate instant after being build
When my unit being placed, I want it to face randomly 0, 90, 180 or 270 angle direction. When I set a unit flag "rotatable", it faces all 360 angles of directions. Otherwise it faces only one angle. So, I want to make it randomly face only 4 angles with data. Any tips?
Try throwing in a Site Operation (Variance Rotation) SOp on the Unit 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
I've tried. But it seems like it rotates my unit around random axis and to a random angle.
I'd like to rotate it around Z axis, and to angle randomly choosen from only four values: 0, 90, 180, 270. Is it possible?
I could be mistaken, but I don't think that's possible using pure data...
You could manage it with triggers through non-visible attack orders on invisible units (with the weapon's scan never acquiring anything on its own), while the "real" attacks are managed by periodic effects called from a behavior for example, but that's all a little complicated.
@StragusMapster: Go
first of all
the right angle sc2 using is
180 90 0 -90 -180
360D
@StragusMapster: Go
ok, i'll make it with triggers if no one suggest a data solution
it's easy to make this with triggers, using "face unit to a point" action
@egodbout: Go
why do we need two of 180?
"Face unit to a point" makes an unit rotate but it can't rotate just the turret. You would have to target invisible units as I mentioned to do so.
@StragusMapster: Go
Yes, it's actually a non rotating building. So, I will need to send its actor a message to rotate, it must work.
But still waiting for data ideas.
Hi, I got a solution for this:
1. You need 4 Dummy Effects for example Create Persistent each for each direction to rotate random
2. A set Event randomly choose one of the 4 Effects.
3. an invisible dummy behavior buff with minimal duration > 0 (0.001 or something)
-> Effect on end is set to Dummy Set event. A validator should check the unit is not in build and deactivate the buff (not remove) check to apply the behavior to your unit
4. Make 4 site operations with your favorite rotate methode.
5. go to your units actor events and add:
Effect: start (dummy effect) -> Attach offset, methodes direct: Origin, site operation add site operation rotation 1
repeat step 5 for each rotation.
and actor should be rotate instant after being build
@LordCombine: Go
That's awesome!!!!
But if I want to make a player's all units to do this. How to choose units?