Jump to content


Photo

(HTML5/Win) room_persistent working differently


  • Please log in to reply
3 replies to this topic

#1 Polatrite

Polatrite

    GMC Member

  • New Member
  • 28 posts

Posted 26 February 2012 - 09:24 PM

I am an old GM user who is trying to take some of his old apps and convert them into HTML5.

I have some code so the player can hit the "E" key and bring up a spell menu to select different spells. He then can hit "E" again to go back to the game. It uses room_persistent to keep the room alive as it switches from the Game room to the Menu room and back to the Game room.

In the player Step event:


if (keyboard_check_pressed(ord('E')))
    {
        global.mousedown = 0;
        global.autofire = 0;
        show_message(global.lastroom);
        show_message(room);
        global.lastroom = room;
        show_message(global.lastroom);
        room_set_persistent(room, true);
        room_goto(room_stats);
    }

In the menu Step event:

if (keyboard_check_pressed(ord('E')) || keyboard_check_pressed(vk_escape))
    {
        show_message(global.lastroom);
        room_set_persistent(room, true);
        room_goto(global.lastroom);
    }

If I ran this code in Windows mode, in the HTML5 editor, it will work fine. When the show_message() boxes pop up, they will print out the room index (5) for global.lastroom, and they'll transition the player correctly.

But when I run this as an HTML5 game, it no longer works. Instead it puts a blank message (perhaps NULL) for the show_message() calls, and when it calls room_goto(global.lastroom) the player receives a black screen and nothing else works.

Does anyone have any ideas?
  • 0

#2 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 26 February 2012 - 10:06 PM

Room persistance has been broken for a while, I reported it here, still no fixed:
http://bugs.yoyogame...iew.php?id=3354

Although it sounds like your problem is different. the blank screen is typical for an unsupported function.

Btw, don't use room_set_persistents, there is a variable for setting it..room_persistent, or something. Just set room_persistent =true THEN go to the other room.

I'd guess that room_set_persistant is your joker(your not meant to use it on active rooms, I think, or at least it's not recommended! in the help manual!)

Edited by Desert Dog, 26 February 2012 - 10:09 PM.

  • 0

#3 Polatrite

Polatrite

    GMC Member

  • New Member
  • 28 posts

Posted 26 February 2012 - 10:19 PM

Room persistance has been broken for a while, I reported it here, still no fixed:
http://bugs.yoyogames.com/view.php?id=3354

Although it sounds like your problem is different. the blank screen is typical for an unsupported function.

Btw, don't use room_set_persistents, there is a variable for setting it..room_persistent, or something. Just set room_persistent =true THEN go to the other room.

I'd guess that room_set_persistant is your joker(your not meant to use it on active rooms, I think, or at least it's not recommended! in the help manual!)


I actually originally had all the code in the game as room_persistent = true/false, however that didn't work *at all* in HTML5. I thought I might be using it wrong, so I switched it to room_set_persistent() instead.

What would happen before is that I would hit "E" and literally nothing would happen. I just tried it again:

//room_set_persistent(room, true);
        room_persistent = true;

And the same thing happens, it causes the "E" key to not function at all in this case.
  • 0

#4 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 26 February 2012 - 11:09 PM

I haven't used room_persistent, or room_set_persistent functions, but I do know that the persistent functionality is currently defunct. (I just used the tick box in room editor)

Not sure if you could see my bug report or not, but basically it'd make objects persistent, so if you move to another room, you'd still have the objects from the previous room. Gah!

All I can suggest now is to compile a small example file, and submit it as a bug repot at bugs.yoyogames.com, explaining that room_persistent, room_set_persistent, etc, are broke.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users