Problem with a dictionary

0 favourites
  • 8 posts
  • Hi, I have a problem in my project, I don't understand why the lines are not running, can you please help me, see in my project to understand, where there is a comment.

    drive.google.com/open

  • The problem comes from line 14 or I say:

    -> System: Create the Dictionary object on layer 0 to (0, 0)

    I think the program cannot select the dictionary with IDU 3

    because the new dictionary has taken over.

    I think it's a bug, to be confirmed.

  • I think you are confusing IID and UID - they are different! Run the game in Debug Mode, find your dictionary object in the list and check them yourself.

    Also, it's a bad practice to use fixed values for UID in the code, (like in your condition Dictionary.UID=3), because when you change the project, add/remove objects, these values can change. It's recommended to use instance variables instead.

  • That's what I've already done, I don't think I'm confusing, look for yourself:

    e-nautia.com/david.dieppedalle/disk/aaa/fghbf.png

    Thank you for your advice, can you show me how to do it, please?

  • Dayvid86, a quick hack is to replace your "Dictionary - Pick instance with UID 3": change it to "System - Pick 'Dictionnaire' instance 0". That always picks the first Dictionary, which seems to work with your current events.

    But it may be better to add an instance variable to your Dictionary and use that to identify the different instances.

  • No, it's not working, please let me see.

  • You need to add "Pick all" into event 15. Because in the parent event you created a new dictionary instance, you can't pick any other instance in sub-events, unless you use "Pick all".

    Also, the IID in event 15 will now refer to the instance with UID=3. If you need IID of the newly created instance, save it to a local variable, or use (Dictionnaire.Count-1) instead.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you, it works, what would I do without your help ? :)

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