HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Changing the angle of a building

01-06-2006, 06:56 AM#1
Kam
I made the Castle able to upgrade to the Arcane Observatory as a third upgrade. The problem is that the door on the observatory faces the wrong way(faces lower right instead of lower left). I need it to face an angle of 225. I tried a simple trigger to do this, but it did not work.
Event-
A unit begins construction

Condition-
(Triggering unit) is Bastion equal to True

Action-
Make (Triggering Unit) face 225 over 0.00 seconds

Any ideas?
01-06-2006, 09:14 AM#2
Blade.dk
You can't change it's facing if it has no movement.

I would store the owner and position of the building in a variable, remove it, and create the upgraded one facing the right direction.
01-06-2006, 02:05 PM#3
Vexorian
I saw a report that if you cast polymorph on a building, then change the facing angle of the sheep, then dispel the buff it works.
01-06-2006, 10:02 PM#4
Kam
Well you have to understand that this takes place in a melee game, so I can't have model changes and crazy triggers. This seems to be a problem that many people have, so Vexorian could you perhaps write a JASS system that deals with this?
01-06-2006, 10:22 PM#5
Earth-Fury
i forget how, but i made a map tat allows youi to change the faceing of a building... ill look into finding it.
01-06-2006, 10:29 PM#6
Blade.dk
It is simple, really. Make a trigger like this:

Code:
Set Variable (MyPoint) = Position of (MyBuilding)
Set Variable (Life) = Life of (MyBuilding)
Set Variable(MyUnitType) = Unit type of (MyBuilding)
Remove(MyBuilding) from the game.
Create 1 (MyUnitType) Unit at  (MyPoint) facing *wanted angle* degrees
Set MyBuilding = Last Created Unit
Set (MyBuildingLife) to (Life)
custom script:   call RemoveLocation(udg_MyPoint)

Something like that, I don't think all function names are right, but you should get the point.
01-07-2006, 01:34 AM#7
Earth-Fury
This trigger works for rotating a building.... (well, atleast it did when i tested te map, so many months ago..)

Trigger:
Collapse Events
Player - Player 1 (Red) types a chat message containing 'fs as An exact match
Player - Player 2 (Blue) types a chat message containing 'fs as An exact match
Player - Player 3 (Teal) types a chat message containing 'fs as An exact match
Player - Player 4 (Purple) types a chat message containing 'fs as An exact match
Player - Player 5 (Yellow) types a chat message containing 'fs as An exact match
Player - Player 6 (Orange) types a chat message containing 'fs as An exact match
Player - Player 7 (Green) types a chat message containing 'fs as An exact match
Player - Player 8 (Pink) types a chat message containing 'fs as An exact match
Player - Player 9 (Gray) types a chat message containing 'fs as An exact match
Player - Player 10 (Light Blue) types a chat message containing 'fs as An exact match
Collapse Actions
Set tempGroup = (Units currently selected by (Triggering player))
Set tempPoint = (Position of (Random unit from (Units owned by (Triggering player) of type Spawner)))
Collapse Unit Group - Pick every unit in tempGroup and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Unit-type of (Picked unit)) Not equal to Spawner
(Owner of (Picked unit)) Equal to (Triggering player)
Collapse Then - Actions
Unit - Make (Picked unit) face tempPoint over 0.00 seconds
Else - Actions
Custom script: call DestroyGroup( udg_tempGroup )
Custom script: call RemoveLocation( udg_tempPoint )
01-07-2006, 02:06 AM#8
Vexorian
Quote:
Originally Posted by Kam
Well you have to understand that this takes place in a melee game, so I can't have model changes and crazy triggers. This seems to be a problem that many people have, so Vexorian could you perhaps write a JASS system that deals with this?
if you remove the buff instantly and the buff doesn't have any special effect people wouldn't note the difference, the other solutions are much better though
01-07-2006, 03:21 AM#9
Kam
Well, these would be fine if I wanted the player to have to do it. The way I have it set up, the Castle upgrades to a Arcane Observatory like a regular upgrade. I was trying to make it so as soon as the upgrade finished, it would rotate to 225. In other words, I need it to be automatic and multi-instance so no player commands are required.
01-07-2006, 09:48 AM#10
ShadowDragon
I think what earth-fury was trying to say, is that "Make unit face points over x.xx seconds" worked for him. You were trying to use "Make unit face angle over x.xx seconds". Try the former, by projecting a point away from the the position of the building (if you work out the sin/cos of the necessary angle and store it, it shouldn't require much processing) and order it to face that point.
01-08-2006, 02:25 AM#11
Kam
Arg I am having difficulty with this. How do I set a point at say, 100 units away from the origin on the 225 degree line, as soon as a building finishes construction? I don't want to have to make the player type any commands. Perhaps a JASS function that attaches a "caster" unit to a certain point once a town hall has been placed? (I use CS 12.8, so if that helps.)
01-08-2006, 02:50 PM#12
Earth-Fury
polar projections. :)
01-09-2006, 02:59 AM#13
Kam
polar wha?
01-09-2006, 03:15 AM#14
Earth-Fury
Trigger:
Unit - Make (Triggering unit) face ((Position of (Triggering unit)) offset by 10.00 towards 90.00 degrees) over 0.00 seconds
01-09-2006, 12:09 PM#15
Kam
Event: Unit - A unit finishes construction
Condition: (Unit-type of (Triggering Unit)) Equal to Bastion
Action: Unit - Make (Triggering unit) face ((Position of (Triggering unit)) offset by (10.00,90.00)) over 0.00 seconds

It's still not working, what am I doing wrong.