citron2010's Forum Posts

  • Isn't this just a simple subtraction?

    Ultimate = 350 - bossHP

    Or if you want to normalize it so Ultimate ranges from 0 to 100

    Ultimate = 100 * (350 - bossHP) / 350

  • My guess is that there's a short amount of silence at the start of your sound, so it WAS playing, but you heard nothing because it kept restarting before the silence ended.

  • https://www.omnicalculator.com/math/centroid#what-is-the-formula-for-the-centroid

    (this website has a ton of math that you could try)

    I recently used: https://www.omnicalculator.com/physics/projectile-motion to help with my game and needed to solve one of the equations for a different variable but don't have sufficient maths skills. I wrote to them and got the solution back the next day with the full solution including the method handwritten, scanned and attached to their reply. Amazing site and people.

  • Not sure why it isn't working for you so decided to make a quick test:

    drive.google.com/file/d/1ml8vHFI01obDk5ljDXfP_QD1dJMEb6ah/view

    It appears to work fine. Note the "Trigger once" condition without which it would play the sound every tick whilst the mouse is over the sprite.

  • I had this problem so used a sprite font instead.

  • What I do is:

    Every time a variable (including Booleans) is changed, I call a "save" function.

    This function writes ALL the variables I want to save to local storage (not just the one that just changed) to a dictionary ("Add key" action)

    For example, if I have a Boolean named "mute":

    Key = "mute"

    Value = mute

    This stores either a 0 or 1 in the dictionary against a label of "mute" (I use the same names for labels in the dictionary as the variable I'm storing there).

    After I've saved all the variables to the dictionary, I then save the dictionary to local storage.

    So, my dictionary is called "saved", so on the LocalStorage object, I use the Set Item action with:

    Key = "saveData"

    Value = "saved.AsJSON"

    So now there's a single key in local storage named "saveData" with a value of the JSON of my dictionary that contains ALL the values.

    To load them:

    On start of layout - LocalStorage - Check item "saveData" exists

    Then:

    LocalStorage - on item "saveData" exists:

    On the "saved" dictionary object, use "JSON - Load" with:

    JSON = LocalStorage.ItemValue

    Now the whole dictionary has been loaded back from local storage

    Then I can read through the dictionary for all the values loaded back into it and set the corresponding variables. For the "mute" Boolean above, the event would be Compare Values on the "saved" dictionary object where:

    Key = "mute"

    Comparison = "= Equal to"

    Value = 0

    And the action would be to set the mute variable to "False"

    Then add an Else that sets that variable to "True"

    For an integer or string variable, I just set the variable to the value of the corresponding key in the dictionary.

    Hope that make sense!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Add the video recorder object to your project then see the actions section here for how to stop/start recording:

    construct.net/en/make-games/manuals/construct-3/plugin-reference/video-recorder

  • Which keys are you using? I had some similar problem when using left and right shift. Switched to using left ctrl & right arrow and it was fine.

  • I'm wondering whether the "drag and drop" behaviour might be easier to implement than swiping? If you don't mind the character being in intermediate positions whilst it's being dragged, you should be able to snap it into one of your three positions when the player releases. Or maybe make the draggable sprite invisible and have your character snap to it once it crosses a boundary between positions?

  • Trig functions in construct take degrees instead of radians. To fix your formulas just replace 2pi with 360

    Works perfectly - thank you.

  • Hi,

    I want to nerf my AI by adding small random values to some of its parameters but I want the random values to be normally distributed (not uniformly) so more of the time the parameter is close to its nominal value and values further from the nominal value have a lower probability.

    I'm therefore trying to implement the Box-Muller Transform:

    https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform

    And this is a sample project:

    https://drive.google.com/file/d/1VS9lSoW3fFDHSRw3vgaEauZ5tFR5db5T/view?usp=sharing

    This project generates two uniform random numbers which it then uses to generate two normally distributed random numbers using the Box-Muller transformation. It then displays the four numbers on screen then plots them (after multiplying by 100 then adding 100).

    But the second Box-Muller number appears to be too low.

    Anyone know why I'm not getting the kind of distribution shown mid-way down this page:

    https://blog.cupcakephysics.com/computational%20physics/2015/05/10/the-box-muller-algorithm.html

    Bonus question - anyone know any alternative approach? Is there anything in the new "advanced random" object I could use?

    EDIT - cleaned the project up a bit

  • Layouts: 3

    Event sheets: 4

    Total number of events: 450

    Total number of conditions: 487

    Total number of actions: 1223

    Total lines of JavaScript code: 0

    Object types: 166

    Families: 23

    Project was worked on in C2 for maybe six months years ago then restart in C3 six months ago, so 12 months in total. Project is very close to completion.

  • Layouts: 3

    Event sheets: 4

    Total number of events: 450

    Total number of conditions: 487

    Total number of actions: 1223

    Total lines of JavaScript code: 0

    Object types: 166

    Families: 23

    I feel like an amateur!!!

  • I’d been thinking of posting my project’s stats and asking everyone to share theirs. My projects relatively small compared to yours - I’d guess around 10%. Yours seems huge - I’d love to know how others compare.

    Has the saving time slowly increased as you’ve worked on the project or has it recently jumped up?