Create an object by taking the string "object.x" from the dictionary

0 favourites
  • 5 posts
From the Asset Store
This collection of music is the beautiful performance of rather small strings ensemble (8 first violins, 6 second violin
  • Why can't I return a string object.x from a dictionary into the event?

    It doesn't give me the x coordinates of the object and the object is created at x=0.

    I'll post a screenshots so I can explain better.

    It could be done?

  • Hey brendanpoke it looks like in your first event you're missing the letter "s" where it says astronave.x. This could be what's throwing you off. If not let me know I'll take another look. Hope this helps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, I made a mistake, but i fixed it and it still doesn't work.

    But I know because I've tried it before...

    Also just using "Text" to find the x coordinate of the object but nothing.

    I could fix it by creating an extra function that identifies the object if it's inside a family, but I'd like to know why it doesn't work like this.

  • It doesn’t work because everything within quotes is just text and not an expression. So what’s happening is basically int(“object.x”), and when text is converted to a number it becomes 0 if no digits were found.

    Maybe you meant to build the text you saved to the dictionary.

    “Smoke=“&object.x&”,”&object.y

  • It doesn’t work because everything within quotes is just text and not an expression. So what’s happening is basically int(“object.x”), and when text is converted to a number it becomes 0 if no digits were found.

    Maybe you meant to build the text you saved to the dictionary.

    “Smoke=“&object.x&”,”&object.y

    Thanks so much!

    Now I understand better how it works :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)