SRL Archive - Help

How do I rotate the camera?


mrbarrybadger

2012-06-03 18:02:18

Basically i have my script fully functioning except i want it to be able to rotate the screen if the object is not found and im not sure how to do this, i know there is a rotation function for finding an object but ive already set it up and am using a 'If,Then,Else' 'else' system and simply need to know the process to rotate the camera for the else if that makes sense :/

thanks in advance :)

Nebula

2012-06-03 18:04:23

if not find object then
MakeCompass(angle)

Rich

2012-06-03 18:07:06

function MakeCompass(Direction: Variant): Boolean;
:)

mrbarrybadger

2012-06-03 18:17:40

thanks guys :) but im really struggling with trying to implement it into my script, lets say i just wanted it to rotate 180 degrees how would i do that?

Rich

2012-06-03 18:41:38

var
Original, New : Extended;

begin
Original:= rs_GetCompassAngleDegrees;
if Original > 180 then
New:= Original - 180
else
New:= Original + 180;
MakeCompass(New);
end;
Should do the trick.

P1ng

2012-06-03 18:57:30

Try using
function CompassMovement(MinMovement, MaxMovement: Integer; Return: Boolean): Boolean;
MinMovement = Smallest compass movement in degrees
MaxMovement = Largest compass movement in degrees
Return = True/False do you want to return to original compass angle

if not FindObject then
CompassMovement(10,180,False);
This would rotate the compass between 10-180 degrees if the object is not found

Rich

2012-06-03 19:05:11

Didn't even know that existed…Oh well! :p

P1ng

2012-06-03 19:18:33

It's hiding away in the antiban include, that's why ;)

Rich

2012-06-03 19:19:40

Weird place for it to be, no?

Wreck

2012-06-03 19:20:27

(*
MakeCompass
~~~~~~~~~~~
.. code-block:: pascal
function MakeCompass(Direction: Variant): Boolean;
Aligns RS to specified direction
- Enter a compass angle ('n', 's', 'e', 'w') or degree (23.3, 25, 205.2)
and it will move the compass to that angle. Also accepts 'random',
and 'rand' to make the compass a random direction.

.. note::
by Nielsie95 & Nava2

Example:
.. code-block:: pascal

// using a string!
MakeCompass('N');

// using an integer!
MakeCompass(0);

*)

Hope that helps.

mrbarrybadger

2012-06-03 19:21:09

thanks again very helpful :)

P1ng

2012-06-03 19:22:49

From: Rich
Weird place for it to be, no?


Completely agree, it makes sense to an extent that it would be used to look more human-like but it has so many other great uses like for this situation.