*** Familiar strange problem with Construct

This forum is currently in read-only mode.
From the Asset Store
Casino? money? who knows? but the target is the same!
  • Hi guys.

    Today, I've come across a problem that I've experienced a couple of times with Construct in the past year, and I'm not sure there's an obvious solution.

    I have 27 global variables in main use (don't worry, I've used private variables where I've needed to, so I'm not just using global for everything), and simple conditions like global2=1 etc, work fine, and have done for months.

    In the last couple of days I've added a few more global variables (to take it to 27).

    Now it seems that any new conditions that I add to the main layout concerning the new variables (and some of the old ones) never seem to trigger.

    I hope I've explained that clearly enough.

    The strange thing is that if I add a condition involving some of the older variables, they trigger, even though they're in the same part of the layout.

    Then, once again putting the new variable in place of the old one means that it doesn't trigger.

    I've used the debugging to check that the variables are what I want them to be, and I've even used text boxes to display what they're holding, and although they should trigger, they just don't.

    I know the program is reaching the group in question (by use of a "close" command at the start to make sure).

    I said in the title that it's familiar because it's happened twice in the past, once of which was when I was writing the maze tutorial, and in both instances I had to delete the group and write it from scratch.

    I doubt anyone can help with this, as it seems a very strange one, but I was wondering whether any else had experienced something similar in Construct.

    I've spent a couple of hours on it today, and I think I'll have another go at it now, but my patience is wearing a bit thin.

    When run, the program is taking up about 20meg VM, which is more than fine, and 27 global variables is nothing, and I wouldn't expect Construct to baulk at such a low number.

    Krush.

  • Strange... Never had that happen.

    Would you be willing to show me the .cap?

  • Thanks for the offer, but as it's one of my main projects, I'd rather not have it out there at all.

    Appreciate the offer though.

    I still haven't solved it, but here's something that makes it even more bizarre.

    As I said earlier, I'm using a few text boxes to show the values of these global variables, so I decided to try and use them for the conditions (one of many things I've tried in order to find a solution), and they work!

    So in short, using if global('gb1')=1 won't trigger, but using if text1.text="1" will trigger, even though it's placed in exactly the same group, and the same position in the group.

    Very strange.

    I'll keep digging.

    Krush.

  • Wait, I think this has happened to me once. Are you sure the global type is set to number, and not text? The most obvious things are the easiest to overlook. If it was accidently set as text you'd have to do global('name')="1" for it to trigger.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Wait, I think this has happened to me once. Are you sure the global type is set to number, and not text? The most obvious things are the easiest to overlook. If it was accidently set as text you'd have to do global('name')="1" for it to trigger.

    I'd already checked that Yesterday (or was it the day before ) because that's happened to me in the past too.

    But I think I've just found it.

    The global variables I'm checking are the result of several other variables calculating the position and then the contents of an array.

    The Array is being loaded at the start of the game, and was created by saving an array in a small program I knocked up.

    It was a good way of getting a lot of numerical data input directly to the game.

    Now it looks like the array is actually a text array and that's why the condition wasn't being met when checking if global('gb1')=1, because I should have been using if global('gb1')="1".

    I thought that Construct automatically cast text to numbers and vice versa, when it needed to.

    For now, I can at least continue with the project.

    The important thing is that there seems to be a real reason for it happening, as opposed to it just being a random glitch.

    That means I can carry on with confidence that Construct won't let me down.

    Thanks for the interest in helping out.

    It kept me going, when otherwise I might have left it a week or so because I was so fed up with getting nowhere.

    Cheers,

    Krush.

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