| 03-28-2009, 01:18 PM | #1 |
(I am posting this for background for a submission.) Setting structure facing angle cannot be done by just SetUnitFacing(); it requires the following operation: JASS:SetUnitFacing(structure, angle) Wait(t) SetUnitFacing(structure, angle) By experimentation, the time t1 it takes to set a structure's facing angle to a value offset by 180.00 from its initial facing angle is 0.75; and the time t2 it takes to set a structure's facing angle to a value offset by 180.00 from its initial facing angle is 0.75/2. So t is a linear function of the offset and, by calculation, t is expressed by the offset: t = offset/240. Note that t is linear to the offset but the change in facing angle for every change in offset (or t) is not linear to the change in offset (or t) - I don't know why. The change in facing angle decreases through time. Precluding any of the steps will cause failure. Furthermore, although this operation will indeed set the structure's facing angle to the defined value, it will not be shown in-game by the model of the unit; the model's facing angle will remain as it was initially. So, in addition to the above operation, the structure's model must be refreshed by hiding it: JASS:ShowUnit(structure, false) //then show it again if you like |
| 03-28-2009, 04:51 PM | #2 |
So does this mean you could do something like this:? JASS:function SetStructureXY takes unit whichUnit, real x, real y returns nothing call SetUnitX( whichUnit, x ) call SetUnitY( whichUnit, y ) call ShowUnit( whichUnit, false ) call ShowUnit( whichUnit, true ) endfunction |
| 03-28-2009, 05:22 PM | #3 |
I have tested only adjusting facing angles; don't know about positions. edit: if you mean will refreshing like in the method above work with adjusting xy values: refreshing is independent of the effect actually occuring. you can refresh it but if the change didnt occur in the first place, then nothing will change after u refresh. |
| 03-29-2009, 02:56 PM | #4 |
So, why is that wait necessary? What are the results with a longer/shorter wait or without it? |
| 03-30-2009, 01:14 AM | #5 | ||
Quote:
Quote:
|
| 03-30-2009, 10:19 AM | #6 |
game constants ? set it to -1 idk what is the problem to set building facing angle. + about building changing position... have some one tryed to add movement speed to the building and after change the position ? + afaik the pathing texture will be on the same place at all. |
| 03-30-2009, 08:03 PM | #7 | |
Quote:
The RP map SotDRP makes every building have movement, and simply removes the 'amov' ability from the structure when it is created, causing it to be unable to move. This allows you to change the angles of the buildings at will with the simple 'Set facing'. |
