I'm pretty new to game design, and programming specifically, so I'm hoping these types of problems will make more sense to me as time goes on. As of today, all the scripting and "argument" and "target" stuff feels a little more familiar, but it all gets me jumbled up if something doesn't go perfectly smooth when I try to run it--I have no idea where to even look. I've been following a tutorial for this, too, which makes it even more frustrating that I can't get it right. Anyway, when I try to do a test run, I get this error message:
___________________________________________
############################################################################################
ERROR in
action number 1
of Create Event
for object <undefined>:
DoConv :1: illegal undefined/null use
at gml_GlobalScript_spawn_off_camera (line 19) - repeat(number)
############################################################################################
gml_GlobalScript_spawn_off_camera (line 19)
Because the problem seemed to stem from the "number" argument, I decided to change it to an actual, numerical variable, and see what happened (I tried 1000 at first, and then I tried 10). But this didn't help me at all, as the game just entered a stalled, hung-up state and no window even opened up. In the Output feed, after all the chunks and everything loaded, this is what it stopped on:
...
Writing Chunk... DFNC
Writing Chunk... STRG
Stats : GMA : Elapsed=1095.0059
Stats : GMA : sp=8,au=6,bk=0,pt=0,sc=1,sh=0,fo=1,tl=0,ob=7,ro=4,da=0,ex=0,ma=5,fm=0xB20829F80020
DoSteam
Igor complete.
[Run] Run game
Options: Z:/SpaceRocks_E8718113\MainOptions.json
X://windows/Runner.exe -game "Y:/SpaceRocks_975F412_VM\SpaceRocks.win"
Attempting to set gamepadcount to 12
DirectX11: Using hardware device
Collision Event time(microsecs)=3
Here's the code for the script:
// GameMaker Language Preview (Read-Only)
// Declare Temp
var obj = argument0;
var number = argument1;
var pad = 64;
// Repeat
repeat(number)
{
// Declare Temp
var boundCheck = true;
// While Loop
while ((boundCheck == true)) {
// Get Random Number
var xx = (random_range(0, room_width));
// Get Random Number
var yy = (random_range(0, room_height));
// Function Call
with(obj_camera) {
var boundCheck = point_in_rectangle(xx, yy, cameraX - pad, cameraY - pad, cameraX + cameraWidth + pad, cameraY + cameraHeight + pad);
}
}
// Create Instance
instance_create_layer(xx, yy, "Instances", obj);
}
...I don't even know where to begin. Any help at all would be appreciated!
___________________________________________
############################################################################################
ERROR in
action number 1
of Create Event
for object <undefined>:
DoConv :1: illegal undefined/null use
at gml_GlobalScript_spawn_off_camera (line 19) - repeat(number)
############################################################################################
gml_GlobalScript_spawn_off_camera (line 19)
Because the problem seemed to stem from the "number" argument, I decided to change it to an actual, numerical variable, and see what happened (I tried 1000 at first, and then I tried 10). But this didn't help me at all, as the game just entered a stalled, hung-up state and no window even opened up. In the Output feed, after all the chunks and everything loaded, this is what it stopped on:
...
Writing Chunk... DFNC
Writing Chunk... STRG
Stats : GMA : Elapsed=1095.0059
Stats : GMA : sp=8,au=6,bk=0,pt=0,sc=1,sh=0,fo=1,tl=0,ob=7,ro=4,da=0,ex=0,ma=5,fm=0xB20829F80020
DoSteam
Igor complete.
[Run] Run game
Options: Z:/SpaceRocks_E8718113\MainOptions.json
X://windows/Runner.exe -game "Y:/SpaceRocks_975F412_VM\SpaceRocks.win"
Attempting to set gamepadcount to 12
DirectX11: Using hardware device
Collision Event time(microsecs)=3
Here's the code for the script:
// GameMaker Language Preview (Read-Only)
// Declare Temp
var obj = argument0;
var number = argument1;
var pad = 64;
// Repeat
repeat(number)
{
// Declare Temp
var boundCheck = true;
// While Loop
while ((boundCheck == true)) {
// Get Random Number
var xx = (random_range(0, room_width));
// Get Random Number
var yy = (random_range(0, room_height));
// Function Call
with(obj_camera) {
var boundCheck = point_in_rectangle(xx, yy, cameraX - pad, cameraY - pad, cameraX + cameraWidth + pad, cameraY + cameraHeight + pad);
}
}
// Create Instance
instance_create_layer(xx, yy, "Instances", obj);
}
...I don't even know where to begin. Any help at all would be appreciated!