camera fix on event?

Started by diagostimo, January 29, 2012, 04:51:14 am

Previous topic - Next topic

diagostimo

so ye the title pretty much says it all, i have a switch that controls a pulley to move left or right, so at the start of my eventing sequence i need the camera to centre on the pulley and follow it, as the pulley leaves the seeable area of the switch, then to fix back onto the player once the event is exited so like this:

>something to fix camera onto event
>label-which way
>show text- which way would you like to go?
>show choices-left,right,none
>when left- move left, then jump to label which way
>when right-move right, then jump to label which way
>when none-branch end
>return camera to player

please if anyone knows how i could do this, i would be a very happy bunny :)

Blizzard

You can use the "Scroll Map" event command for that.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

diagostimo

January 29, 2012, 05:24:42 am #2 Last Edit: January 29, 2012, 05:26:38 am by diagostimo
i did try to use the scroll map, say the pulley is 10 spaces from the switch it scrolls 10 spaces to center on the pulley, then i could get it to scroll with the direction that the pulley moves, but the problem is that if i exit the pulley switch then re enter it and i have left the pulley say 4 spaces from the switch, the scroll goes 10 space and thus we are not centered on the pulley :( also i found no real way to direct the camera back to the player as you can leave the pulley anywhere on its track so the direction to scroll is unpredictable

Blizzard

You could use variables to keep track of how many spaces you've been moving around. This would also allow you get back to the player. Or even better: You should use variables to determine the position you want to scroll to and then scroll there. You may not be able to use a variable to tell the event how many spaces you want to scroll, but you can use a loop with moving one space at the time and decreasing the variable each time until the variable reaches 0.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

diagostimo

January 29, 2012, 06:26:14 am #4 Last Edit: January 29, 2012, 08:00:07 am by diagostimo
cool, ill have a mess around, altough im not to great with variables, i have used them to record x and y positions but thats about it :/
edit: sorta got it to work, but the scrolling isn't accurate, theres a demo of my project here, the switch iv been meddling with is the very top one from the spawn, its late here so im gonna get some rest, if anyone fancy's taking a look to see if they could crack it i would be very grateful :)
http://www.mediafire.com/?si1ib78cbdrv2ud