Error: Unexpected symbol in expression

bleeze

Member
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.
 

bleeze

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.

Thank you this worked! thanks for advice :)
 
Top