0 Favourites

Compare Instance Variable

  • Did "Compare Instance Variable" really work like an array if more than one have the same value?

    And if I pick one, the follow foreach will only have this in?

  • I always use several compares to limit the amount of object I need for eaching through, or use an extensive pick all / pick by evaluate, then for each the results.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Y, I somtimes had problems with it. Can it be they need to be sub? Or also in AND.

    And so its impossible to make:

    On Mouse click on Object

    Foreach Object

    Will only pick the first, true?

  • If you clicked the object, it should already be selected, so you would not have to loop through all the objects.

  • No you dont understand me.

    Its only an example.

    Its for situation all other must be deselected before select the clicked one.

    For this i source out with a function.

    I only want know if I am right. Any coding result I find myself.

    I try to understand this completly...

    So its really like an array, every sub Compare Instance Variable make it smaller, until I have my target.

    Like Object[outergroup][innergroup][id]

  • No you dont understand me.

    Its only an example.

    Its for situation all other must be deselected before select the clicked one.

    For this i source out with a function.

    I only want know if I am right. Any coding result I find myself.

    I try to understand this completly...

    Ahh, yes, I have had similair situations.

    local var TMPUID = 0

    Event on touched X

    action set TMPUID x.UID

    --subevent pick all X

    --action set boolean selected false

    --subevent pick X by unique UID where UID = TMPUID

    --action set boolean selected true

  • You don't need the second pick. As soon as you pop up from the first sub-event, the SOL is back to where it was, so just a blank sub-event is sufficient, then do your "touch" actions.

  • Hmmm.

    My english is not very well, you confuse me.

    Again with a picture:

    So there are some diferent situations(AND/SUB), what work what not?

  • You don't need the second pick. As soon as you pop up from the first sub-event, the SOL is back to where it was, so just a blank sub-event is sufficient, then do your "touch" actions.

    Ohhw, I did not know this

    I just never took the risc hahaha, thnx

    @deathangel1479, it seems I have no clue what your asking really

    From your events above, what is not working ?

  • it works fine, for moment but I can not be sure that sometimes if I have other groups, something is breaking out, if I not understand absolut completly how they work. That's my problem.

    I need help from a real insider.

  • You should be able to split event 93 with a couple sub events determining which group is clicked.

    And in the other events simply add the extra subevent (other group names) determining the effects/variables for the other groups.

    Looks solid enough

  • I think so. (93)

    I changed it to make clear what i mean.

    I think I will make a big test project, to test out any kind of this.

    What works and what dont.

    May be someone else write something here.

    My brain explodes but its my guilt.

    I dont use globals because I have an aversion , containers and families because to static and because I make all with only a few objects.

    Instance variables are object prefences, that is what programmers use...

    In construct this is a little bit harder, to do!

    For me its not enough that it somehow works, I need to understand!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
[Plugin] instance bank2
85 18,367
rexrainbow's avatar
rexrainbow
Unread hot topic
64 12,940
trollface's avatar
trollface
Unread hot topic
0 Favourites
[PLUGIN] Instance Group
50 17,108
sagispin's avatar
sagispin