Originally Posted by
Hellzonee
Thanks again for the help. Please bear with me as I am very noob. I'm still having some issues, here is what I have done. I declared the procedure as such:
procedure ccompass(angle: extended);
begin
angle := getCompassAngle();
end;
Afterwards, I called the procedure in a different procedure as so:
procedure cookHandler();
var
aa: extended;
angle, Timer, world, I, rand: Integer;
ccompass(aa);
angle := round(aa);
setcompass(angle + 15);
Everything is executing but the camera is not changing at all, it just stays frozen. Anything Im doing wrong?
I'd recommend you read some tutorials on procedures and functions. You're trying to assign a value to aa, you have the right idea on how this is accomplished but you executed incorrectly. Look at your ccompass procedure, the values inside brakcets after a procedure/functions name are values you will be giving to it, not taking. With function you can have a returned value that you can take and assign to a variable elsewhere.
Simba Code:
function returnAngle: Integer; //this function will give back an integer value
begin
Result := Round(getCompassAngle); //result is what we use to assign the above integer a value
end;
//Here's an example of what you use values in brackets for
function returnAngle(Number: Integer): Integer; //Number is a value we'll be giving to this function
begin
Result := Round(getCompassAngle) + Number; //Here we use number to change the result.
end;
//So calling the below function will get the current angle and add 20 to it
Angle := returnAngle(20);
But as Citrus has pointed out, the use of a wrapper procedure here is redundant. Just do Angle := Round(getCompassAngle);