Vous n'êtes pas identifié(e). Pour pouvoir écrire ou répondre à un message, vous devez vous connecter ou vous créer un compte sur JAWA.

#1 22-11-2018 21:07:49

spook1
Membre
Inscription : 12-02-2018

get object_ID? ✓

For a new memeory-gamer method, I would like to store the objectid of an object, after  an object is examined

Like:

variable:FIRSTCARD_ID:{{_object_1}}

variable:FIRSTCARD_ID:{{_1}}

This doesn not work. I get an error, mentioning the object ID but lacking a variable...
It almost works ;-)



When the second, matching card is found, I want to hide it together with FIRSTCARD

updateobject:{{FIRSTCARD_ID}}:visibilite:0

Dernière modification par spook1 (23-11-2018 10:33:44)

Hors ligne

#2 24-11-2018 14:23:20

jawa
Admin

Re : get object_ID? ✓

hi Martijn, you can use the system variable {{_dragged}} to achieve that.
basically, it returns the id of the last triggered object

#3 24-11-2018 18:09:49

spook1
Membre
Inscription : 12-02-2018

Re : get object_ID? ✓

When I try it, {{_dragged}} seems to retrun: -1, adding up each time.

Is this a bug?  _deplace give the same results..

partie 11744, scenario 1846

My code:(which does not work...)

first event ( first card clicked)

       variable:FIRSTCARD_ID:{{_deplace}}

second event: (second card of same set clicked)

       updateobject:{{FIRSTCARD_ID}}:visible:0    // first card is hidden
       updateobject:1:visible:0                               //second card is hidden as well

Hors ligne

#4 28-11-2018 10:00:37

jawa
Admin

Re : get object_ID? ✓

OK there's a bug on this, I need to figure why and where the _dragged system variable is uninitialized in that specific case.
I will let you know when I fix that

#5 29-11-2018 14:08:09

jawa
Admin

Re : get object_ID? ✓

This should be ok now. Can you try again ?

#6 29-11-2018 15:52:05

spook1
Membre
Inscription : 12-02-2018

Re : get object_ID? ✓

It works like a charm (see game 1846)
Thanks.

Hope to make video this weekend on memory and order game

Dernière modification par spook1 (29-11-2018 15:52:19)

Hors ligne

Pied de page des forums