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 25-11-2018 13:13:13

spook1
Membre
Inscription : 12-02-2018

get object interacting with ✓

In a sorting game I would like to get the id of an object htat is being interacted with.

I have card that moves to a target.

I would like to do something like:



updateobject:1:x:{{_x_combined_with}}:1

To move the card exaclty over the target.

I would also like to be able to compare custom variables, like:

custom_1_1 = {{_custom1_combined_with}}

Does anyone know the syntaxes for this?

Dernière modification par spook1 (25-11-2018 13:13:27)

Hors ligne

#2 28-11-2018 09:43:35

jawa
Admin

Re : get object interacting with ✓

Hi Martijn,

An elegant solution you cpould try put a positionning "step" on your movable cards object, meaning your objects will auto align on an invisible grid, so if your cards are placed on that grid to this will achieve the effects. The only problem is that the same step applies to x and y coordinates, so the virtual positionning grid is based on square cells.

If not convenient, an "ugly" workaround  solution you can use now is to store in some variable the combined object coordinates, on each combine interaction.

for instance :
in the "A combined to B interaction" effects you store
variable:x_target:{{_x_<id of B>}}
variable:y_target:{{_y_<id of B>}}

and in your positionning script :

update:1:x:{{x_target}}
update:1:y:{{y_target}}

This impllies that you create a combine interaction to set the coordinates on each target object..


but in the next version, you'll be able to use the generic id_number  "2" in object variables to point to the combined object
So the syntax will be  :

updateobject:1:x:{{_x_2}}:1

And you will no longer need to duplicate interactions.

(Currently,  I'm working on group interactions and a lot of things like that will be much easier)

Z

#3 28-11-2018 10:56:02

spook1
Membre
Inscription : 12-02-2018

Re : get object interacting with &check;

Thanks, i will wait with tutorials untill the new version is life

Hors ligne

#4 29-11-2018 09:45:38

jawa
Admin

Re : get object interacting with &check;

its very "beta test" but you can try that now.

#5 29-11-2018 16:02:31

spook1
Membre
Inscription : 12-02-2018

Re : get object interacting with &check;

It works a little bit. There seems to be a bug...

When I set interaction with object 2 =any-object,

and I script:

variable:other_ID:{{_custom_1_2}}

to set my variable "other_ID" to get the value of custom1 of object 2


I get an error:
variable _custom_1_26052 n'existe pas. Utilisez le vérificateur de jeu pour corriger cette erreur


See game 1846, the script is in test_element.
When test element interacts with any other obejct the error pops up.

Hors ligne

#6 29-11-2018 17:42:53

jawa
Admin

Re : get object interacting with &check;

warning, the correct syntax for custom variables is :
{{_custom1_xxx}} (without the "_" betwwen custom and the number)

#7 06-12-2018 10:59:26

spook1
Membre
Inscription : 12-02-2018

Re : get object interacting with &check;

ahh, of course. excuse me..

Hors ligne

Pied de page des forums