Events and giant boolean structures

0 favourites
  • 3 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • Hey, I have a sort of silly question:

    Is it okay to have seeming needless booleans in the events that stay true most of the time, and only change once in a while?

    Basically things like - IF daytime then do lots of stuff, else if night then do this other stuff. Is there a better way to do that? Can I just have a text variable with a function name that is called (either day or night). would that help improve event structure?

    I am asking because I am writing one event sheet and trying to encompass multiple possibilities. Some of my levels are "dark" and so apply lighting differently than normal levels. But I still have to ask wether the level is dark every tick so I can have stuff happen if it is... Does this make sense?

    I had heard one event sheet was best. I think it would be better to split the event sheet up into part and have an event sheet that includes event sheet x,y,z... so on for each level. Though that could get out of hand really quickly

  • whether you use one event sheet or more, Global variables effect all layouts no matter what event sheet they are in. If I understand you correctly, create separate variables for different layouts and no it is not every tick.

    Just so you know;

    Using one event sheet, you could divide code into groups and disable and enable those groups based on the layout.

    You also don't have to use a separate event sheet for each layout but, rather use separate event sheets to govern different events.

    I still like to use one event sheet for each layout and put everything into a Master Group on each event sheet and disable those groups on the start of layout of the current layout and enable the Master Group of the current layout.

    You just have to keep the On Start of layout out of the Master Groups of each sheet.

    Hope you can follow that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ya thanks, that all makes sense. I already have an initialize group that runs at the start of the layout, I'll try to organize via that and turn certain groups on or off depending on the level. Thanks

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