Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Unresolved] Camera Boundary

How does one make it so the player's camera view doesn't scroll too far? I have a large map with multiple rooms, and I want to make it so the player cannot see the other rooms, only the room he is in.
 
That's actually exactly what I'm trying to avoid. So far I have it so that the rooms are spaced out, but I want it to be like the Zelda III rooms (yes, I'm making a Zelda game haha), where you can't see part of the other room(s). I've got the scrolling down (no teleportation required, just a matter of panning the screen, setting Through on and moving the character), but I can't figure out how to form a camera restriction, whether through events or scripts.
 
I've tried that script, but it doesn't work (compatability issue). Besides, I don't think it would work well with my game because I actually want some maps (or parts of maps) to allow the camera to follow the player around, and it seems like the script's panning is reliant on the player's screen and not on the map. Thanks anyway, though ^-^
 
Maybe "compatability issues" wasn't exactly the right wording. What I meant was that I'm using an older version of the SDK because some of the scripts I have don't work with the newest SDK, and the Zelda Scrolling script requires the newest SDK. Not like it matters too much, unless the Zelda Styled Scrolling script is tweaked a little to fit my game I won't have much of a use for it.
 
Bump

I've found a way to *sort of* get it to work. What I did was edit the Game_Player script to ONLY allow it to scroll vertical if switch x is on, and only allow it to scroll horizontal if switch y is on. I've placed two parallel process events on the map (with multiple rooms) and when the player crosses their x/y coordinate (and beyond), scrolling switch x/y is turned off. Otherwise, it's turned on. The only problem is that these events are causing major lag. I tried fixing this by adding a wait time (3 frames) at the end of each event, but lag is only reduced slightly. Is there any way to set boundaries without all of the lag on top of it?
 
Hey Kev.
This isn't an RGSS solution, but from what I've heard, its your only solution at this time...
You can try this.
Make the map big enough so the player will NEVER be able to reach the ends (you know, so where the player actually walks to the edge of the screen)
Make a black picture (640*480) with a square a little bigger than your room cut out of it.
Use an event command to show the picture when you go into the dungeon/house. And it will give the effect that the camera is restricted, and you wont be able to see the other rooms!
Then when you exit the dugeon/house use the erase picture command!

You start here. Ug, you can see whats all around you!
http://www.picsoup.com/images/84430New Bitmap Image.bmp[/img]

then you add this guy via "show picture" command. The pic follows you around also ;)
http://www.picsoup.com/images/99566New Bitmap Image.PNG[/img]

and you get this effect!
http://www.picsoup.com/images/73387New Bitmap Image2.PNG[/img]

Does that help?
 
Okay. This can be done with events..If you have a Black square (Or maybe you can use one of the white squares. They show up black dont they?) Well just make a Event with a black square and make a bunch of them to cover the whole room and check the condition on them all where switch [xx] is on and make it where when you go on the main map make it where it automaticly turns that switch on. and when you enter the room that has black over it switch the switch off. O.o Pretty sure that should work
 
You could make a character set that is a gigantic black block (dont use hundreds of small black squares because that would lag), and set one in the middle of each room. Set a switch for each room, and then set the block to disappear if the switch is on. So in the entrance of each room make events that look like this...

player touch
conditional branch::if hero is facing up/down/left/right
>>turn [room switch X] on
conditional branch::if hero is facing up/down/left/right (opposite direction)
>>turn [room switch X] off

and you could even make them slightly transparent if you want so you can just barely see whats in the other room.

Another idea would be to change tilesets using a change tileset script, although that could require some work.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top