Beginners Quesion: Problem with Layouts

0 favourites
  • 10 posts
From the Asset Store
Latency independent responsive controls. Beginner friendly documented.
  • Hello, im new to this program and are very soon done with my first game.

    I was using only one layout and then when i were going to complete the game, i added my second Layout with a Eventsheet.

    I asume the evensheet follow the layout and only aplies to that one?

    Hence, Layout2 follows the instructions on event sheet 2?

    To the problem, i must missunderstand something about layouts, because i use layout 2 for the menu and then when i click start, it changes to layout 1 for the game. Problem is that it dosent count variables as it should be. Ive set for some variables to count and give limits to how many objects that there may be, but those dosent work.

    Anyone that can help and explain what im doing wrong?

    Ill try this way, before uploading the game.

    (i use no scripts, only the eventsheets) <- and like to keep it that way.

  • If you could post your capx, it would be easier to spot on what went wrong.

    From the sound of it, I'd say select your layouts in the "Projects" tab and make sure that their "Event sheet" property links to the intended events sheet.

    This might be a first thing.

    Another thing is the order of the layouts.

    If you have some variables and code for these variable set in event sheet 2/layout 2/Menu in you case and that you start directly the program on layout game, the whole code about the variables won't act indeed, since the layout they are in never got initialised.

    Make sure that the correct layout is selected as "First layout" property of the project itself.

  • I still cant get it to work.

    Here is the game.

    GAME

  • Your code is pretty messy, it's hard to get into it.

    You're setting no variable in the menu layout, so there's nothing there, the variables are setted in Game sheet anyway.

    So the problem must be elsewhere.

    Anyway, what is the problem exactly ? What do you expect your code as it is to do ? What is it doing instead ?

  • Your code is pretty messy, it's hard to get into it ...

    Yes, how about adding some comments in your event sheet, maldrok?

  • There we go, ive added lots of comments and groups and also translated all the names from swedish ones to english ;D + simplified some code, that i made too advanced, when i began coding.

    Here is the new one

    rapidshare.com/files/1446093042/NewGame.rar

    To the problem:

    When i click on the PILE1 to spawn a BOARD1, then it should count +1 on a variable. When that variable is 2, then it shouldnt be able to spawn more.

    This works when i start the game from the GAME LAYOUT.

    But when i start from the TITLE LAYOUT, then it dosent, they just keep spawning when i click on the PILE1

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I can't seem to be able to download your file.

    Rapidshare is acting strange, and really badly wears its name anyway.

    You should consider hosting your files on dropbox if possible, it really facilitate files exchanges.

    For now some quick fixed capx of your project.

    I reorganised a bit of events but it still is messy.

    Pile1 and Pile2 NrOfPlanks starts at -1 when running from the menu.

    I'm not sure exactly why, the solution for this is to set those values to 1 in the startup of layout.

  • you do not need this NOTEXIST boolean

    if you want to know if there's a board in the scene, just count them

    plywood.capx

    here you go, you just have to understand what I did for the small boards and apply that to the big ones.

    Also Kyat is right, having dropbox makes you sexy and smell good... A dropbox account and you will be surrounded by women in no time!

  • Thanks for the DropBox tip, i allready got a woman, but sure as hell could use more.

    dl.dropbox.com/u/51673505/NewGame.rar <- should be my new gamefile.

  • There we go, i made some major changes in the code, using what you suggested Yann, thanks. So now there is fewer Boolean Variables and more Global Variables or just checks for how many of an object that is out.

    I also added test-text that display the variables counting and you were right Kyatric. They start at -1, but even if i do "At start of Layout" and set them to 0, they still remain at -1 when running from the menu.

    dl.dropbox.com/u/51673505/NewGame.rar

    EDIT: I just got it to work, by putting a Wait:0.1 seconds int the middle of the

    "Start of layout". Maybe it was to much sh*t running in that code.

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