Author Topic: Game Maker Problem  (Read 1193 times)

Lets say ive just typed a line of whatever.

if keyboard_check

Say I tried to put the letter z after the underscore, it would delete the letter
infront of it (which is C) and replace it with Z.
Can anyone tell me how to stop it? I remember this happening in word documents and notepad all the time.

It's called insert/replace mode. Press the ins key.

Why is that feature even on computers? It's just stupid.

Why is that feature even on computers? It's just stupid.

amazingly handy for programming if you realize that you hit the button. if not, pain in the ass.

Oh thank god
Im forever in your debt Extrude

Another problem, ive been at this for about 2 hours now.
This is the code for the sprite to move, change animations an all that jazz, it worked until
I started adding in things for the collision.
The game starts and the guy is stood there doing nothing, but when you press the up key the animation to go whatever direction
your facing starts to play and he doesn't move , same with the left key. If I press the right key the game comes up with this error:

of  Step Event
for object Object_Player:

Error in code at line 47:
   if 'place_meeting(x-1,y,object_Wall)
      ^
at position 5: Expression expected

_____________________________ ______________
ERROR in
action number 1
of  Step Event
for object Object_Player:

Error in code at line 47:
   if 'place_meeting(x-1,y,object_Wall)
      ^
at position 5: Expression expected


If I press the down key I get this:

of  Step Event
for object Object_Player:

Error in code at line 47:
   if 'place_meeting(x-1,y,object_Wall)
      ^
at position 5: Expression expected

_____________________________ ______________
ERROR in
action number 1
of  Step Event
for object Object_Player:

Error in code at line 8:
       if 'place_meeting(x,y-1,object_Wall)
          ^
at position 9: Expression expected

This is the actual code:



if keyboard_check(vk_down)
{
sprite_index = Player_Down;
y += 3;

    for(a = 1; a < 5; a += 1)
    {
    if 'place_meeting(x,y-1,object_Wall)
    {

    y += 1

            }
        }
    }
if keyboard_check(vk_up)
{
sprite_index = Player_Up
y -= 3;

for(a = 1; a < 5; a += 1)

{

if 'place_meeting(x,y-1,object_Wall)

}

y -= 1

}






if keyboard_check(vk_right)
{
sprite_index = Player_Right
x += 3;

for(a = 1; a < 5; a += 1)

{

if 'place_meeting(x-1,y,object_Wall)

}

x -= 1


}


}




if keyboard_check(vk_left)
{
sprite_index = Player_Left
x -= 3;

for(a = 1; a < 5; a += 1)

{

if 'place_meeting(x+1,y,object_Wall)

}

y += 1

}










if keyboard_check(vk_down) or keyboard_check(vk_up) or keyboard_check(vk_right) or keyboard_check(vk_left)
{
    image_speed = .3;
}
else
image_speed = 0;

I've tried re-writing things, removing stuff but nothings working and I don't want to have to type it out again, it wouldn't be so bad
if I knew which parts were messing up so I could copy and paste the good stuff but I haven't a clue whats going on, and this is my first time doing gml.
« Last Edit: April 05, 2012, 01:22:26 PM by brad block »


Just tried that, more problems.

GML is picky, you can't have a decimal number defined with the decimal point first. In other words, .3 is invalid but 0.3 is perfectly fine.

I got past the whole collision thing its fine now, but im having trouble with the enemy.


_____________________________ ______________
FATAL ERROR in
action number 1
of  Step Event
for object Object_Enemy:

COMPILATION ERROR in code action
Error in code at line 1:
   if !collision_line(x,y-16,Object_Player.y - 16, obj_solid,0,1)
                                                               ^
at position 62: Wrong number of arguments to function or script.

I dont understand what that means.
It also comes up with this:



_____________________________ ______________
FATAL ERROR in
action number 1
of  Step Event
for object Object_Enemy:

COMPILATION ERROR in code action
Error in code at line 1:
   if !collision_line(x,y-12,Object_Player.y - 16, obj_solid,0,1)
                                                               ^
at position 62: Wrong number of arguments to function or script.
« Last Edit: April 05, 2012, 03:38:08 PM by brad block »