Scrolling rooms

Started by LL Notorious B.I.G. Will C-H, Thu 13/11/2003 16:40:55

Previous topic - Next topic

LL Notorious B.I.G. Will C-H

Hi, im having trouble with the scripting for getting my room to scroll down away from where the character is, i imagine its nice and simple to do but cant figure it out. Any help?

Thankyou - Will
Punk Quest 0.5 is now available for your perusal if you so wish http://punkquest.to-j.com

quintaros (at work)

Does it need to be a playable sequence?  For cut scenes I've made the playable character as an invisible character and moved it around to simulate "camera" moves.

Pumaman

You can scroll the screen manually with SetViewport. Scroll down would be something like:


int y = GetViewportY();
int i = 0;
while (i < 50) {
 SetViewport(0, y + i);
 i++;
 Wait(1);
}


Obviously the 50 would have to be adjusted depending on how far you want it to scroll.

Ben

#3
EDIT: Yeah.. What he said  :P

Scummbuddy

Sounds to me like you want, from the manual
------------------------------
SetViewport
SetViewport (int x, int y)

Locks the screen viewport to having the top-left hand corner at (X,Y) in a scrolling room. This allows you to manually pan across a scrolling room or to have the screen follow a non-player character.
The lock is released when you either call ReleaseViewport or the player changes rooms.

NOTE: The co-ordinates supplied are 320x200-scale co-ordinates, and will be automatically multiplied up by the engine.

NOTE: This function has no effect if the current room isn't a scrolling room.

Example:

SetViewport (character[MAN].x - 160, character[MAN].y - 110);

will scroll around and follow character MAN in a specific room, ( you must put this in the room's repeatedly execute event)
See Also: GetViewportX, GetViewportY, ReleaseViewport
-------------------------------

At first, I thought you were having trouble just making a scrolling room in AGS
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Nixxon

Make a second character start him off in the same room, set his view to a blank sprite, set his script name to BILLY or whatever then use.
SetPlayerCharacter(BILLY);
MoveCharacter (BILLY, int x, int y);
then change set player character back to your main char when your finished.

Might be a simpler way... this works though

Scorpiorus

Wow, five posts at a time ;D

Ben

I hate it when CJ makes me look stupid  :P

LL Notorious B.I.G. Will C-H

Thanks people, im sure one of those will work.

Many thanks - Will
Punk Quest 0.5 is now available for your perusal if you so wish http://punkquest.to-j.com

SMF spam blocked by CleanTalk