Adventure Kit Questions
by Richard Pettyjohn · in Torque Game Builder · 09/11/2006 (2:57 pm) · 12 replies
I'm thinking about getting the adventure kit and I was wondering if it comes with script for making a game were you move on by touching the sides of the screen with the character (think Zelda: Oracle of Ages/Seasons). The feture list didn't seem to mention if it does or not.
About the author
#2
09/11/2006 (4:27 pm)
As David said, that camera functionality doesn't come with the Adventure Kit. Implementing something like that shouldn't be hard though, depending on your TGB Scripting skill.
#3
09/11/2006 (4:37 pm)
Oh, ok. I still probably buy it looks cool. I tried to implement something like that aready but It doesn't work the way I want it to with my enemys, I'll probably figure something out though.
#4
How hard it is to add that sort of depends on your specific needs. If you could give me a few ideas on how you would expect this to work?
I see i could add the following to AdvKit 1.1 (no promises, but a possible addition).
- New option to the CameraTrigger... "centerCamera".
- When the player enters this camera trigger with "centerCamera" enabled the camera stops following the player and instead scrolls to the center of the trigger (still obeying the trigger zoom settings).
If you then put down multiple camera triggers covering your rooms, you should be able to get the behavior your talking about.
What do you think?
09/11/2006 (7:01 pm)
@Richard - In short no... the Adventure kit doesn't work that way.How hard it is to add that sort of depends on your specific needs. If you could give me a few ideas on how you would expect this to work?
I see i could add the following to AdvKit 1.1 (no promises, but a possible addition).
- New option to the CameraTrigger... "centerCamera".
- When the player enters this camera trigger with "centerCamera" enabled the camera stops following the player and instead scrolls to the center of the trigger (still obeying the trigger zoom settings).
If you then put down multiple camera triggers covering your rooms, you should be able to get the behavior your talking about.
What do you think?
#5
However, Richard also mentioned that he was having trouble with enemy behaviour, which leads me to believe he may be referring to enemies outside of the current room are still active, and therefore exiting their predefined rooms or gathering at the entrance to the room. If this is the case, I would just suggest disabling the AI of any enemies not in the room, or spawning them as you enter the trigger.
09/11/2006 (7:57 pm)
Tom, that sounds like the way to go about it. Just have a fixed camera that centers (and possibly zooms/changes extents) over each room. Said rooms would have a trigger covering its entire extent that feeds size/extent info to the cameraMove function.However, Richard also mentioned that he was having trouble with enemy behaviour, which leads me to believe he may be referring to enemies outside of the current room are still active, and therefore exiting their predefined rooms or gathering at the entrance to the room. If this is the case, I would just suggest disabling the AI of any enemies not in the room, or spawning them as you enter the trigger.
#6
I need to learn a few things about cameras myself. I would prefer that when I approach the edge of the map, the camera lets me walk to the edge of the screen, as opposed to always keeping me in the center. For that matter, I want multiple players... most likely, two on a screen for my early attempts. So basically I want to keep both players on-screen (with a limit as to how far back the camera will zoom), and a way to keep the camera from peering over the edge of the world.
I'm a long way away from this ability, but Tom, any new camera features for the Adv Kit are more than welcome!
Richard, you can learn a lot from the Adv Kit, and there are some fun features to play with. Like breakable walls!
09/14/2006 (9:59 am)
That would be like the original Zelda. In a lot of those old NES games, if you left a room and came back, the enemies respawned (with the exception of some boss rooms).I need to learn a few things about cameras myself. I would prefer that when I approach the edge of the map, the camera lets me walk to the edge of the screen, as opposed to always keeping me in the center. For that matter, I want multiple players... most likely, two on a screen for my early attempts. So basically I want to keep both players on-screen (with a limit as to how far back the camera will zoom), and a way to keep the camera from peering over the edge of the world.
I'm a long way away from this ability, but Tom, any new camera features for the Adv Kit are more than welcome!
Richard, you can learn a lot from the Adv Kit, and there are some fun features to play with. Like breakable walls!
#7
It nicely restricts the camera as though it has it's own worldlimit clamp.
09/14/2006 (11:54 am)
To get the camera to not pan off of the edge of the map, you can use:sceneWindow2D.setViewLimitOn(%minX, %minY, %maxX, %maxY);
It nicely restricts the camera as though it has it's own worldlimit clamp.
#8
09/14/2006 (5:47 pm)
John, whoops, you're right. Of the old-school 2D Zelda games, I really only played the first one, so that's the camera model that always comes to mind when someone mentions those games.
#9
@Tom Eastman: Ah! Thank you! Now I just need to figure out how to handle something like this...
---------------------------________________
---------------------------|OOOOOOOOOOOOOO|
---------------------------|OOOOOOOOOOOOOO|
---------------------------|OOOOOOOOOOOOOO|
_________________|OOOOOOOOOOOOOO|__________
|OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO|
|___________________________________________|
...where the camera should only scroll horizontally, then as the player climbs a mountain, the camera can now go up or follow the player in that area. Is it possible to set multiple view limits? --If, for some reason, I don't want the camera to scroll up in that first part. Actually, what I'm really asking is if there's an easy way to do that (like a second set of min/max x/y values on the same or next line or something). It wouldn't kill me to just have the world shaped like a big box, since I plan to have a sky anyway. (I'm using the Adv Kit, but with somewhat of a Final Fight/Double Dragon type of view in mind.)
EDIT: Added dashes outside the world and Os inside the world, just so the spacing would work out. Hopefully, my crude diagram makes sense.
09/14/2006 (11:35 pm)
@Teck Lee Tan: Oh yeah! I wasn't trying to correct you, actually. I saw "Zelda" and immediately thought of that camera type myself, and simple meant the spawn-on-entry thing was also very old school. And I don't mean that in a bad way!@Tom Eastman: Ah! Thank you! Now I just need to figure out how to handle something like this...
---------------------------________________
---------------------------|OOOOOOOOOOOOOO|
---------------------------|OOOOOOOOOOOOOO|
---------------------------|OOOOOOOOOOOOOO|
_________________|OOOOOOOOOOOOOO|__________
|OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO|
|___________________________________________|
...where the camera should only scroll horizontally, then as the player climbs a mountain, the camera can now go up or follow the player in that area. Is it possible to set multiple view limits? --If, for some reason, I don't want the camera to scroll up in that first part. Actually, what I'm really asking is if there's an easy way to do that (like a second set of min/max x/y values on the same or next line or something). It wouldn't kill me to just have the world shaped like a big box, since I plan to have a sky anyway. (I'm using the Adv Kit, but with somewhat of a Final Fight/Double Dragon type of view in mind.)
EDIT: Added dashes outside the world and Os inside the world, just so the spacing would work out. Hopefully, my crude diagram makes sense.
#10
You want a camera view limit on a complex shape. I can't think of an easy way to do that. My first idea is to avoid it by building more content for the normally offscreen areas.
If not then maybe creating some sort of ViewLimitTrigger which changes the view limit when the player enters it. You then place these triggers to fit the rectangular areas where you want to limit the view.
09/15/2006 (12:30 am)
That's an interesting problem there, John. You want a camera view limit on a complex shape. I can't think of an easy way to do that. My first idea is to avoid it by building more content for the normally offscreen areas.
If not then maybe creating some sort of ViewLimitTrigger which changes the view limit when the player enters it. You then place these triggers to fit the rectangular areas where you want to limit the view.
#11
A ViewLimitTrigger... Interesting idea! I hope your advice isn't wasted on me... I'm such a novice. Anyway, if I (or a better programmer, which is 99.something% of the people in this community) figure out how to make that work, I'll put it to use! In the meantime, I can at least keep the camera inside one big box, which will still look good.
09/15/2006 (6:29 am)
Yeah... a bix box-shaped world is an acceptable alternative. Just trying to avoid vertical scrolling in areas that don't need to scroll up or down, but that's not a "must."A ViewLimitTrigger... Interesting idea! I hope your advice isn't wasted on me... I'm such a novice. Anyway, if I (or a better programmer, which is 99.something% of the people in this community) figure out how to make that work, I'll put it to use! In the meantime, I can at least keep the camera inside one big box, which will still look good.
#12
09/15/2006 (1:11 pm)
Well, if you wanted to, you could probably write your own camera clamping function - you'd just need to define areas where the camera is allowed (with boxes or something) and then restrict the camera moves every frame if it goes outside... but I'd say that for a game like yours, it would make more sense to just add some basic art outside the world. On the other hand, Tom's idea would make it really easy to add the hit-wall-and-view-moves-to-new-area functionality.
Associate David Montgomery-Blake
David MontgomeryBlake