Shubi's Forum Posts

  • Thanks, That worked!

  • hi everyone,

    I am setting sprite image by "load image from url",

    Good thing is that it works fine bad thing is that the image stays with sprite even when i change layout.

    So My question is... How to clear a sprite image back to empty?

  • thanks this might work!

  • Hello,

    Is there a way to somehow get a Random "Key Name" from a dictionary?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for that crucial info,

    Just to be clear though, Lets say an image's actual size is 100kb... does that means when i am saving it to local storage through the code you gave... it is taking up local storage of 100*(80/30)kb ~ 260kb ?

    Edit: Or does it have to do anything with dimension of image?

  • Got it! Thanks.

  • It's unlikely to, but that of course depends on how much data each dictionary contained. 1000 items isn't very much though.

    Great! Thanks for clearing that up!

    Also can you please help me with another problem i am facing with dictionary and local storage...

    https://drive.google.com/file/d/1Bg8D-LAd1-kS0h_2xFzgYUorpdJuBV-Y/view?usp=sharing

    the problem is that if i

    1. take a canvas snapshot
    2. save it as a value for a key in a dictionary
    3. then use get image url action on a sprite with value dictionary.get("Key")

    it loads the image successfully into the sprite

    but if i do 1 and 2 then save the dictionary as a local storage key,

    1. then restart
    2. load dictionary from that local storage key,
    3. then get image url action on a sprite with value dictionary.get("Key"),

    it doesn't work.

    Can you tell why?

  • Thanks for replying, i tried it and yes it is possible but what about feasibility of this ... Lets say i save a 1000 Dictionary(s) data AsJson as Values for keys(1 to 1000) of a single dictionary... is it possible that it could crash the game?

  • Hi everyone,

    Would it be feasible to save a dictionary(with changing values) "AsJson" as values for keys of another dictionary.

    I am wanting to do this so that i would finally get a single dictionary to ultimately save & Load with Local Storage.

  • You could potentially store keys where the string is a number and run it through a loop : for from 0 to dictionary.keycount : log dictionary.get(""&loopindex) assuming keys are stored as "1", "2", "3" etc

    If you want to wait you could try calling a function with a number sent through as a param, you add 1 to this number each time you run the function. Inside the function you 'get' the dictionary item 'param' so dictionary.get(""&param). When you've done what you need to do with the key then you add 1 to the variable you are sending through the function and call it again.

    I got this working, Thanks a lot for your help

  • That might work for me as my key names are numbers from 0 to 10, although i wasn't able to understand the code you came up with.

    Can you explain the code and how would it put a gap between each key's actions in order...

  • just in their key number order, so that the actions for each key from 1 to 10 will happen one after the other and not all at the same time.

  • I want to achieve For Each Key (Ordered)

  • Hi everyone,

    Their is a system condition called "For each (ordered)" it helps to put a gap between actions

    Is their a way to achieve the same result with Dictionary's "For Each key" Condition in a way that for each key actions will take place just a moment after previous key....

  • Yeah, i checked it but it flips the layer no matter what effect is applied first.Thank you anyways.