Scrolling Game Development Kit Forum

SGDK Version 1 => Help/FAQ => Topic started by: billybob884 on 2005-05-07, 11:11:37 AM

Title: level reset problem
Post by: billybob884 on 2005-05-07, 11:11:37 AM
hi, just found a little problem within one of my levels. remember a while back i asked about putting in a timer, and durnurd or someone came up with that sequesnce opf events that creates the clock n whatnot? well, its that level. when i die on that level, the map doesnt reset, like any of the interactive tiles that the player has hit don't go back to where they were when the map is reset. the timer goes back ok, and all the sprites are back though. im in the porocess of checking the functions that are activated to create the "die" function, but nothing so far. any suggestions?

ill post the game later today if i havent found the problem.

-------added-later-------
Ok, I cut out most of the sound/video so it'd be as small as possible, so when you get to the title screen, just go to the level select and jump up at the blue tile with the brownish fish and green plant to get to the underwater level.

http://bwcomm.hollosite.com/Chameleon_Man.rar (~3.1mb)

you can get WinRar here (http://www.rarlab.com/rar/wrar35b3.exe) if you dont have it

-------added-even-later-------
Also, would someone mind taking a look at the 1st boss? When the bombs hit the ground (i.e., the explosion trigger sprite), the forth bomb explodes twice (when he goes right to left only, though).
Title: level reset problem
Post by: Orion Pax on 2005-05-07, 04:54:04 PM
The link isn't working for me.

I remember running into a similar situation on a map where I had bridge that colapsed as you walked across. I don't remember if I fixed it with the save/load game or a on death/reset a special fuction series that copied back the original tiles to that location when reseting the level. I imagine either one should work but it im not 100%on that.
Title: level reset problem
Post by: billybob884 on 2005-05-07, 07:21:26 PM
huh, it doesn't. ok, put it up on a new site:

download (~3.1mb) (http://www.angelfire.com/ct3/billybob884/Chameleon_Man.rar)
Title: level reset problem
Post by: bluemonkmn on 2005-05-08, 07:35:20 AM
Have you considered using the load game function as part of your reset?  That will reset *everything*.
Title: level reset problem
Post by: billybob884 on 2005-05-08, 08:26:26 AM
Hmm, but I kind of don't want the player to have to lose all his inventory (score, # of lives, ect). I guess I'll keep mulling around with it and see if I can't find another way.

-------------
I just tried setting up a 'dummy map' that the player would go to, then hit a global function to send back to the water level, but that didn't work, the only remaining thing I can think of is that the alter map function might be somehow interfering. im going to try deleting it then see if that works.

--------------
Ok, that didn't work, but on a hunch I decided to check a few other levels so see if it was a common problem, and it is. So, there must be a common cause between them, the only things I can think of that stay constant through out the game is the score, jewel/mag. adding, die series (although changes vary throughout each level), and the pause function. Now, since this is a fairly new problem, it has to be something that was done recently, and the only constant thing that was done recently (that I can think of) is the pause series, although I'm really not sure how this would affect the map reset... maybe that's the problem.

---------------
Ok, that's not the problem either...
Also, it's probably not a script problem either, because it's happening in the editor when I just press the play button
Title: level reset problem
Post by: durnurd on 2005-05-08, 10:31:18 AM
How is it that you expect the tiles to go back by themselves?  Changes to a map are saved when you leave the map.  That's why there's the "Disable Player Edits in Map Editor" function: So you don't accidentally change the map while editing it.  So really there are only a few ways to do it.  Either by having a copy map function (or several), a Save/Load function (And you could use script to keep the player's inventory), or reload the map using script....but I don't know if that last one is easily done or possible.
Title: level reset problem
Post by: billybob884 on 2005-05-08, 11:23:21 AM
well, the tiles have always gone back to the way they were. when the palyer would die, a switch to new map function would be called, and the playwe sould jsut teleport to the same map, and it would be back to the way it was originally.
I'm really not sure why it's not doing thgat anymore, and unless i've just imagined that that's how its been since i started in august last year, something has recently changed it. Hmm... let me look for one of my old backups to see if it really hasn't changed back and im just losing my mind :o .
Title: level reset problem
Post by: billybob884 on 2005-05-08, 11:46:06 AM
Oh my god, I really am losing my mind...

Wow, that was a real shock to my system... I could have sworn that the tiles always went back to the way they were...
holy crap. :o

Ok... well, I guess one solution would be to take advantage of the copy tiles function, just make each map that would change 2x as high, then copy all of the tiles to the bottom half, so you'd prety much have 2 of the same level per map, then create one giant function over the bottom half of hte level, and after the switch to new map function in the 'die_series' function, put an alter map function that copies all of the 2nd level to the top, over the first, so it would undo any tile changes made in the last play. The only thing that worries me (other than my apparent loss of mind) is that the animated tiles wont copy over, because when you use the Copy function in the editor and you copy a selection with an animated tile in it, it only copies hte perticular frame of the animation at the moment you release the mouse button. so would that happen with an alter map function?

-----later-----
Two more things, 1, can tiles be copied from one map to another with the alter map function?, And 2, are special functions (the blue box ones) reset upon a map switch?
Title: level reset problem
Post by: billybob884 on 2005-05-08, 03:16:44 PM
Allright! That alter map function idea worked like a charm. Just one more error before I leave you guys alone (well, 2 in 1),
When I try to edit one of my maps, the screen goes black like it's going into the editor but then closes and gives me these messages:

Object doesn't support this action
[OK]

Error editing map: CreateTileSet requires an open display
[OK]

I think the map may just be corrupt, but I really hope it isn't ::) .
Title: level reset problem
Post by: bluemonkmn on 2005-05-09, 05:41:10 AM
I'm not sure why you would be getting that error message... presumably it only happens on a particular map?  I might be able to figure it out if I look at the project.  Does the problem exist in the version of the project you uploaded?  (I haven't tried downloading it yet.)
Title: level reset problem
Post by: billybob884 on 2005-05-09, 06:14:10 AM
No.. actually I believe it just started to happen right after I tested the incorrect script in the other post... yea, it's only localized to the last map in the list.. 3-1ToxicBoss or something, and no its not in the package I've uploaded, so when I get home I'll put up a copy of it with the damaged map... I'm really pissed that it's not working b/c I spent all weekend (well, a good bit of friday afternoon) perfecting a very long series of events for the boss's attack sequence. It's not like I couldn't re-do it if I had to, but it'll definately take a little bit of patience.

-----added-later-----
Well, if the map file really is damaged, at least I've got about 1/3 of the work done in the uploaded version. So thats a start for me if/when I have to rebuild it...

here (http://www.angelfire.com/ct3/billybob884/corrupt.rar) are the damaged map and gpd files, and a few bmp's I added, and the music for the boss level (3-1...) so you can open it w/o disabling the bgm
Title: level reset problem
Post by: bluemonkmn on 2005-05-10, 05:44:45 AM
There are no GDP files in that archive -- just 3 BMPs and a MID.
Title: level reset problem
Post by: billybob884 on 2005-05-10, 05:57:53 AM
oh, oops, i'll put it in then i get home ::)


-----added-later-----
here
http://www.angelfire.com/ct3/billybob884/corrupt2.rar

The weird thing is that you can look at the layers in the quick view, and you can see the special functions and what-not, but if you go to edit a layer it crashes. i began to think it was the gdp, but i tried opening the map in another game and got the same message.
Title: level reset problem
Post by: bluemonkmn on 2005-05-11, 06:21:11 PM
That archive has a GDP, but there's still no map file.
Title: level reset problem
Post by: billybob884 on 2005-05-11, 07:25:45 PM
damnit.. u know, it's really been one of those days....  :x   well, yesterday was. try the link again now.
Title: level reset problem
Post by: bluemonkmn on 2005-05-12, 07:47:50 PM
I'm not at a good computer to do the test right now, but at least I could verify that it looks like I should be able to get all the necessary files now.
Title: level reset problem
Post by: billybob884 on 2005-05-13, 12:12:42 PM
What exactly will you be doing to test it? Do you mean like you have some sort of program or just to see if you get the same error
Title: level reset problem
Post by: bluemonkmn on 2005-05-14, 07:14:16 AM
Well the first step is to download all the files, which I didn't want to do here because it's a dial-up line (I just downloaded the corrupt2.rar file to see that it would provide the missing files).  So that's the main reason I haven't looked at it yet.  The next step is to run it normally and see if I think of anything obvious that would cause the error when I see it with my own eyes.  The next step is to look at various settings that are related to the area where the error is and see if I see anything out of order... maybe try changing a couple settings or deleting a couple objects to see if the error goes away.  Finally if none of that works, I run the project in a VB6 debugging environment (run GameDev in VB6) and see if I can catch the error as it happens to see where it is in the code and exactly why it happened.  And I don't have VB6 here, which is the other reason for not looking at it from here.  But I will be home again Monday and I will be able to look at it then if I have time.
Title: level reset problem
Post by: billybob884 on 2005-05-14, 07:56:06 PM
oh yea! figured it out! i was screwing around with the new version i was working on incase you couldnt fix it, and i got the same problem again. but this time i figured out that it was the background music causeing the error. as soon as i set it to play the music, it kept giving the error in the map editor and when i tried to play it. in hte sound manager, originally i had a midi as the music, but i deleted the midi n put an mp3 in, but never changed the media file, thats why it crashed. im about to test it now with the "corrupt" version. if you dont see an edit to this post then it worked and its all fixed; in which case, you may want to make a new error message display saying something aboutthe media file instead of tilesets or w/e it said before.