Castlevania Dungeon Forums
The Castlevania Dungeon Forums => Fan Stuff => Topic started by: Crimson_Curse on April 22, 2012, 04:04:58 PM
-
I'm making my own game called Castlevania: Epitaph of blood as a bunch of you guys may know already. But I was thinking about trying a metroidvania style for some rooms, but I can't get it to work.
I'm using Game maker 8 pro. If anyone can help a little with my problem it would be awesome!
I wanna be able to hit and object on ROOM1 and go to Room2 but get in on the same position I was before, cause when I enter the room, my player goes straight to the middle of the other room, and I want him to go right where the laast door was.
Just see a video of any sotn-like game and you'll know what I'm talking about.
Please :3
-
Put start up code in the second room that sets your character's x and y values to where you want him to be. If you have multiple entrances you're gonna need to make a global variable to so your code knows what entrance is being used and what coordinates to set.
-
You have to set the starting position of your character object for each room. I don't know game maker very well since I could never get it to run correctly. But if it is anything like the other software eg multimedia fusion, construct etc you have a frame for each room and at the start of that frame/layout you need to set the starting position of your character. You can't control it directly by the frame though. You need to create this in a way that allows moving into the frame from either end. So if you have a hall and it has a door on each side whatever frame you enter from has to place your character at the appropriate location to be on the other side. So if you leave the right side of a frame and want to enter on the left of the hall you need to have it place the character at a location on the left end of the hall. If you leave on the left side of a frame and want to enter the hall from the right you need to have it set your character at a location on the right end of the hall. You would follow that same method for every doorway and I would think you could control it based on where the character collides so on collision with X move character to Y location on Z frame.
-
Yeah! You got it. But you got the theory part... That's what I already thought about, but I can't get it to work.Maybe a little coding help would do the job. I mean I know that Cv2 revamped had this system. Esco's sotn has it too... There must be somebody that knows how to do it on codes to help me out :/
But thanks man! I'm glad you at least gave me a confirmation on the theory!
-
I don't understand what you're trying to do. Pictures please.
-
Put start up code in the second room that sets your character's x and y values to where you want him to be. If you have multiple entrances you're gonna need to make a global variable to so your code knows what entrance is being used and what coordinates to set.
By start up code I mean code you type into the creation code area of the room.
-
(https://castlevaniadungeon.net/forums/proxy.php?request=http%3A%2F%2Fwww.image-share.com%2Fupload%2F1436%2F222.png&hash=09bc4bbf3695972199bf7d8faa69a7ae)
Like this.
You collide on a door object or on an invisible spot on the border of a room and you go to the other room as if you just went thru a door. But being able to move back and forth while having the same position you had before leaving the room. Like you enter a door, on the other room it should be a door behing you.
-
Yeah. But I really don't know how to set up this system. And I really don't want to bother you guys. If anyone could make a gm8 file with a tutorial or just a ''put this code here and this one there'' text. I've already tried this back in 2010. I'm trying it again. And I'm starting to think I can't do it :/
-
It's really simple.
-Go to the creation code for the very first room.
-Declare some 2 global variable. (instructions are in the GM help file)
-Call one coordinate_x and the other one coordinate_y or whatever you prefer.
-Then in the door object have it set coordinate_x to player_object_name.x and coordinate_y to the player object's y.
-Now in the creation code of all the rooms put in two if statement if there's only one entrance, or two switch statements if there are multiple entrances.
-Have one statement check the value of coordinate_x and the other coordinate_y then set the player object's new x and y appropriately.
-So in this way you can make the room set the player object's new position automatically.
Another way to do it is make all your rooms persistent, but of course, this would hog more memory and then you have to make objects to regenerate enemies that were previously destroyed which would be a lot more work.
Either way this is all very basic code that you're gonna need to learn anyway so you should definitely use the help file and make it yourself.
-
I'll try it out later! Thanks!
-
Or download my Castlevania engine and study how I handled doors (ignore the transition effect) and how the objects btop_up, btop_dn, bbot_up, and bbot_dn tie in to each other.
Another thing to try, though I'm not sure how well it will work, is when you collide with the door, use
room_set_code(target room, "player.x=0; player.y="+string(y))
or
room_set_code(target room, "player.x=room_width; player.y="+string(y))
Something like that.
-
I've got an old Metroidvania engine I can send you if you want. It's nothing overly fancy as far as its features, but I'm sure you can adjust it to your needs.
-
Thanks guys! I'm glad that everyone around here is friendly!
Drac, I would love to take a look at your engine if its possible. Do you have some sort of link for it? You can PM me the link if you want :3 Thanks again !