retain objects for included event sheets.

0 favourites
  • 8 posts
From the Asset Store
Bring the Wild West to life with this Cowgirl Sprite Sheet!.
  • Hi guys. I have a few sprites representing different animation and states of my character and wish to somehow automatically add them as objects to a new layout. I already have the player movement logic included in a seperate events sheet. How can I do this for sprite objects I have created for my character too?

    Thanks :).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If I remember correctly Construct 2 has this feature from Construct Classic: You could put them on the first layout and set them to "global" objects, then they will automatically appear on every layout afterward unless you destroy them.

    Or you can create them from an event sheet included at the start of your layouts

  • This doesnt work for construct 2. Any ideas?

    The documentation says:

    Global

    By default, all instances are destroyed when the layout ends (e.g. when going to the next layout). If Global is Yes, none of the instances of this object type will be destroyed when switching layouts.

  • By default, all instances have Global set to Off - that is why they are destroyed between layouts as described in the manual. If you select Global to Yes in the Properties bar then you will achieve the effect you are looking for.

    I personally prefer to store all object properties in an array or variables as I find it easier to manage - because I then know exactly what characteristics are passed to the sprite each time the layout starts (enables a re-start or re-try option, for example).

  • THis is my problem though... The items are all set as Global to Yes in Object type properties in the Properties bar. So what have I not done?

  • Mmmmm - I must confess that I've had limited success with Global and have 'progressed' to creating the common game elements at the start of each layout. Are you able to share a capx so we can take a look? I'm sure that someone will be able to figure out why it's not working for you.

  • I am not sure how you have your event sheets set up. Have you tried creating a System event - On start of layout and then a system action Create Object?

  • Are you sure that in the second layout you are including the correct events ?

    Post your capx if you want us to be more precise in our helping.

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