Dictionary returning "infinity"

Not favoritedFavorited Favorited 0 favourites
  • 2 posts
From the Asset Store
Game "Little Dino Adventure Returns" with complete Source-Code (Construct3 / .c3p) + HTML5 Exported.
  • Hi,

    Why do Dictionary key/value pairs return "Infinity" on the first loop after being created, despite being created with a value?

    For example, if you create a key called "Foo" with the value 5, and you then do a "Trigger once" that outputs the value of Dictionary.Get( "Foo" ), it returns "Infinity" instead of 5.

    However, if you change "Trigger once" into "Every tick", it's then able to return "5" due to the subsequent loops correcting the loading.

    Is there something about how Dictionary objects load values that works differently from how normal variables work in Construct?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can you post a screenshot of your events?

    "Trigger once" without any conditions will run on the first tick. If the dictionary or the key does not exist yet, it won't work. You can try adding "Dictionary key 'foo' exists" as the first condition.

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