Jump to content


Cloud Architect

Member Since 26 Apr 2005
Offline Last Active Aug 17 2012 01:19 PM

Topics I've Started

Game crashing when loading a save file?

06 February 2012 - 12:06 AM

Sup dudes.

I've got a really bizarre problem to do with the inbuilt 'game_save' and 'game_load' functions when I use them in my game. I can't pinpoint it down to what piece of code isn't working so I can't post anything of that nature here for now unless I find out suddenly :/

I created a main menu which has a 'new game' and 'continue game' option. I wrote the code so that I could save by pressing space during the main game so I could test it, when I exit from the main game to the main menu and press continue it loads perfectly. I can also save it as a file so I can select different ones and they all work.

But when I exit my game, and re-open it, to test if it'll open after the game has been closed, when I go to continue on my main menu and open any file, it crashes the game, even though it worked when I saved and loaded while the game was running. What in the name of...

I tried making a separate room for loading games in to see if it was to do with the controls in the step event of my menu object but they weren't bugged out at all.

Does anyone have any ideas what might be happening? I really am completely lost on this one.

Cheers x

Character Teleports When Colliding With a Wall

11 June 2011 - 08:23 PM

Sup guys :)

I'm working on a game at the moment, but I've come across something that's really stumped me and doesn't seem to be anywhere on here. :/

It's a platform game.

My problem is that I created a collision script which detects the side of a block you hit and changes hspeed and vspeed properly depending on where you hit it, but a really strange error occurs when you fall from the top inbetween two blocks, the player literally teleports about 200 pixels away from where he was to the right or left, I don't even use the X or Y variable to move the player around so seriously whaaattttt :(!

I've provided a link for download so you can get in there and see what's wrong with it, because I'm lost, even in debug mode looking at the variables for the player hasn't shown anything significant.

It requires that you have GM8, I use pro so I advise you have it too. If you don't have GM8 then I've put the scripts in the zip file with it :), there are 4 of them. I've done this because I can't pinpoint the problem anywhere, otherwise I would have posted the specific part of the code :/

Thanks in advance for your help!

Download Here

EDIT: To recreate the error jump onto one of the single blocks and move to the left and just allow yourself to fall until you land. You'll land between two blocks, not quite on one or the other. The player will then randomly spawn somewhere else.

Posted Image

Cannot Make All Instances Of An Object Move Down

12 April 2010 - 09:10 PM

THE PROBLEM

I'm making a space invaders clone in my (infrequently) spare time.

I've coded the aliens movement so far so that it's all retro and nice.

But my concern is, once the aliens reach the side of the screen, the column of aliens closest to the edge of the threshold drop and change direction while the ohers continue on until they reach the threshold themselves (and inevitably drop down also).

I've tried "with(obj_alien)" to make every single alien drop and change direction but this hasn't worked.
I also tried 'obj_alien.y += sprite_height;' but that didn't work either


SOME SOURCE CODE :chikin
//If you recreate the aliens in gamemaker using this source code you should be able to see the problem happen in front of your very eyes!
(NOTE: The object using this code is a control object. The alien has this object as it's parent)

Create Event
dir = 0; //Direction = Right
alarm[0] = 20; //Start the alien movement

Alarm 0
{   

	//Right
	if dir = 0
	{
		x += 8;
		if x = room_width - sprite_width //When reaching threshold
		{
			y += sprite_height; //Go down and change direction
			dir = 1;
		}
		alarm[0] = 20;
	}

	//Left
	if dir = 1
	{
		x -= 8;
		if x = 0 //When reaching threshold
		{
			y += sprite_height; //Go down and change direction
			dir = 0
		}
		alarm[0] = 20; 
	}
	
}

Help would be very much appreciated as I'm really quite stuck...

Thanks in advance! :P

Space Invaders Alien Movement

04 April 2010 - 08:43 PM

I'm creating a space invaders clone. The alien movement is completely throwing my brain.

Once the alien reaches the edge of the screen it WON'T stop moving down... I've tried to implement a variable which tells the alien that it can only move down once, but it didn't work.

This is the create event:
//Important variables declaration...
isleft = false;
drop = false;

//set the alarm ball rolling...
alarm[0] = 20;

I have an alarm which dictates the movement of the aliens which looks like this:
{

	if x < 32 || x > room_width - 64
	{
		drop = true;
		alarm[0] = 20;
	}
	
	if drop = false
	{
		if isleft = true
		{
			x -= 8;
		}
		else
		{
			x += 8
		}
		alarm[0] = 20;
	}

	if drop = true
	{
		y += sprite_height;
		drop = false
		if isleft = true
		{
			isleft = false;
		}
		if isleft = false
		{
			isleft = true;
		}
		alarm[0] = 20;
	}
	
}

Does anyone have a simpler way of doing this?

A List Of Games In Order Of Complexity To Create

02 April 2010 - 05:30 PM

I recently picked up the game maker apprentice because I wanted to get back into GML and game maker again, got to the programming part of it and the step forward was like hitting a brick wall once it went on to the tic tac toe chapter. I've been a bit thrown by the syntax of GML and the way it implements things since programming in VB.Net for computing at college and making a database app for coursework. The for looping crashes endlessly ¬_¬.

So my question is, do any experienced users have a list of games to program in GML in an order of complexity in which to somewhat master GML with? Like a "n00b 2 pr0" kind of thing for game maker games written ONLY with GML to learn it's syntax well and truly and apply it.

Thanks in advance :mellow: