• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Compile error for my first game

A

amp987

Guest
Compile started: 1:57:36 AM
"C:\Users\Porters\AppData\Roaming\GameMaker-Studio\GMAssetCompiler.exe" /c /m=win /debug /config="Default" /tgt=64 /obob=True /obpp=False /obru=True /obes=False /i=3 /j=8 /cvm /tp=2048 /mv=1 /iv=0 /rv=0 /bv=1763 /gn="Asteroids Game" /td="C:\Users\Porters\AppData\Local\Temp" /cd="C:\Users\Porters\Documents\GameMaker\Cache" /sh=True /dbgp="6502" /hip="192.168.2.53" /hprt="51268" /o="C:\Users\Porters\AppData\Local\Temp\gm_ttt_398\gm_ttt_42669" "C:\Users\Porters\Documents\GameMaker\Projects\Asteroids Game.gmx\Asteroids Game.project.gmx"

Reading project file....finished.
Compile Constants...finished.
Remove DnD...finished.
Compile Scripts...finished.
Compile Objects...finished.
Compile Timelines...finished.
Compile Triggers...finished.
Compile Rooms...finished.
Compile Extensions...finished.
Global scripts...finished.
Final Compile...Error : gml_Object_obj_asteroid_CollisionEvent_0_1(12) : malformed with statement
finished.
Saving IFF file... C:\Users\Porters\AppData\Local\Temp\gm_ttt_398\gm_ttt_42669\Asteroids Game.win
Writing Chunk... GEN8
Writing Chunk... OPTN
Writing Chunk... LANG
Writing Chunk... EXTN
Writing Chunk... SOND
Writing Chunk... AGRP
Writing Chunk... SPRT
Writing Chunk... BGND
Writing Chunk... PATH
Writing Chunk... SCPT
Writing Chunk... GLOB
Writing Chunk... SHDR
Writing Chunk... FONT
Writing Chunk... TMLN
Writing Chunk... OBJT
Writing Chunk... ROOM
Writing Chunk... DAFL
Writing Chunk... TPAGE
Writing Chunk... CODE
Writing Chunk... VARI
Writing Chunk... FUNC
Writing Chunk... STRG
Writing Chunk... TXTR
0 Compressing texture... writing texture texture_0.png...
Writing Chunk... AUDO
Writing Chunk... SCPT
Writing Chunk... DBGI
Writing Chunk... INST
Writing Chunk... LOCL
Writing Chunk... STRG
Stats : GMA : Elapsed=1381.1071
Stats : GMA : sp=5,au=2,bk=0,pt=0,sc=0,sh=0,fo=2,tl=0,ob=8,ro=1,da=0,ex=0,ma=3,fm=0x8280060
Asset Compile finished: 1:57:39 AM
Compile finished: 1:57:39 AM
 
A

amp987

Guest
what is a malformed with statement
Here is my picture of my objects in my obj_asteroid object which one do i choose to check the code for?
 

Attachments

R

renex

Guest
What's your Studio version? I feel like it should be giving out a clearer error message.

Anyways, post code on both collision events.
 
A

amp987

Guest
My studio version is 1.4.1763
and this all my code for the collision event with obj_player
var randomangle = random(360);
var o;
o = instance_create(x,y,obj_dead_player);
o.angle = 0 + randomangle;
o = instance_create(x,y,obj_dead_player);
o.angle = 120 + randomangle;
o = instance_create(x,y,obj_dead_player);
o.angle = 240 + randomangle;

with (obj_dead_player);
{
direction = angle;
image_angle = angle;
speed = 3;
}

audio_play_sound(snd_explosion, 10, 0);
instance_create(0,0,obj_game_over);
instance_destroy();

Then this is all the code for obj_bullet
 

Attachments

rIKmAN

Member
what is a malformed with statement
A malformed 'with' statement is a 'with' statement that isn't formatted / used correctly.
As you see in the code you posted - you use the keyword "with", see it in your code below.
Code:
with (obj_dead_player);
{
    direction = angle;
    image_angle = angle;
    speed = 3;
}

audio_play_sound(snd_explosion, 10, 0);
instance_create(0,0,obj_game_over);
instance_destroy();
To fix your error, remove the ';' from the end of the 'with (obj_dead_player);' line and try compiling again.
 
A

amp987

Guest
Oh my gosh thank you so so much this actually worked. Do you mind if you can help me with another problem i have?
 

rIKmAN

Member
Oh my gosh thank you so so much this actually worked. Do you mind if you can help me with another problem i have?
Sure I'll do my best, but you have to try and work things out yourself as well, otherwise you never learn anything.

I'll definitely try and point you in the right direction though, what's up?
 
A

amp987

Guest
I have this error my other game its an rpg game
It says there is a error at line 31 pos 37: symbol ) expected.
/// scr_move_state
scr_get_input();

//Get the axis
var xaxis = (right_key - left_key);
var yaxis = (down_key - up_key);

// Get direction
var dir = point_direction(0, 0, xaxis, yaxis);

// Get the length
if (xaxis == 0 and yaxis = 0) {
len = 0;
} else {{
len = spd;
}
// Get the hspd and vspd
hspd = lengthdir_x(len, dir);
vspd = lengthdir_y(len, dir);

//Move
phy_position_x += hspd;
phy_position_y += vspd;

// Control the sprite
image_speed = .2;
if (len == 0) image_index =0;

// Vertical Sprites
if (vspd > 0) (
sprite_index = spr_player_down;
) else if (vspd < 0) (
sprite_index = spr_player_up;
)

// Horizontal sprites
if (hspd > 0) (
sprite_index = spr_player_right;
) else if (hspd < 0) (
sprite_index = spr_player_left;
 

FrostyCat

Redemption Seeker
Being new to coding doesn't mean you get a free pass to write code without proofreading it.

Here you clearly have one extra brace:
Code:
} else {{
And here you are using brackets instead of braces to enclose code blocks, and the last block is still open:
Code:
// Vertical Sprites
if (vspd > 0) (
sprite_index = spr_player_down;
) else if (vspd < 0) (
sprite_index = spr_player_up;
)

// Horizontal sprites
if (hspd > 0) (
sprite_index = spr_player_right;
) else if (hspd < 0) (
sprite_index = spr_player_left;
If you've learned anything from the tutorial you copied all this from, it should be pretty obvious at this point what you should do.
 
A

amp987

Guest
Thank you so so much it actually worked and I fixed it i put the braces in the right spots and I just learned something new.
 

rIKmAN

Member
I have this error my other game its an rpg game
It says there is a error at line 31 pos 37: symbol ) expected.
Dude come on.
You can clearly read because you are replying to people in this thread - read what it says.

It clearly tells you what the error is, what line the error is on, what character position within that line the error is at, and even what character it expects to find there.

You may be new to coding but that doesn't stop you from being able to read and follow simple clear instructions in the error message.
 
Top