Global events / objects?

This forum is currently in read-only mode.
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • Can I use global events or objects? Could be useful for making more levels to my game.

    And by the way if I create new event sheet it's events do nothing?

    EDIT: Oh, I have to include it first

  • [quote:3n57s3xh]Can I use global events or objects? Could be useful for making more levels to my game

    Both can be useful for your game. Reuse a sprite in different layouts by setting it to global and use global variables to store your score or lifecount for example.

    And when you're adding event sheets, you have to include them in an event sheet which is linked to the layout (right click in the event sheet editor, select include event sheet).

    Hope that helped.

  • Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Wait. How do I add the same object to the next layout?

    EDIT: Copy&paste worked.

  • You don't need to set an object global to use it in another layout. I've seen it recommended against doing so for visible objects, somewhere around here, and it's good advice I think.

    Global makes the instances of the object exist in all layouts - whether they have been placed in Construct or spawned.

    Such as when I accidentally had some arrows set global, when I changed layouts I'd still see them placed at the same X/Y positions, which is definitely not what I intended.

    Copying and pasting non-global objects to other layouts works fine, though. The same event sheets will work on those, as pasting to another layout doesn't make a brand-new.. um.. clone. They'll have the same object ID (if I'm not all mistaken about how this works).

  • Global for objects simply means it carries over to the next layout. Probably the best use for it for music, so that the song that's playing in one layout will continue, at the same point in the next.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)