- Joined
- Jun 16, 2011
- Messages
- 80
Yes there about 10,000 different instances of this question being asked. But the solution isnt working for me. Perhaps they dont work in Reforged?
- The "face angle" action
I have tried these with AND without first setting the structure's "Is a building" to false
Also Tried:
- I have edited the structure in object editor to have a positive turn speed (just in case)
- I have edited the structure to have a movement type (just in case)
Neither of these things helped
..............................................
It seems that any unit command to face an angle doesnt work for structures --- despite the 10,000 threads where people have posted that as being the answer.
I would really rather not go the route of placing a doodad ontop of my actual structure if possible
..............................................
NOTE:
I would actually be fine with the bottom solution (the one i wrote the comment "these are disabled" before). But this seems to shift the structure (it thinks it cant place it in the right spot and shifts it). I tried removing the builder prior to placing the new structure --- but for some reason "Unit - remove" on "triggering unit" didnt remove it.
EDIT: (as i wrote the above, i decided to test it, so technically not an edit but ehhh)
the constructing unit absolutely is the issue with this method (or any other units in the area that might collide with the new placed structure). I tested it using a wisp to construct it instead of peasant and it no longer shifts.
I still would prefer to just rotate it before its constructed though. I feel like that would probably be safer. (no glitches with collision with units nearby when rotating). I also planned on giving all buildings a rotate ability, so this really is pretty important to do right.
------------------------------------------
EDIT: [Solved - sort of]
- Jass solution below written by PurgeandFire. Works like a charm. Also prevents me from needing to write duplicate code (which i would have done) for when i add an ability to the buildings to turn by 15 degrees
- still not sure why the other commands dont work.
-
BuildFarm
-
Events
-
Unit - A unit Finishes construction
-
-
Conditions
-
(Unit-type of (Constructed structure)) Equal to Wheat Field
-
-
Actions
-
Set VariableSet Temp_Location_Farm = (Position of (Constructed structure))
-
Set VariableSet Temp_Angle_Farm = (Random angle)
-
Unit - Set Unit: (Constructed structure)'s Boolean Field: Is a Building ('ubdg') to Value: False
-
Wait 0.00 seconds
-
Unit - Make (Constructed structure) face Temp_Angle_Farm over 0.00 seconds
-
Unit - Move (Constructed structure) instantly to (Position of (Constructed structure)), facing Temp_Angle_Farm degrees
-
Unit - Make (Constructed structure) face Temp_Angle_Farm
-
Wait 0.00 seconds
-
Unit - Set Unit: (Constructed structure)'s Boolean Field: Is a Building ('ubdg') to Value: True
-
-------- THESE ARE DISABLED - this is what "works", but it shifts the structure... --------
-
Unit - Remove (Constructed structure) from the game
-
Unit - Create 1 Wheat Field for (Owner of (Triggering unit)) at (Temp_Location_Farm offset by (0.00, 0.00)) facing Temp_Angle_Farm degrees
-
-
- The "face angle" action
- The "Face angle INSTANTLY" action
- The "Move and face angle" action
I have tried these with AND without first setting the structure's "Is a building" to false
Also Tried:
- I have edited the structure in object editor to have a positive turn speed (just in case)
- I have edited the structure to have a movement type (just in case)
Neither of these things helped
..............................................
It seems that any unit command to face an angle doesnt work for structures --- despite the 10,000 threads where people have posted that as being the answer.
I would really rather not go the route of placing a doodad ontop of my actual structure if possible
..............................................
NOTE:
I would actually be fine with the bottom solution (the one i wrote the comment "these are disabled" before). But this seems to shift the structure (it thinks it cant place it in the right spot and shifts it). I tried removing the builder prior to placing the new structure --- but for some reason "Unit - remove" on "triggering unit" didnt remove it.
EDIT: (as i wrote the above, i decided to test it, so technically not an edit but ehhh)
the constructing unit absolutely is the issue with this method (or any other units in the area that might collide with the new placed structure). I tested it using a wisp to construct it instead of peasant and it no longer shifts.
I still would prefer to just rotate it before its constructed though. I feel like that would probably be safer. (no glitches with collision with units nearby when rotating). I also planned on giving all buildings a rotate ability, so this really is pretty important to do right.
------------------------------------------
EDIT: [Solved - sort of]
- Jass solution below written by PurgeandFire. Works like a charm. Also prevents me from needing to write duplicate code (which i would have done) for when i add an ability to the buildings to turn by 15 degrees
- still not sure why the other commands dont work.
Last edited: