Pages: 1 ... 60 61 [62] 63 64
  Print  
Author Topic: Game Maker Help Thread!  (Read 324421 times)
hyperme
Mosskid
*
Posts: 888



View Profile
« Reply #915 on: June 13, 2013, 01:44:22 PM »

Ok. I read through everything, and I feel confident in my understanding of how the level randomization works. But I still don't know how the game tests for whether or not a level is solvable. Is there anything written on that?

Cleverly. Some dice rolls involved, via rand(). Also remembering the previous location.

From what I've worked out from scrLevelGen():

0. Create a 4 by 4 array to represent the level path. Fill it with 0.
1. Pick a random X position on the top of the level for the entrance. The top is row 0. This is important later!
2. Set your 'location' to the entrance.
3. Pick a direction from left/right/down to move randomly.
4. If the position you want to move to has a 0, move into it and make it a 1.
5. Repeat 4 and 5. Eventually, you'll;
a) Decide to move down.
b) Hit the edge of the level, not be able to turn back because a 1 is behind you. So you have to go down.
6. When you move down, make the space you moved into a 3. Make the space you moved from a 2.
7. Repeat 4, 5 and 6 until you try to move into row 4.
8. Set the exit on row 3 where you tried to move down.
9. Do all the level gen stuff.

Now, since scrLevelGen() is lightly commented, some of this, name the level size, might be wrong. But I'm pretty sure most of it is right.

EDIT:
To track the room path number in Spelunky, add this to an execute code block in oPlayer1's draw event. It's educational.

Code:
if(isRealLevel())
{
draw_set_font(global.myFontSmall);
draw_set_color(c_blue);
draw_text(x,y, global.roomPath[scrGetRoomX(x), scrGetRoomY(y)]);
}
« Last Edit: June 13, 2013, 01:56:29 PM by hyperme » Logged
CaSoDaN
Bean
*
Posts: 105



View Profile
« Reply #916 on: June 25, 2013, 01:03:56 PM »

Help?!?!

Randomly happened when I tried to test my new mod.
Logged
Moloch
Mosskid
*
Posts: 565


View Profile WWW
« Reply #917 on: June 25, 2013, 02:15:21 PM »

Help?!?!

Randomly happened when I tried to test my new mod.

The fate of your mod has been decided. It has no future.
Logged

CaSoDaN
Bean
*
Posts: 105



View Profile
« Reply #918 on: June 25, 2013, 02:27:31 PM »

Help?!?!

Randomly happened when I tried to test my new mod.

The fate of your mod has been decided. It has no future.
CAN'T BE!
Logged
Moloch
Mosskid
*
Posts: 565


View Profile WWW
« Reply #919 on: June 25, 2013, 02:32:53 PM »

 Cheesy
What version of Game Maker are you using? Did the game run before you added your modding changes? I've never seen that error so more info would help.
Logged

CaSoDaN
Bean
*
Posts: 105



View Profile
« Reply #920 on: June 25, 2013, 02:36:34 PM »

Cheesy
What version of Game Maker are you using? Did the game run before you added your modding changes? I've never seen that error so more info would help.
I'm using 8.0, and I didn't test it before I added the new features. Also I was using the Editor Plus Fan Update source.
« Last Edit: June 25, 2013, 02:38:22 PM by Magician » Logged
Moloch
Mosskid
*
Posts: 565


View Profile WWW
« Reply #921 on: June 25, 2013, 02:53:27 PM »

I'm using 8.0, and I didn't test it before I added the new features. Also I was using the Editor Plus Fan Update source.

i'm still guessing, but here's a few ideas.
- make sure you have the files/folders that come with the original Spelunky .zip in the folder you are testing the source from (or running the .exe)... supersound.dll and the sound folder are needed for it to run at the very least
- test any other .gmk see if it runs
Logged

CaSoDaN
Bean
*
Posts: 105



View Profile
« Reply #922 on: June 25, 2013, 03:04:38 PM »

I tried all of those.
Logged
Moloch
Mosskid
*
Posts: 565


View Profile WWW
« Reply #923 on: June 25, 2013, 03:10:01 PM »

Your screenshot looks like Windows 8. I have no experience running GM on Windows 8...maybe that has something to do with it...otherwise I'm out of guesses!
Logged

CaSoDaN
Bean
*
Posts: 105



View Profile
« Reply #924 on: June 27, 2013, 05:27:30 PM »

How would one go about adding custom music? I put this in the startMusic script:
if (isRoom("rSuper"))
    {
        if (oPlayer1.active)
        {
            playMusic(global.musSuper, true);
            SS_SetSoundVol(global.musSuper, 2000 + 8000 * (global.musicVol/18));
            SS_SetSoundFreq(global.musSuper, 44100);
        }
        }

I also added this to the oMusic code:
global.musSuper = SS_LoadSound("sound/boss2.ogg", 1);

EDIT: Moloch helped me fix it. Thanks Moloch!
« Last Edit: June 27, 2013, 07:22:59 PM by SuperX46 » Logged
hyperme
Mosskid
*
Posts: 888



View Profile
« Reply #925 on: August 17, 2013, 03:05:50 PM »

How do I perform the fancy many screen trickery the Title room has? When I try it, the game insists on setting the view position to (0,0). What do I change to stop that, so my view scrolling scrolls?
Logged
SuperX46
Mossbaby
*
Posts: 325



View Profile
« Reply #926 on: October 25, 2013, 05:22:51 PM »

How do you add new enemies? Do I just add programming to the enemy, set it's parent to oEnemy and it does it automatically? And how would I make it only spawn in a specific area? Would love help.
Logged
halibabica
Bossy
Mossy
*
Posts: 2174


old guard


View Profile Email
« Reply #927 on: October 25, 2013, 07:25:57 PM »

It depends on what kind of enemy you want to make. If there's something similar already, you can duplicate the existing enemy and make whatever changes are needed. Having oEnemy as the parent is a good idea, but not always necessary. What enemies spawn in what locations is controlled by one of the level gen scripts. I can't remember which, but it should be easy to find.
Logged

Sometimes I wonder if I like Spelunky too much.
ManTrap mod - Tastes Like Spelunky
Hand-drawn comic - Spelunkying
ATP
Bean
*
Posts: 184


4 Colors > 1


View Profile Email
« Reply #928 on: January 01, 2014, 05:19:17 PM »

I need to add saving and loading to custom levels. My first few attempts were simple game_save and game_load operations that worked fine until I restarted the game, at which point they caused it to crash when I loaded and tried to move between levels.

Does anyone have any ideas? I'm not sure how to approach this.
Logged

halibabica
Bossy
Mossy
*
Posts: 2174


old guard


View Profile Email
« Reply #929 on: January 01, 2014, 07:57:01 PM »

Editor Plus and TLS have some basic auto-saving features already. You could probably expand off of those to something more flexible.
Logged

Sometimes I wonder if I like Spelunky too much.
ManTrap mod - Tastes Like Spelunky
Hand-drawn comic - Spelunkying
Pages: 1 ... 60 61 [62] 63 64
  Print  
 
Jump to: