Magistross's Forum Posts

  • You can probably load an empty image from a dataURI on layout changes.

    Someone claimed this is the tinyest transparent GIF : "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="

    So "Load image from URL" and insert that previous line.

  • You can use the "AsJSON" expression to retrieve all properties from an object serialized in JSON, and then use the "Set from JSON" action to load said properties an another object.

    edit: Ninja'd

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well rounding is inherent to shortening the number. There wouldn't be much use display, say, "1.234567M" instead of "1 234 567". However, the function I made can round to the desired decimal place. The second parameter is the decimal place count that you wish to have. I guess 3 decimal places would be the just compromise.

  • Just use this URL : editor.construct.net/r159

    You'll be able to inspect his file.

  • I once did something like also but I went the "arithmetic" way. You populate an array from the front with symbols and the function will take care of the rest. When no more symbol can represent the number, the system will revert to using scientific notation.

    drive.google.com/open

  • Since we recycle the text objects, it might be best if additionnal data associated with the names are decoupled from them. In my example, I would use the array to do so, by turning it into a 2D Array.

    edit : Just realized you wanted to stay away from the array, I updated the example to work directly with the text objects.

  • There is no single or "best" way to do that. For a barebone way to do it, this is pretty much it : drive.google.com/file/d/12Vg771H4Qh0TXdwEpN2UGls2xPKsIYb1/view

  • Both would have their use-case I guess... however both would probably be hard to implement. :(

  • So we basically needs something like the "container" from CSS-Flexbox but that works with actual "world" object instances.

  • Parameters work differently in C3, you have to explicitely declare them. Right-click on your C3 function, and use "Add parameter". You can then use this parameter as you would have used "Function.Param(0)".

  • There's obviously no proper way to do this but with the advent of the scripting functionality I wondered if it would be possible, so I delved in the runtime javascript a bit.

    It seems function event blocks do possess a "_functionName" property. However, I'm not sure how safe it is to rely on it. Perhaps Ashley could enlighten us a bit on the subject.

  • "Create object (by name)" doesn't do any picking. So you need do it yourself before doing actions on your newly created object. Fortunately, a "Pick last created" condition was added to go along "Create object (by name)". Use that in a subevent right under your creation event, and it should work as you wanted.

  • Yes, that's why it didn't work. And also, this is a shared behavior of all triggers, they cannot be nested, which, as you said, wouldn't make sense if they could.

  • You can use sub-events or even a function to trigger specific behavior according to which AJAX requested was completed.

    The single entry point must be "On any completed", but after that, you need to check the AJAX.Tag expression to identify which request it was.

  • I think most of the problem comes from the misconception that "Wait" from other blocks of events influence the flow of the "main" block of events.

    You should add a "Wait for signal" after the function call, and signal at the end of the function. It should start to behave like you originally thought.