Yep, I'm trying to wrap my caveman brain around scripting again. Hold on to your butts 
I want to make it so that the room will randomly pan around to each corner of the screen, using the Tween module like so:
Code: ags
(never mind the odd coordinates, the background used is slightly larger than the game's resolution of 320x200)
What I'm struggling to understand is how to define a ran variable that gets its value from the Random function. From what I've read in the Help file, I should be able to simply do:
Code: ags
This, however, makes AGS freak out and tell me "Expected integer value after '='". So, could someone more intelligent than me please explain how to do this right? Furthermore, the plan is to have the screen pan around for several seconds before moving on to something else, how would I tell it to do that?

I want to make it so that the room will randomly pan around to each corner of the screen, using the Tween module like so:
function room_AfterFadeIn()
{
if (ran==0) TweenViewport(7.0, 0, 0);
else if (ran==1) TweenViewport(7.0, 0, 247);
else if (ran==2) TweenViewport(7.0, 349, 0);
else if (ran==3) TweenViewport(7.0, 349, 247);
}
(never mind the odd coordinates, the background used is slightly larger than the game's resolution of 320x200)
What I'm struggling to understand is how to define a ran variable that gets its value from the Random function. From what I've read in the Help file, I should be able to simply do:
int ran=Random(2);
This, however, makes AGS freak out and tell me "Expected integer value after '='". So, could someone more intelligent than me please explain how to do this right? Furthermore, the plan is to have the screen pan around for several seconds before moving on to something else, how would I tell it to do that?