• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] How do i rotate buildings in-game?

Status
Not open for further replies.
Level 2
Joined
Dec 15, 2012
Messages
26
I play a lot of Titan Land, and in there newer versions there's a feature to rotate buildings. I'm trying to create my own version of Titan Land, so i'd like to include that in mine too. I've googled it, but there hasn't been any useful information on it. Please help. :3
 
Level 2
Joined
Dec 15, 2012
Messages
26
Here, test the map.

To make it work:
Buildings need the custom ability 'Change facing'
Buildings need more than 0 movement speed base
Buildings need more than 0 turn speed

:)

PS: Remember to edit the spell to your needs if you want to use this way.

This won't really do since any buildings with attacks will turn by themselves
 
Level 7
Joined
Nov 15, 2009
Messages
225
Well thats the way you do it with GUI, you can control any facings by triggers either.

Or copy and paste the function (maker posted the link) into your map header and call it.

custom script: call SetImmovableUnitFacing(GetTriggerUnit(), ANGLE)
If you cast an ability you can replace ANGLE with:

Atan2(GetSpellTargetY() - GetUnitY(GetTriggerUnit()), GetSpellTargetX() - GetUnitX(GetTriggerUnit()))
 
Level 2
Joined
Dec 15, 2012
Messages
26
Well thats the way you do it with GUI, you can control any facings by triggers either.

Or copy and paste the function (maker posted the link) into your map header and call it.

custom script: call SetImmovableUnitFacing(GetTriggerUnit(), ANGLE)
If you cast an ability you can replace ANGLE with:

Atan2(GetSpellTargetY() - GetUnitY(GetTriggerUnit()), GetSpellTargetX() - GetUnitX(GetTriggerUnit()))
I am forever grateful. Thanks :3
 
Status
Not open for further replies.
Top