id = PlaceObject(x, y, "Test", "pontoon_bridge_centre");
SetObjectRotation(id, 0);
or
SetObjectRotation(id, 90);
or
SetObjectRotation(id, 180);
Are not rotating according to the degree system, can you tell me which criteria should be followed to place objects in a precise direction?, or maybe I'm using the wrong functions.
SetObjectRotation
Moderators: Slitherine Core, BA Moderators
-
pipfromslitherine
- Site Admin

- Posts: 9928
- Joined: Wed Mar 23, 2005 10:35 pm
Re: SetObjectRotation
As per the docs, the degrees are in 100ths, so you'll want to use 0, 9000, and 18000 in these examples. So they were indeed rotating already - just only by a max of 1.8 degrees 
Cheers
Pip
Cheers
Pip
Re: SetObjectRotation
ummmm, look at the picture, bottom left, the Engineers have placed a pontoon facing 0.
SetObjectRotation(id, 0);
On top, the other engineers have placed the same object with 27000.
SetObjectRotation(id, 0);
On top, the other engineers have placed the same object with 27000.
Re: SetObjectRotation
ummmm, look at the picture, bottom left, the Engineers have placed a pontoon facing 0.
SetObjectRotation(id, 0);
On top, the other engineers have placed the same object with 27000.
SetObjectRotation(id, 0);
On top, the other engineers have placed the same object with 27000.
Re: SetObjectRotation
The only working numbers are 0 and 157.
0 are vertical tiles, and 157 horizontal, is there any logic here that I' missing ?.
0 are vertical tiles, and 157 horizontal, is there any logic here that I' missing ?.
-
pipfromslitherine
- Site Admin

- Posts: 9928
- Joined: Wed Mar 23, 2005 10:35 pm
Re: SetObjectRotation
Hmmm - I'm pretty sure I tested it when I wrote it. And I've not got the code in front of me right now. But on a hunch, try doing it in radians. That is, make the value you put into the function be:
value = (100 * degrees * PI)/180
If that works, then I forgot to do the conversion. If not, I'll have to double check it. I'm guessing it is used by the random mission mods, so I think it must work at least somewhat.
Cheers
Pip
value = (100 * degrees * PI)/180
If that works, then I forgot to do the conversion. If not, I'll have to double check it. I'm guessing it is used by the random mission mods, so I think it must work at least somewhat.
Cheers
Pip
Re: SetObjectRotation
This formula gives 0 for 0 degrees and 157 for 90 degrees.value = (100 * degrees * PI)/180
It's ok for me the 157 as I only want to place horizontal or vertical the object.
-
pipfromslitherine
- Site Admin

- Posts: 9928
- Joined: Wed Mar 23, 2005 10:35 pm
Re: SetObjectRotation
Yeah - that's what made me guess that that was the issue. I'll check and see whether I need to change either the code or the docs (I don't want to break any existing code when i make the fix)
Cheers
Pip
Cheers
Pip
