Pages: 1 ... 61 62 [63] 64
  Print  
Author Topic: Game Maker Help Thread!  (Read 172932 times)
SnoruntPyro
Shoot
*
Posts: 18


Class-A Douche


View Profile
« Reply #930 on: February 06, 2014, 08:15:23 PM »

I'm a sort-of-novice at Game Maker, so I have a few questions.

I'm adding Hell into the original, and I'm getting some problems with levels beyond Olmec:

The levels in Hell seem to have the abyss...any way to fix this?

How do I change transitions?

When I die on any Hell level (17-20), this error pops up. I've looked into this and there's no line 517...

Also, where does Spelunky store its flavor text (e.g. I HEAR SNAKES...I HATE SNAKES!)? I want to change the city of gold message.

Thanks!
Logged

wow
halibabica
Bossy
Mossy
*
Posts: 2118


old guard


View Profile Email
« Reply #931 on: February 07, 2014, 05:13:43 AM »

I don't remember exactly where the script for generating bottomless pits is, but I'd check around the scripts that make the ice levels. It might be due to an equation with the level counter.

If I remember correctly, the game uses the same transition room for every transition, and just changes its appearance based on level count.

oPlayer1's step event has multiple pages, so make sure you check all of them for line 517. It also includes some scripts, but I think it would specify if the error was in one.

Lastly, the flavor text is in one of oPlayer1's alarms.
Logged

Sometimes I wonder if I like Spelunky too much.
ManTrap mod - Tastes Like Spelunky
Hand-drawn comic - Spelunkying
Whooper1222
Mossy
*
Posts: 2414


View Profile WWW
« Reply #932 on: February 07, 2014, 07:00:19 AM »

Flavor text? Really?
Logged

halibabica
Bossy
Mossy
*
Posts: 2118


old guard


View Profile Email
« Reply #933 on: February 07, 2014, 08:23:07 AM »

Yes, really.
Logged

Sometimes I wonder if I like Spelunky too much.
ManTrap mod - Tastes Like Spelunky
Hand-drawn comic - Spelunkying
bloxxin
Mossbaby
*
Posts: 410


Long time no see...


View Profile
« Reply #934 on: February 07, 2014, 03:55:59 PM »

Isn't it called the 'Level Feeling'?
Logged

Moloch
Mosskid
*
Posts: 565


View Profile WWW
« Reply #935 on: February 07, 2014, 04:48:54 PM »

The levels in Hell seem to have the abyss...any way to fix this?

How do I change transitions?

When I die on any Hell level (17-20), this error pops up. I've looked into this and there's no line 517...
1.
Figure out which room you want to generate your hell levels in...the only difference between them is how deep they are. The bottomless level for the ice caves uses room rLevel2. You probably want to generate hell levels using rLevel (normal sized mine/jungle/temple levels) or rLevel3 (an extra room deep for jungle lakes). Also look at how global.levelType is used in scrInitLevel for generating the level borders.

2.
There's 2 transition rooms for each area, the only difference is their appearance. Control which level gets loaded next and which room size is used with oTransition. Look at the 'Animation End' event for oPlayer1 too for how to change where exit doors lead to.

3.
The error messages are confusing to read, yeah! 'ERROR in action number 3' narrows it down. When you have the Step event in oPlayer1 properties selected, you'll see the list of Actions on the right, the third one is an 'execute a piece of code' block - that's where you want to look for line 517.
But to fix *that* error i think you need to look in scrReadStats and scrWriteStats and increase the size of the array from 16 to your new highest level number.
Logged

Whooper1222
Mossy
*
Posts: 2414


View Profile WWW
« Reply #936 on: February 08, 2014, 01:57:37 AM »

Isn't it called the 'Level Feeling'?
That's what I wanted to point out in my previous post.
Logged

halibabica
Bossy
Mossy
*
Posts: 2118


old guard


View Profile Email
« Reply #937 on: February 08, 2014, 05:05:14 AM »

Flavor text is just a more general term.

Moloch is more helpful than me. I've been away from this too long. Lips Sealed
Logged

Sometimes I wonder if I like Spelunky too much.
ManTrap mod - Tastes Like Spelunky
Hand-drawn comic - Spelunkying
Moloch
Mosskid
*
Posts: 565


