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

[SOLVED] instance create w obj name in a variable?

E

Eisot

Guest
I have data in an ini file and it is read in to a variable. An "instance_create" is then called where the variable is in the place of the objects name. I am getting an "illegal type" error so I presume one can not do it this way.
Is that the correct conclusion?

The below code is in a script which is called in "room start" in a control object.
Code:
ini_open("UHstats.ini");
saddle = ini_read_string("transport","saddle", "");
ini_close();

if (saddle != ""){
    instance_create(375,403,saddle);
}
 

GMWolf

aka fel666
I just realized the power of asset_get_index... Json files are gonna pop up everywhere in my projects now!
 
Top