Can I Keep Settings Throughtout Every Layout?

0 favourites
  • 10 posts
From the Asset Store
Creepy Sprite Font suitable font for your Dark/Horror/Halloween games.
  • Whatsup everyone,

    Im here again with a few questions regarding layers/layouts.

    I had some help from GeometriX yesterday and i really thought i had most of this down but i am afraid i am still in need of some info.

    I know that i can set Objects to Global to keep them from being destroyed while switching layouts,Is it possible to keep things in the current STATE while switching layouts aswell? What i mean is i have A Day and Night system that i would like to carry over to the next layout,For example i have a Forest biome,if its night time in my forest biome and i want to go to my jungle biome how could i make it where it stays night time while switching layouts?

    -Second Question-

    Whats the best way to transfer my player from layout to layout?

    I have tried doing the global thing on him from properties and it doesnt work,Im not sure if that works with the player object just the same as everything else since i do have a player mask that he is bound to.

    -Third Question-

    If i would rather buld every layout from scratch instead of making it an instance would it cause lag becuase i hand built the terrain?My room right now is 3200x3200 and i was aiming for something bigger since i am creating a sandbox game,I dont know much about arrays because i havnt found the right tutorial/Learning Process for me.Thanks everyone

  • I'm perhaps not the best person to answer your questions in-depth, but in regards to question 2;

    One way would be to keep all your player stats as instance variables for your player, but also store each variable as a global variable in an event sheet (global variables are accessible across all event sheets). Just before you move to the next layout, set all of your global player stats to your player's current instance variables.

    Then, on the start of the new layout, you spawn your player object, then set your player's instance variables to the values you saved in the global variables after exiting the previous layout.

  • 1) Use global variables, a variable "Day" that you set to 1 if it's day and 0 if it's night. You can have a whole bunch of variables, put them on a different event sheet if you want.

    2) If the object it global it will keep it's instance variable values and appear at the position it had in the previous layout, make sure you specify in every layout where the player is supposed to spawn.

    3) I recommend you read the blog articles and tutorials by Ashley on optimisation and performance.

  • Nimtrix Nullus

    Thank you guys,I got alot out of what both of you said,I wont take anything from GeometriX aswell,He also gave me great information about the subject.Thanks again guys you have helped me alot.

  • Nimtrix Nullus RookieDev   I cant seem to get my player to go from layout to layout. I have a Mask and a player sprite like rookie does what do i have to do? Do i need to add another event besides making it global? And does the behavior follow the object when switching layouts if its global?,

    I have global on both my player and mask

    I added an event to make them both spawn on the start of the layout

    I am going bald with every second :p pulling out hair. Lol thanks guys if anyone can help me please

  • TheNewGuy Im not sure,Im actually still testing around with things myself.I have been asking around the forums quite a bit here as of late.But to anwser your question,Im having issues with my player and mask.I was starting to think i was the only ONE.sorry i couldnt help man maybe GeometriX or someone else can though.

  • Awwww man I really want to have my player switch between layouts but when i switch it shows my player in the sky but my mask falls to the ground. I have them on Global and they wont stay pinned together when switching.

  • Awwww man I really want to have my player switch between layouts but when i switch it shows my player in the sky but my mask falls to the ground. I have them on Global and they wont stay pinned together when switching.

    Behaviours should remain if the player object is global. Events, though, are Event Sheet dependent. If you're handling player events in one layout, then moving to another layout without those events, then they won't apply.

    Remember that "Pin to object" is a behaviour, so if your new layout doesn't have that behaviour, you'll lose the pin.

    It may be a good idea to have all of your main player events on a single event sheet, then "include" that event sheet in the event sheet for every level. That way you don't have to re-write your player events, and can use them on every layout.

    Or you could just copy the Pin event across each event sheet that you need the Pin behaviour for.

  • Nullus The INCLUDE FIXED IT!! I had include in the wrong place! Thank you thank you thank you Nullus!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Nullus The INCLUDE FIXED IT!! I had include in the wrong place! Thank you thank you thank you Nullus!

    Don't mention it. Sometimes you just need a fresh perspective to make you spot the problem. I don't know how many times I've completely overlooked something simple that I didn't even consider could be the problem.

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