View Profile WWW
« Reply #938 on: February 08, 2014, 07:28:33 AM »

Each level has its own flavor, but overall it Tastes Like Spelunky. Riiiiight?
Logged

SnoruntPyro
Shoot
*
Posts: 18


Class-A Douche


View Profile
« Reply #939 on: February 08, 2014, 04:11:07 PM »

Thanks! The problems are fixed.

Next question: the music for Hell will not stop. It plays into the transitions, when I die, and continues into the title screen. I've added it to functions in oMusic, oScreen, stopAllMusic, startMusic, scrInit, and scrMusicFade, but it doesn't seem to stop. I temporarily switched the .ogg name out with the Jungle's and it still wouldn't stop, so it's not a problem with the .ogg.
« Last Edit: February 09, 2014, 06:11:00 AM by SnoruntPyro » Logged

wow
Bae
Mossy
*
Posts: 1696


Pro YoCo strats #AGDQ2014 #GYCL


View Profile
« Reply #940 on: February 10, 2014, 09:54:07 PM »

as far as I know Spelunky's music code has been a mystery for years

that said if anyone knows how to add additional songs beyond the accepted 5 to editor levels that would be neat
Logged


[0/18]complete

think about it. Zom-bees.
TyrOvC
Mossbaby
*
Posts: 424


