Magistross's Forum Posts

  • I modified the raycast example a bit to add bullet firing with ray-like bounces off solids. Plot twist, I'm not using the Bullet behavior for movement but Tween !

    drive.google.com/open

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You might be interested in the "Raycast reflections" example from the Start page. You could salvage some of the concepts to make your bullets react as rays.

  • You can use a function to create your own "Log" implementation.

    Function.Call("Log", 2, 8) thus returns the base 2 log of 8, which is 3.

  • images can't be stored in an Array or Dictionary

    ...unless you store them in data URI format. You can use tools like this to create a base64 encoded image. You can then use the "Load image from URL" to load the result and display the image.

  • Ashley The weird part is that it actually did work, but not for the reason I thought. The variable was changed at 0.1 second interval so the "Set Text" action was setting the correct count.

    Absolutely need another function to create distinct scopes for independent variables.

  • It's not a bug. The loopindex after the wait is back to 0. You might try your luck with a function parameter, I believe I read somewhere that they are kept in a closure or something when used in conjunction with "wait" actions.

    + System: On start of layout
    -> Functions: Call DoCount (Times: 100, LocalLoopindex: 0)
    
    * On function 'DoCount'
    * Parameter 'Times' (Number)
    * Parameter 'LocalLoopindex' (Number)
    ----+ System: Repeat Times times
    -----> System: Set LocalLoopindex to LoopIndex
    -----> System: Wait 0.1 Γ— LocalLoopindex seconds
    -----> Text: Set text to LocalLoopindex
    
  • Indeed, and my mind is actually is little blown by all this !

  • Oh I see, thought this was SDK scripting. Didn't know about actual scripts inside events !

  • Excerpt from the SDK documentation :

    GetInstanceVariableCount()

    Return the number of instance variables for this instance.

    SetInstanceVariableValue(index, value)

    GetInstanceVariableValue(index)

    Set or get an instance variable value by its index. Note the type of the instance variable will be preserved.

    So it seems variable names are lost, and you have to rely on the index.

  • jobel Most programming language implements a "regular expression" interpreter that share more or less the same syntax... so one could say that regular expression is a language agnostic way to search for patterns in some text. It can be used for things like advanced searches\replaces, validation and so on.

    If you're curious about it, this site should have you covered : regular-expressions.info/index.html

  • Weird, it seems some escaping characters were left out when I copy/pasted from RegExr. (That tool is invaluable!)

    To isolate what's between your tags you need to inspect capture group #2 as seen here :

    However, Construct implementation of Regex is a bit lacking in that regard, you can't inspect capture groups while in global mode. You need to rexecute the Regex on each match individually without the "g" flag, which is quite a bother.

  • This Regex would have done the trick also :

    [(\w+)\](.+?)[\/\1\]

  • If using a dictionary is your only solution, you might want your dictionary keys to convey useful additional information.

    You could have keys like "key_0" or "key_something" where "key" is your actual key name and the "_" suffix is some additional information that helps you identify what tilemap the data should correspond to. You can then parse the key name to retrieve the info.

    Note that this is much slower than all the other solutions proposed.

  • I never really dabbled with the multiplayer object but I think a single "host" layout that handles all peer communications should be the privileged solution for a "multi-layout" multiplayer game.

    However, I think it would also force you to rely on custom messages for syncing your game state...

  • The spritefont object can't have some of its characters recolored temporarily. There is really no easy way to that without resorting to some clever workaround.

    You can map additionnal characters that are almost exact "copies" of existing ones and are mapped to differently colored characters. To create your additionnal characters set, you can use something like this : lingojam.com/WeirdTextGenerator

    In your SpriteFont sprite, you then add additionnal characters to match your new characters set and apply whatever color you need.

    For example :

    abc... are mapped to white characters

    π”žπ”Ÿπ” ... are mapped to red characters

    𝒢𝒷𝒸... mare mapped to green characters

    etc.