Boolean global and local variables?

0 favourites
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.
  • When creating new global or local variable there is no an option to create a variable of Boolean type!

    I wonder why because now for checking true/false state I must use variables of Number type?

  • What C2 version you have, it's there. For locals only, but I'm not sure you could ever choose boolean for globals.

    edit> Ah, I mixed up locals with instance variables

  • I have r68 version.

    There is no Boolean type option for both global and local variables.

    But interesting, you can choose Boolean for an instance variable of an object!

  • I would say this is in the wrong section. This section is for reporting actual bugs in the program, not missing features.

  • zenox98 is right, moved to Construct 2 general.

    It's an oversight from when I made event variables - you can use an integer (0 or 1) for now which is an easy workaround though. Adding this is on the todo list.

  • I was going to post about this topic as well. I think that global booleans would be a good idea. Using an int can be problematic.

  • Also I should point out that you will probably need to have the global boolean down the road. Eventually you will need to have it in order to make more complex games.

  • Yes, I'm using 0 and 1 for now, but Boolean would be better for checking true/false state as mammoth said. Anyway thanks for fixing this in the next version!

    Next time I will post these things in Construct 2 General.

  • While we are on the topic of booleans can we have a compare boolean like the compare variable.

    For example

    If Boolean is true then....

    If Boolean is false then....

    I think this would be usefull

  • I'd like to remind you about the boolean variables. Please, with r119 they are still not there... and would be sooo nice to have them.

  • Still on the todo list.

  • Thanks Ashley! I also noticed that! However, using Number variables with 1 and 0 worked just fine.

    Thank you for improving Construct 2 everyday!

  • +1 to jegcelorio

  • Numbers work just as well. The only issue is that sometimes you might accidentally set the wrong variable. Also if you have been using booleans for years it is a little weird. It's a low priority anyway but it would be nice to have :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • mammoth: Instead of setting numbers, try setting up two new global variables: "True" with a value of 1 and "False" with a value of 0. You can then just reference True and False through your code.

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