YoHoho's Forum Posts

  • > I can see the Dictionary with every key when I reopen the .capx. So now I'm trying to understand how Construct 2 looks through a Dictionary and retrieves the key/value.

    >

    Do "Dictionary for each key" after it's loaded from local storage, and update your extras sprites.

    > Also, could I have saved the unlocks in the local storage? Would that have been a bigger hassle/mess because I can see how it could.

    >

    Sorry, I don't understand what you mean. Aren't you already saving unlocked extras in the dictionary and in local storage? What bigger hassle are you talking about?

    OK, I'm not sure exactly what to put after "Dictionary for each key". I made it so that the key/value system enters the "Name"instance variable/"UID". And I am able to unlock only the 1st key in my Dictionary and not the rest.

    I've tried "Start of Layout" and "Every Tick". Before I didn't realize I was working on the wrong even sheet. Now this is the step I'm stuck at. Hopefully this pic works to show you what I have.

  • Not .json file, I meant .AsJSON expression.

    OK, now I'm able to add to the Dictionary AND set everything in it to Local Storage AND load from JSON string.

    So how would I get my game to check if the extra that was unlocked? Each extra (with Persist behavior) has an instance name and that is what's entered into the Dictionary as a key, and the Dictionary is saved to .AsJSON with every unlock. I can see the Dictionary with every key when I reopen the .capx. So now I'm trying to understand how Construct 2 looks through a Dictionary and retrieves the key/value.

    Also, could I have saved the unlocks in the local storage? Would that have been a bigger hassle/mess because I can see how it could.

  • I think the Dictionary is better suited for this task.

    When an item is unlocked, add a new key to the dictionary. Save the dictionary to local storage the same way you save your arrays. (AsJSON)

    OK, I've tried using the Dictionary. I'm having no problem adding a key/value and that part works very well. What I can't do is get the .Json to load at the start of the game. I even tried to save the name of the .Json file into my local storage to retrieve it at the start but it's not working. One of the things I notice is that the Dictionary will download a .Json and add a () number because the file name is similar.

    Again, I haven't used arrays because they are confusing me for some reason. This will probably be the very last thing I have to add to my game in terms of working systems. If I can get an example .capx or even a video that explains how to retrieve .Json files/data then maybe I can get this working. Even now, I can see how Dictionaries could be used to store pretty much anything.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In my game, you can unlock pictures and clips using points you've earned as part of the Extras. Now I'm trying to figure out how to keep whatever has been unlocked saved into the game.

    I'm using local storage to save my game levels and such (arrays are still somewhat confusing me). Even though I can probably come up with an event sheet that updates every single extra item, I have no idea how to save that in the local storage. If arrays are the only way to go then so be it. Any help would be appreciated.

  • ...Oh boy.

  • ...

  • YoHoho

    Updated link.

    Thanks a lot. This thing works hilariously well. Even when you think you broke it, you can pull it back together. LOL.

  • Here's another example exploring what can be done:

    https://dl.dropboxusercontent.com/u/542 ... pring.capx

    I commented it a lot and in many ways it's cleaner than what I've done before. I'm figuring it out as I go and unfortunately it would be too lengthy of a tutorial for me to write. Math used is some simple physics such as:

    distance = speed* time

    speed = acceleration * time

    acceleration = force*mass

    spring_force = -spring_constant * displacement

    damping_force = -damping_constant * relative_velocity

    Also vectors are used. addition, subtraction and dot product.

    The dot product is used to get the speed in a certain direction.

    Some simple trig is used too.

    x = radius*cos(ang)

    y = radius*sin(angle)

    The collision detection uses the dot product to get the distance from a line. Otherwise everything is a mix of that.

    There are two unsolved things in this:

    1. The spring mesh can be made to fold in on itself.

    2. The balls can teleport through walls if either are going fast enough.

    Hey, is there a way that you can reupload this .capx file? I want to see what it's like and hope it can help with my project. Thanks.

  • Not sure if I'll get any replies; guess I'm looking more for inspiration than instructions. Does anyone have examples as to how they/someone created cut scenes for their game?

    I'm thinking of just going with a multi-part animated sprite with very little text for each animation. But I'm unsure of the composition. Any ideas/.capx files to look over would be appreciated.

  • Updated the original post with recent information, screenshots and initial download capx.

    Inception style link https://www.scirra.com/forum/viewtopic.php?f=180&t=197735

    Cheers!

    The plugins that are required that I can't find yet are 'Sprite Font+', 'MagiCam' and '3D Quad Deform FX'. I really want to try this out.

  • dropbox.com/s/0ru37dkgyhqvih9/watergunparticles.capx

    Here is an old example I had.

    More information might be useful. Is your project top down or side view? Are you already using physics?

    Depending on your art style and context you are using it in and how large the effect is, it may be better to use an animated sprite. Without knowing more about how you plan on using it, it is hard to be able to say which way is best.

    Funny, I already had that .capx file. However, I didn't even notice the idea of applying gravity to the water bullets to create the effect. It was still very helpful and I was able to make adjustments to pretty much get the effect that I wanted. Thanks again.

  • Anyone have an idea on going about creating a water canon/spray effect? Not sure if it's best to create an in-game action OR to just create an animated sprite. I'm sure there's a way of doing this with physics.

  • Enemy-> On destroyed
    (press B to add a sub-event)
          System -> Compare two values -> random(10) is less than 1   :   Enemy -> Spawn PowerUp[/code:w4zzx50r]
    

    Yup. That's what you meant. Thanks.

  • You can do something like this:

    On enemy destroyed
       random(10)<1   :   Enemy spawn PowerUp[/code:bu872ehy]
    
    Every time an enemy is destroyed, there will be a 10% chance to drop a power up.
    

    How exactly is this entered in an event sheet? Does it involve the random instance of an Enemy? I just tried to enter this into the 'Vertical Space Shooter' template and I don't understand.

  • OK, I give up on this array thing for creating a level unlock.

    I'm still unsure of how to even label the values to text so that I know what I'm looking at in the debugger. I'm just going to have to look up something more recent that is a general level unlock system with arrays. I did get to understand it a little better but it's still making me nuts. I didn't even know what you could change values in the debugger until now... like 2 years later!

    I was able to come up with a system that is working the way I want without arrays so I can continue with finishing my game. Thanks again.