This text is not random :(


View Profile WWW
« Reply #941 on: February 10, 2014, 10:33:09 PM »

Thanks! The problems are fixed.

Next question: the music for Hell will not stop. It plays into the transitions, when I die, and continues into the title screen. I've added it to functions in oMusic, oScreen, stopAllMusic, startMusic, scrInit, and scrMusicFade, but it doesn't seem to stop. I temporarily switched the .ogg name out with the Jungle's and it still wouldn't stop, so it's not a problem with the .ogg.
If you properly added it to stopAllMusic it should stop on transitions at least.  Can you paste the code you added to oMusic to load it and the code where you start playing it?

as far as I know Spelunky's music code has been a mystery for years

that said if anyone knows how to add additional songs beyond the accepted 5 to editor levels that would be neat
Add
Code:
global.custom_level_music_cache=ds_map_create();
somewhere near the end of scrInit.

in the script startMusic delete:
Code:
    else
    {
        playMusic(global.musCave, true);
        SS_SetSoundVol(global.musCave, 2000 + 8000 * (global.musicVol/18));
        SS_SetSoundFreq(global.musCave, 44100);
    }
and insert:
Code:
    else if(oLoadLevel.music == "CAVE")
    {
        playMusic(global.musCave, true);
        SS_SetSoundVol(global.musCave, 2000 + 8000 * (global.musicVol/18));
        SS_SetSoundFreq(global.musCave, 44100);
    }
    else{
        if(oLoadLevel.music==""){
            exit;
        }
       
        if(ds_map_exists(global.custom_level_music_cache,oLoadLevel.music)){
            var musicSuperSoundID;
            musicSuperSoundID=ds_map_find_value(global.custom_level_music_cache, oLoadLevel.music);
            playMusic(musicSuperSoundID, true);
            SS_SetSoundVol(musicSuperSoundID, 2000 + 8000 * (global.musicVol/18));
            SS_SetSoundFreq(musicSuperSoundID, 44100);
        }else{
            var musicSuperSoundID;
            musicSuperSoundID=SS_LoadSound("levels/"+oLoadLevel.music, 1);
            ds_map_add(global.custom_level_music_cache, oLoadLevel.music, musicSuperSoundID);
            playMusic(musicSuperSoundID, true);
            SS_SetSoundVol(musicSuperSoundID, 2000 + 8000 * (global.musicVol/18));
            SS_SetSoundFreq(musicSuperSoundID, 44100);
        }
    }
in the same location.

Finally ad:
Code:
//Cycle through and stop any custom level music that's been loaded
var tempKey, i;
tempKey=ds_map_find_first(global.custom_level_music_cache);
for(i=0; i<ds_map_size(global.custom_level_music_cache); i+=1) {
    SS_StopSound(ds_map_find_value(global.custom_level_music_cache,tempKey));
    tempKey = ds_map_find_next(global.custom_level_music_cache, tempKey);
}
To the the script stopAllMusic.

With that, should be able to add any custom "somemusic.ogg" to the level folder, and in a custom level file change "CAVE" or whatever to "somemusic.ogg" to play the custom music.

This is a quick, incomplete (and untested) example though. Needs unloading of music and clearing of the ds_map after the player wins or quits a custom level.

Edit:
Also possibly needs error handling for if the sound file is missing? If I remember right Super Sound silently fails by default though, so not really needed.
« Last Edit: February 10, 2014, 10:43:29 PM by TyrOvC » Logged

Bae
Mossy
*
Posts: 1696


Pro YoCo strats #AGDQ2014 #GYCL


View Profile
« Reply #942 on: February 10, 2014, 11:47:28 PM »

that is so many letters oh my god

but thank you
Logged


[0/18]complete

think about it. Zom-bees.
SnoruntPyro
Shoot
*
Posts: 18


Class-A Douche


View Profile
« Reply #943 on: February 11, 2014, 06:03:06 AM »

Here's the modified code:

in scrInit
Quote
SS_SetSoundVol(global.musTitle, 2000 + 8000 * (global.musicVol/18));
SS_SetSoundVol(global.musCave, 2000 + 8000 * (global.musicVol/18));
SS_SetSoundVol(global.musLush, 2000 + 8000 * (global.musicVol/18));
SS_SetSoundVol(global.musIce, 2000 + 8000 * (global.musicVol/18));
SS_SetSoundVol(global.musTemple, 2000 + 8000 * (global.musicVol/18));
SS_SetSoundVol(global.musBoss, 2000 + 8000 * (global.musicVol/18));
SS_SetSoundVol(global.musVictory, 2000 + 8000 * (global.musicVol/18));
SS_SetSoundVol(global.musCredits, 2000 + 8000 * (global.musicVol/18));
SS_SetSoundVol(global.musHell, 2000 + 8000 * (global.musicVol/18));

in stopAllMusic
Quote
SS_StopSound(global.musTitle);
SS_StopSound(global.musCave);
SS_StopSound(global.musLush);
SS_StopSound(global.musIce);
SS_StopSound(global.musTemple);
SS_StopSound(global.musHell);
SS_StopSound(global.musBoss);
SS_StopSound(global.musVictory);
SS_StopSound(global.musCredits);

in oMusic
Quote
global.musTitle = SS_LoadSound("sound/title.ogg", 1);
global.musCave = SS_LoadSound("sound/cave.ogg", 1);
global.musLush = SS_LoadSound("sound/lush.ogg", 1);
global.musIce = SS_LoadSound("sound/ice.ogg", 1);
global.musTemple = SS_LoadSound("sound/temple.ogg", 1);
global.musBoss = SS_LoadSound("sound/boss.ogg", 1);
global.musVictory = SS_LoadSound("sound/victory.ogg", 1);
global.musCredits = SS_LoadSound("sound/credits.ogg", 1);
global.musHell = SS_LoadSound("sound/hell.ogg", 1);
in startMusic
Quote
else if (oLoadLevel.music == "HELL")
    {
        playMusic(global.musHell, true);
        SS_SetSoundVol(global.musHell, 2000 + 8000 * (global.musicVol/18));
        SS_SetSoundFreq(global.musHell, 44100);
    }
Quote
else if (global.levelType == 5)
    {
        playMusic(global.musHell, true);
        SS_SetSoundVol(global.musHell, 2000 + 8000 * (global.musicVol/18));
        SS_SetSoundFreq(global.musHell, 44100);
    }

By the way, I get an error that says something along the lines of "error in function real()" attributed to oScreen, but I don't see anything. This happens outside of my mod. Probably happening because of the new hell.ogg file.
Logged

wow
SnoruntPyro
Shoot
*
Posts: 18


Class-A Douche


View Profile
« Reply #944 on: February 11, 2014, 05:45:56 PM »

By far the most confusing error message I've ever had.
Quote

___________________________________________
ERROR in
action number 1
of Create Event
for object oScreen:

Error in function real().
This probably has something to do with the music. There's no "real()" function anywhere.
Logged

wow
Pages: 1 ... 61 62 [63] 64
  Print  
 
Jump to: