Copy one Dictionary to another

  • Hey guys,

    Having a bit of trouble, I'm trying to find a way to copy all of the keys and values from one Dictionary object to another. I'm probably doing something wrong with the "Pick all" condition, I've never had to use it before now. I made a simple project showing what I'm trying to do, and a screenshot showing the main section. Can someone take a look and find the problem? <img src="smileys/smiley5.gif" border="0" align="middle" />

    dl.dropbox.com/u/19702035/dictionary.capx

    <img src="http://dl.dropbox.com/u/19702035/dictionary.png" border="0" />

  • Alright, I THINK I found the problem... It's another case of the infamous "object you create doesn't actually exist until the next top level event" thing. With some rearranging I've gotten that small demo to work properly. Now I just gotta get it working in my full project...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's easier to use 'load from JSON' if you're copying the whole dictionary. You can store the first dictionary in a variable (Dictionary.AsJSON) and then load it into the new one.

  • Yeah, I was looking at that, but the whole "intended for development only" threw me off. That sounds ominous. >_>

    Ooooohhhhh, alright. The AsJSON thing, I didn't look at that part.

    And now it works like a charm, in a ridiculously more simple way. I think I'll ask for better reading comprehension for my birthday this year. <img src="smileys/smiley24.gif" border="0" align="middle" /> Thanks a bunch, who knows how much more time I would've wasted on this!

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