farflamex's Recent Forum Activity

  • That's the problem really, workflow is not linear when it comes to creating new objects. You need to back up to a new top-level event before it registers. It's a real pain and constantly causing me problems. My solution here is messy and it doesn't even work.

    With a GV, does it IMMEDIATELY alter? Will the new value be in place regardless of the indentation of the next check etc? Is it something to do with minus numbers? I'm clutching at straws here but this just makes no sense. I'll try to strip some code out and post a screenshot.

  • There must be something I don't understand about how GV's behave in C2 because mine isn't behaving as I'd expect.

    I have my global variable, and I set it to -1 every loop. If an object is created, I set the GV to the object's UID, so that I can then retrieve the UID later on and work with the new object (I'm doing this because of the issue where a newly created object doesn't become accessible until a new top-level event... it's necessary in my case).

    So I then do a test, which is basically saying, if my GV is NOT -1, a new object was created, so I can work with it. But for some reason, when I set the GV and then test it, it doesn't respond.

    So like this.

    Every tick - GV = -1

    Event - Create object and set GV to the new UID.

    Next top-level event - If GV <> -1, do stuff.

    It doesn't work. When a GV is altered, is it altered immediately or do I need to wait for new events or something?

  • Yeah I guess that would work. It's already in a family but I suppose you could do another family just for this purpose? Cheers, hadn't thought of that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, basically, what we WANT is something like the VB debugger, where you can step through, line by line and check which line it's on and the values of variables. But then again, that's the best debugger I've worked with and I understand that it'd be difficult, if not impossible, to implement.

    In general I find C2 to be very good to use and it massively increases productivity. Unfortunately on bugs, I'm finding they're far harder to find than a normal programming language. It's sometimes next to impossible to work out which events are even being processed. Even a basic debugger would be nice.

  • That was just an example really, my own code is a bit more complex. This all needs to happen internally, not something that can be worked around on the screen. I basically need to know how I can test an object against all of the other objects of the same type, since once you've picked an object, how can you then pick all the others and compare them against the first?

  • A simplified version of what I'm trying to achieve.

    I have a 7x7x7 grid and I need to make sure that only one of a certain object can occupy a grid location.

    So I pick my object, decide where I want to put it, then I need to check all of the other objects to make sure they're not in that same location. Since I've already picked one object, I'm not sure how to repick them all without losing my first pick - and since I've already picked one object, I can't pick the whole lot now anyway.

    So my attempt to solve this was to create a 7x7x7 array, do a loop where each object puts a '1' in the place it's occupying, then when I place the new object, compare against the array. If there's a 1 there, it's occupied.

    For some reason that I can't fathom that doesn't work.

    I may be overcomplicating this, any ideas?

  • I'm in desperate need of a debugger in C2. I'm spending hours and hours staring at lines of code and realising that I don't understand how C2 is interpreting them, since they 'should' work. I need a line-by-line stepper to see what's going on since this is now taking up most of my time. I'm resorting to sounds (a beep next to the actions so I can hear if they're even being reached) and text object to output numbers, but I'm still having real difficulties. But I guess if it's not feasible in C2... well it's making me think I need to find a different language, which is a shame because C2 is amazing in every other respect.

  • Yeah, that'd do the trick, better than my plan to have a local variable just count down. C2 could use a 'step' counter though in my opinion.

    Thanks :)

  • Is it possible to loop backwards in a For Loop? i.e Step -1 from other languages? I can't see anything in the manual.

  • nm, solved this one. I need to do a 'For Each' in between those two events, so it tests each layer of the picked tiles. Works now.

  • I have several tiles, all in the same family and many in the same screen position, but on several different layers. When the mouse is clicked on one of the tiles, I want to pick only the tile on the layer that's showing. I'm trying....

    Mouse clicked on TileFamily

    TileFamily.LayerName is Visible

    That's not picking anything. Any ideas?

  • Thanks Arima. I did read your tutorial through several times to no avail. I also understand the efficiency of putting the conditions first to cut down the size of the loop.

    After 6 hours, I've worked out what's happening. There are two tiles at that location (an oversight elsewhere so some tiles had the same location), so it's actually picking different tiles. Sigh. At least it's fixed now, and it wasn't a C2 problem or my understanding of the logic.... as with all bugs, it's obvious now that there were 2 tiles there :(

farflamex's avatar

farflamex

Member since 7 Oct, 2012

Twitter
farflamex has 15 followers

Trophy Case

  • 12-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x2
    Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies