codah's Recent Forum Activity

  • Could also use a Boolean and just toggle it

  • Any clever stuff involving arrays I could be using instead?

    Just the standard way.

    FactArray (array):

    x =0 : "fact 1"

    x =1 : "fact 2"

    x =2 : "fact 3"

    x =3 : "fact 4"

    etc

    RandomFact (spriteFont):

    RandomFact: set text to FactArray.at( random( FactArray.width))

  • Follow it through in your head. When G is pressed, and NumberTest is 0, it will be set to 1. On the very next line it says, if NumberTest is 1 (which it is because you just set it) then set it to 0. So almost immediately you've set it to 1, then back to 0 again. You probably want to have 2 'On G pressed' events, one for each of those lines.

    A nicer way would be to do

    On G pressed

    Sprite | Set NumberTest to 1 - Sprite.NumberTest

    edit: otherwise else as suggested above. Lots of choices

  • Ah ha I thought it would trigger the filter to auto reset when you called the pick by Instance uid.

    It will reset on the next non sub-event.

    edit: are you sure your above works... if it does it would be just luck I think. As you've lost the Sprite2 that was overlapped with.

    RE: Variable

    Just think its odd to move a variable to another. When you can just use the variable that is already create and holding the value you need

    Kinda like

    a=cat

    b=a

    print b

    when you could of just said print a

    I'm not sure what you're referring to, there's only one variable above. In my case using a Local just reduces its scope, which is normally a good thing. Anyway I'm out this is enough for Ashley to sort through.

  • I guess it comes down to understanding the picking, and that it's like a filtering process. So after the 'is overlapping' there is 1 Sprite2 picked from which to further filter. So you need to pick them all again to reset the filtering. I feel I should know this, but it seems that pick by UID only picks from the current SOL, rather from the entire pool of objects (I don't pick by UID very often). I just did a test that shows this. (i.e. you CAN pick by UID right after another pick event, as long as the picked objects contain the one you want to pick by UID). I'll be interested to see what Ashley says.

    But I agree the manual is a bit scant in some areas...

    Re global variables, I'm not sure why people are so reticent to create variables... But I agree reduce globals wherever possible, which is why I created a local.

  • This works ok. Don't forget the Pick All

    [attachment=0:360k9dvo][/attachment:360k9dvo]

  • oh ok missed the 8 direction behaviour. Understood about Families, I just saw your av had a licence medal thing.

    Edit: I still don't think it will work without Families. You're trying to have two SOLs in one condition as far as I can see. You could introduce a variable to store UID but then I understand you're trying to find if this is a bug.

  • If you needed something more complex you could devise something, but for simple cases AFAIK you'd just loop and copy values.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Unique values or not, you can't exactly move a row anywhere, you will just have to copy the values across from one array to another.

  • Thank you, codah! You're the best.

    lol no problem

  • Sorry to butt in but I think you have some errors here. Firstly no light blue sprite is initially overlapping a dark blue, so nothing will ever happen.

    Try this. I moved the light blue over a dark blue in the layout, and also added a Family to do the picking, and set the light blue to top of layer.

  • A "system | wait 0 seconds" after the call to GenerateCards fixes it. The objects you created aren't available until the next tick (except to subevents).

codah's avatar

codah

Member since 30 May, 2014

Twitter
codah has 1 followers

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies