Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - klazen108

Pages: 1 2 3 4 [5] 6 7 8 9 10 11 12 13 14 15 ... 20
61
Programming Questions / Re: Making a song only play once
« on: August 27, 2015, 11:59:10 AM »
This depends on which engine you're using.

In GM8/8.1, music is started with either the sound_play or sound_loop functions. If you were coding it yourself you could simply choose which one you wanted.
In GM8/8.1 with FMOD, you use FMODSoundPlay or FMODSoundLoop in the same way as above.
In GMS, you use audio_play_sound(song,0,0) for non-loop or audio_play_sound(song,0,1) for loop, where song is the sound resource name.

In Seph's engine or the KS engine, there is a musicFunctions script that starts the music based on the current room; you could add logic to see "is this the avoidance song, if so, do play, not loop".
In Yuuutu's engine or YoYoYo's engine, there is a playMusic object that starts the song, you could make a separate one that plays instead of loops.

62
Video Discussion / Re: Deathless stage 1 & 2 in Kamilia 2
« on: August 22, 2015, 07:29:20 PM »
This wasn't really much of a speedrun, more of a one video completion. A speedrun would be the game completed without any deaths, failed jumps or stopping. I have to give it that this is impressive, but it's not a good speedrun.

...wait

63
Programming Questions / Re: Small idea/question
« on: August 22, 2015, 07:23:26 PM »
GM Studio brings a powerful new set of functionality with it, called Shaders. Think of shaders as mini programs that run on your GPU, and directly process graphics while they're being drawn.

The effect you linked in that video is known as a kaleidoscope effect, and googling kaleidoscope shaders brings up some neat results!

Using GMStudio, you could add this shader, then turn it on while drawing your background image. Creating that effect would basically be a two step process. It's that simple!

64
Programming Questions / Re: smooth camera
« on: August 22, 2015, 07:11:39 PM »
hi sir pls make new object put this code in events and then put in room thx

Code: [Select]
////////////////Create Event:
smoothness_factor=6;

view_object=object_index;
view_vspeed=-1;
view_vborder=view_hview/2;
view_hborder=view_wview/2;


//////////////////////Step Event:
if (instance_exists(player)) {
    target_x=player.x;
    target_y=player.y;
   
    dist=point_distance(x,y,target_x,target_y);
    if (dist>64) {
        x=player.x;
        y=player.y;
        speed=0;
        exit;
    }
}
speed=dist/smoothness_factor;
direction=point_direction(x,y,target_x,target_y);
if (speed<1) speed=0;


////////////////////////////Room Start:
//copy of step event, to prevent flashing on room start

if (instance_exists(player)) {
    target_x=player.x;
    target_y=player.y;
   
    dist=point_distance(x,y,target_x,target_y);
    if (dist>64) {
        x=player.x;
        y=player.y;
        speed=0;
        exit;
    }
}
speed=dist/smoothness_factor;
direction=point_direction(x,y,target_x,target_y);
if (speed<1) speed=0;


65
Game Design / Re: Tutorial: Getting Started With Fangame Development
« on: August 20, 2015, 10:19:48 AM »
Yoyo actually edited the player in the KS engine and fixed the physics problems, I've ported his changes over and tested it and everything (including bunnyhopping) seems to work fine now. However, he's working on his own engine, so I'm going to let him release his before I release a patch for KS, I don't want to be that guy who steals all someone's code :P

Going forward, Yoyo's engine will probably be the Yuuutu equivalent, and this one the Seph equivalent. By that I mean you'll pick his engine if you want all the basic gimmicks pre-programmed for you, and you'll pick KS if you want more of a clean slate with only the basic physics provided.

Sorry for the silence recently, I've been pretty busy with work and other projects, not enough time in the day  :BibleThump:

66
Programming Questions / Re: Out of Memory Error
« on: August 18, 2015, 01:36:47 PM »
208MB? Oh yeah, that's absolutely your issue then. Since you're using the yosniper engine, the quick fix is to just convert those WAV files to mp3, and then put them back in your game. It'll work exactly the same, provided your game doesn't try to play two mp3s at once (gm8/8.1 can't do that). You only need to do this for the music, the sfx can and should stay as wav files.

After you've done that, if you still need to save memory, external loading of music is where you go to next. It would be easier if you were using, say, the Seph engine, since it comes with the FMOD sound engine and external music loading built right in, but setting up the yosniper engine to externally load music might be a little tricky (not to mention the potential source of some more memory leaks!) I wouldn't recommend it unless you feel comfortable modifying the engine like that.

67
Programming Questions / Re: Out of Memory Error
« on: August 17, 2015, 06:39:46 PM »
You mention you're using a particle system. When do you create and destroy your particle system? And which fangame engine are you using? If you're using an engine like yuuutu, and creating your particle system on game start, but not destroying it on game end, then you're actually creating a new particle system every time you press R! Try just opening your game, saving, and just pressing R over and over and see if you can get it to crash really fast - if so you've got a memory leak on your hands.

Also, how big is your project file (the gmk or gm81 file)? Just so I can imagine how much stuff is actually in your game, to see if that's becoming an issue. The effects wouldn't matter much, but large, animated sprites and backgrounds can really eat at your memory consumption without you noticing. Images are stored compressed in PNG format but are uncompressed when loaded into memory, dramatically increasing the amount of space they take up. As a quick example, a plain 800x600 black rectangle is just 4kb big as a PNG, but it's 1MB as a sprite! Music is another big one, especially if you store your music as WAV files (don't do that!).

68
Programming Questions / Re: Out of Memory Error
« on: August 17, 2015, 12:42:20 AM »
You mention that this only happens like 40% of the time, so it leads me to believe that your game has a memory leak. This is usually caused by acquiring handles for data structures, particle systems, maybe externally loaded sprites/backgrounds/music, etc. and then not freeing them when you're done. Does your game use any ds functions? (like ds_list_*, ds_map_*, etc). What about particle functions? (like part_system_create()) Or how about external loading? (background_add, sprite_add)? When you open a file for reading/writing, for instance during saving, do you close the handle afterwards? (file_bin_close or file_text_close)

If you can think of any of these things that might be in your game, it'll help pinpoint what might be wrong!

69
I highly recommend doing it the way Inferno said, that gives you a lot more freedom in being able to copy, paste, quickly scroll, search, etc.

If you're already too invested in a timeline, though, you could move the code you want to copy to a script, then have the steps call that script instead. Or you could do something like have the timeline set "alarm[0]=1" then have an alarm in the host object that fires the code you want at a certain interval.

70
User-Made Creations / Re: I wanna Get Cultured ver1.0.7
« on: August 09, 2015, 09:58:50 PM »
The "out of memory" error is caused because the game is too big to be loaded into memory. There have been reports of large fangames that worked in windows 7/8 not working in windows 10, sadly there's pretty much nothing that can be done about it aside from editing the game to remove some assets.

71
Gameplay & Discussion / Re: Xbox 360 controller problems
« on: August 07, 2015, 06:36:23 AM »
Most of these games have hardcoded input configurations, where it will only respond to the keys the developer picked. The other few allow you to configure the inputs yourself, in a settings menu in game or something. You can try changing your controls there if the game allows it.

Most people that use controller in fangames are required to use a third party program to remap their gamepad buttons to keyboard keys. Xpadder is the one I hear about most often. I've used JoyToKey before, but not for fangames, so I can't confirm it works. But in short, you will need to find a third party gamepad-to-keyboard mapper if you want to use a controller in fangames.

72
Programming Questions / Re: BGM Folder
« on: August 06, 2015, 10:08:49 AM »
no problem, just want to save everyone the pain I've had to go through :Kappa:

73
Programming Questions / Re: BGM Folder
« on: August 06, 2015, 09:00:54 AM »
Note that if you're doing sound_add, you should only do this once in your game, say at game start (and it will take time, so you should only load one song per step, otherwise the game will look like it's freezing). This is what's happening during that loading bar at the beginning of K3 - it's adding one sound, then ticking the loading bar, adding another sound, ticking the loading bar, until it's done.

Never load sounds elsewhere! If, for example, you tried to load the sound on room start in the room you want to play the music in, it's going to create a new copy of the sound every time you load that room! You'll notice the slow restart time, and it probably wouldn't take long for the game to crash from memory errors due to the memory being full of the songs you loaded. (Note that this advice doesn't apply to you if you're advanced enough to understand the tradeoffs and always release any allocated memory)

tl;dr only use sound_add at the start of your game, never anywhere else

74
Programming Questions / Re: Edit sprites with glow
« on: August 06, 2015, 08:50:49 AM »
I use a plugin for Paint.net called 'Alpha Mask' - this works great if the background is a solid black/white like that:

You just need to select the entire image, then copy it, and then choose the 'paste from clipboard' option in the plugin.

ALTERNATIVELY you could use an additive blend mode while drawing that sprite, that's probably what was intended - in additive blend mode, sprite colors are added to what's already on the screen, and since black is (0,0,0) the background colors are not changed. The bright parts also look "shinier", for this reason additive blend mode is often used for special effects like fire, sparks, magic, etc.
Code: [Select]
draw_set_blend_mode(bm_add);
draw_self();
draw_set_blend_mode(bm_normal);
(click to show/hide)

Get the Alpha Mask plugin here
Get Paint.NET here
How to install plugins in Paint.NET

75
Engines / Re: I Wanna Be the Engine KS Edition (For GMStudio)
« on: August 02, 2015, 07:23:07 PM »
It's been like that in pretty much all standard engine fangames, due to the fact that left/right uses a keyboard_check_direct function which picks those up even when not in focus. If you'd like to disable it you can do what derf suggested. I'm wondering if freezing the game when out of focus would hurt anything, if not I might put it in by default with the KS engine because I've died many times in RMJ practicing jumps while a game was open in the background :Kappa:

Pages: 1 2 3 4 [5] 6 7 8 9 10 11 12 13 14 15 ... 20