SOLVED Cuestion about "instance_create_layer"

xpii

Member
Hello, I'm the first to use this community and I have a question about "instance_create_layer".

"instance_create_layer" requires object name as argument 4.
If I simply write the object name, it works.
However, I write the return value of my script, it doesn't work and I get the following code error.


>> instance_create_layer argument 4 incorrect type (undefined) expecting a Number (YYGI32)

How can I write the return value of a script in "instance_create_layer"?
I'm sorry about my poor English.
 

Mr Magnus

Viking King
A ) Did you call the script so that it actually returns something? "my_cool_script" is just the script itself. "my_cool_script()" will execute the script and if the return is valid that will work.

B ) Does the script actually return an object index and not say, a string? obj_player is fine, but "obj_player" is just a string with no meaning to gameMaker.


Without actually showing us the line in question we're a bit trapped at having to simply guess.
 
Top