Mac OSX room_goto() issue... scripts/objects don't initialize

N

NValorz

Guest
First time creator/poster!

I'm making an endless runner that had been going seamlessly... until I made a title screen. The title screen has a simple object that, when enter is pressed, executes "room_goto(rm_level1)". The issue is when I go into level 1, only some of the objects initialize. The below objects exist (and work) when the title screen is NOT present:

  • Player
  • Infinitely generating platforms
  • Crystals (points, "cry")
  • Healing/Hurting items
  • Boxes
The crystals, items, and boxes don't initialize when the title screen DOES exist. They're drawn in using the below script:

Code:
///gen
   {
   alarm[0] = 90;
   i = choose(scr_cry1, scr_cry2, scr_cry3);
   h = choose(416, 448, 480, 512)
   instance_create_layer(room_width, h, "Instances", obj_ground)

///create crystals
   script_execute(choose(i,i,i), irandom(1));

///create boxes
   if (global.current_score < 50) {
       instance_create_layer(room_width+(irandom_range(64, 288)), h, 0, obj_box); 
       instance_create_layer(room_width+(irandom_range(570, 800)), h, 0, obj_box);
   }
   else {
       instance_create_layer(room_width+(irandom_range(64, 288)), h, 0, obj_box);
       instance_create_layer(room_width+(irandom_range(320, 538)), h, 0, obj_box);
       instance_create_layer(room_width+(irandom_range(570, 800)), h, 0, obj_box);
   }

}
I don't think it's a persistence issue as I've tried making every object persistent before running the game. I've also tried explicitly executing the creation script in the rooms create code, but no dice. I'm currently using GameMaker Studio 2 on Mac, thank you for reading this and let me know if you can help!
 
N

NValorz

Guest
what object is that in?
edit: I think you might be onto something with your alarm theory?

The object is in "rm_level1", the only object in the title screen room is a string gen with "if enter is pressed, room_goto(rm_level1)".
 

Jakylgamer

Member
ok, wasnt sure how you were calling that so thats why i had that at first then i thought about it a bit and changed it :p
but i hope it helps :)
 
N

NValorz

Guest
Appreciate it! I'll have to remember to follow up if it works :)
 
N

NValorz

Guest
The object only exists on rm_level1, does it still need to be persistent?
 
Top