artheads's Forum Posts

  • You do not have permission to view this post

  • You do not have permission to view this post

  • Yes, that sounds promising. Have you researched this aspect of flowcharts already?

  • 500^(increaseRate*loopindex)

    Well, this increases numbers crazyfast. I ended up with round(500 * 3 * loopindex)

    Thank you usbtypec!

  • Hi all!

    How to fill an array with numbers that increases exponentially from a fixed number (e.g. 500) to any bigger number (e.g. 1000000000) with possibility to adjust the settings (I mean step or rate)?

  • I built a simple concept...

    Thank you, bro! A very interesting example and that's what I'm trying to achieve. You're awesome! :)

  • I'm trying to create a simple in-game constructor that will allow players to build a certain object from parts. Some parts can only sit at the bottom and some parts can be only at the top of the constructed object. And all other parts can be in any place except bottom and top.

    The player may want to build an object using random parts quantity, but minimum 2 parts is required for the object to functioning (the bottom one and any other part) and a maximum of 5 parts can be used. Then the data will be saved to array to build actual object during gameplay.

    The first thing that came to my mind is to place an invisible sprite with several image points as "slots" for the parts. It works, and I've attached a project file below. But there are some problems I can't figure out how to solve.

    Main Problem #1:

    If the player takes a bottom part and a top part, they goes to the bottom image point and the top image point, and there is a gap between them because bottom/top parts can sit only at the bottom or at the top. So these parts doesn't connect with each other because of "image points" approach.

    Main Problem #2:

    If I abandon this "image points" approach since it doesn't work as I want it, so, how to "sort" parts? I mean how to place them depending of it's type (bottom / top / others). For example if I place a non-bottom or non-top part first, then place a bottom part - the bottom part must go below any other part. And same for the top part. Any other parts can go in any order between bottom and top parts.

    Little Problem #3

    When a part has been placed I still can replace it with another part of same type (e.g. just changing its animation frame), and I need to recalculate the cost of the each parts used and a total cost of the whole construction. Is there a way to do this without using a bunch of variables?

    There is a C3P file of what I did (dropbox).

    Any help or advice would be greatly appreciated!

    Denis.

  • It has the FormatNumberAsDecimal expression which formats the passed in number with the correct punctuation for a locale of your choice.

    Wow! Will try it for sure, thank you!

  • Hi folks! I have a variable 'MyVariable' that increases by a random number every 1 second. I wish to display it with comma separator (e.g. 750,000,000) and I do:

    Set Text > RegexReplace(str(MyVariable), "\B(?=(\d{3})+(?!\d))", "g", ",")

    However, I also wish to update this text every tick, so it will "count very fast" 1 by 1, despite the fact that I can add to MyVariable larger numbers than 1. How to achieve this saving my text formatting (comma separator)?

  • Thanks bro! Actually it lay right on the surface :)

  • Hi all! There is a variable in which the number 10 is added once every 1 second. This variable is rendered using a sprite font. How to make the text displayed not by adding 10 at once, but by 1, such as "counter"? That is, I added 10 to the variable, but the text "counts" from 0 to 10, then from 10 to 20 and so on.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I realised I had to make a 'Stylesheet' file

    Why not add the code to the game's existing style.css file?

  • For example, you have a dictionary...

    Thanks for a good explanation, but this works with keys. But I need to get entire Dictionary.AsJSON in my script. Is it even possible without using extra variable?

  • Try something like this

    Thank you, but what if I need to get only one special Dictionary object, while there are several in my game? And what is 'foo'?

  • I'm trying to set a variable in my script (scripts in Events) with Dictionary.AsJSON,

    I did this but it doesn't seem to return the correct data (JSON with keys/values):

    var gameData = runtime.objects["dictGameData"].getFirstInstance()

    How to get exact dictionary object as JSON using its name (e.g. "dictGameData") or maybe its UID and then get its all keys/values as JSON to set a variable?