Hey
I just want to find out if there is any function that will return a value if I want to check if a compass heading is lets say north and a camera Function that will tell me if a camera is set high or low?
Hey
I just want to find out if there is any function that will return a value if I want to check if a compass heading is lets say north and a camera Function that will tell me if a camera is set high or low?
Simba Code:(*
rs_GetCompassAngleDegrees
~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: pascal
function rs_GetCompassAngleDegrees: Extended;
Returns the compass angle in degrees.
.. note::
by Wizzup?
Example:
.. code-block:: pascal
*)
function rs_GetCompassAngleDegrees: Extended;
begin
Result := Degrees(rs_GetCompassAngleRadians());
end;
Simba Code:(*
SetAngle
~~~~~~~~
.. code-block:: pascal
procedure SetAngle(Angle: Integer);
Sets the mainscreen at highest\lowest angle, dependant on constant passed.
.. note::
by Raymond, edit by NaumanAkhlaQ
Example:
.. code-block:: pascal
// make the camera the highest!
SetAngle(True);
*)
// TODO: fix doc for this.
// Allows one to use ClickNorth without waiting 1s every time.
const
SRL_ANGLE_HIGH = 0;
SRL_ANGLE_LOW = 1;
SRL_ANGLE_NONE = 2;
// TODO: Check if 1000ms wait is necessary
procedure SetAngle(Angle: Integer);
begin
if ((Angle = SRL_ANGLE_NONE) or (not LoggedIn)) then
Exit;
KeyDown((Angle * 2) + 38);
Sleep(1000 + Random(300));
KeyUp((Angle * 2) + 38);
Wait(500 + Random(100));
end;
Thanks JJ, this was what I was looking for.
Indeed. You can check out functions like this in 'Includes/SRL/SRL/core/', files like flag.simba & mapwalk.simba will have just about everything you'll need for this.
As far as camera pitch goes, that can't be determined via color alone. The closest you can get is using something like 'SetAngle(SRL_Angle_High)' and manually record your camera pitch now being at the lowest possible.
Current projects:
[ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]
"I won't fall in your gravity. Open your eyes,
you're the Earth and I'm the sky..."
If I use this, will it work to see if a camera angle is set to a specific angle?
Simba Code:While not(SRL_ANGLE_NONE) do
Begin
SetAngle(SRL_ANGLE_NONE);
Wait(200 + Random(200));
End;
All that does is to set ur angle to the lowest. You can however set it to a specific angle using:
As for detecting what angle you are at...unless we look at the height/position the character/npcs are standing at and do some complicated math to figure out the angle. Haven't thought about how to go about doing it exactly.Simba Code:KeyDown(VK_UP);
wait(x); //time urself to see how long it takes having the arrow pressed down to adjust to the desired angle
KeyUp(VK_UP);
EDIT: your code won't even work since SRL_ANGLE_NONE is not a valid boolean. (it is an integer in fact)
I thought it will not work, but I need a way to check what my current angle is before I try to set it, because sometimes when using setangle it does not complete the setting and get`s stuck between high and low and sometimes it just don`t move at all and that messes up my finding procedures in a script I`m working on.
Ideas will be welcome how to find the current angle of the camera.
Edit: Can I get the integer of the current angle, then I can compare the integer to the constants and know what position the camera is in at the moment?
Last edited by VastlySuperior; 08-22-2012 at 10:47 AM.
Sorry Flight, I only saw your post now, so what I actually must do is to assign a variable with a value every time I set the camera angle and then compare that value to see in what position the camera is in, but when it fails to set the camera to the position I want, it will still assign a value that is true to the condition I want but then the camera angle is not in that position, so it will mess up the rest of the script from that point forward.
There must be a way to see what your current camera angle is and work from there.
You can't find out the pitch by using colors only. You can only set the angle to like SRL_HIGH or SRL_LOW. You can't check if it is set to SRL_HIGH or something else. That is possible with injection/reflection but not with Colors. It might be possible using OpenGL/DirectX because the grid is being drawn. By calculating the Y-distances between each tile there could probably be a formula that would have a decent accuracy to determine the pitch. But for now it's not possible.
Ok, thanks everyone for your input, I think I`ll just have to accept there is no way to determine the camera angle before setting it.
There are currently 1 users browsing this thread. (0 members and 1 guests)