• 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!

Error: Unexpected symbol in expression

B

bleeze

Guest
I'm not used to programing, have very basic skills. Tried creating a 2d Array, maybe it doesn't work this way?
Anyway, i followed a youtube video for creating inventories, he did use Gms 2 and im using Gms, which could be the issue. Pls help me in any way possible! It's the position of the "underscore" ( " _ " ) that causes the error.


var _typeofitem = argument0
var _sprite = argument1

itemdef [ _typeofitem, itemprop.sprite ] = _sprite
 

Binsk

Member
Normally it doesn't matter in GameMaker except for this one case:

You need a semicolon at the end of a line that starts with var.

For future reference, please copy+paste the actual error message. It usually has some extra info.
 

Binsk

Member
You need an Assessor after Itemdef
Not if it is an array. It should be just fine without one.

The only time you use an accessor w/ an array is to modify by reference when passed into a script, all other times are unnecessary. All other data structures, however, do indeed need them.
 
B

bleeze

Guest
Normally it doesn't matter in GameMaker except for this one case:

You need a semicolon at the end of a line that starts with var.

For future reference, please copy+paste the actual error message. It usually has some extra info.

Thank you this worked! thanks for advice :)
 
Top