DiegoM's Recent Forum Activity

  • You are conceptually doing the right thing, but you missed a couple of key ideas when working with families and functions.

    Families

    1. When you use a family to pick instances in a condition block, you then need to use the family in the action block for the picking to work as you expect. If you directly use the object type that is part of the family in the action block, then the picking that took place in the condition block will be lost.
    2. If you want object types to share behaviours, effects or instance variables through a family, you have to add those to the family itself. This connects with the last point, because if the behaviour, effect or instance variable you want to use has not been added to the family, it won't be available to actions for the family.

    construct.net/en/make-games/manuals/construct-3/project-primitives/objects/families

    Functions

    You can use the Copy Picked option so that the picked instances in the body of a function will be the same as the picked instances in the action block that called the function. If you don't use this option when the function executes, the picking is reset.

    In your case this ties up with the first point because the picking done by the On Touched condition was done through a family.

    construct.net/en/make-games/manuals/construct-3/project-primitives/events/functions

    I updated your project so you can compare it against the old one to see what all of that means in practice!

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

    I felt that making those changes was a little bit clunky, so maybe we will fix that in the future.

  • You can also search for "timeline instances" in the example browser for a quick demo.

  • Look into this part of the manual.

    construct.net/en/make-games/manuals/construct-3/plugin-reference/timeline-controller

    The most relevant part is the Set Instance action of the Timeline Controller plugin. With it you can change the instances that a timeline will use before playback.

  • The missing animation controls should be easy to add in the future. Right now you could do something using the Progress expression to detect when an animation ends, but it would be fiddly as the value is not guaranteed to hit 1.

    Loading animations separately from models sounds like it's going to be more complex. It was mentioned already so at least it's on our radar.

  • Have you tried using bookmarks? It's not exactly the same, but it should work similarly. You setup the bookmarks in the places you are going to be going back and forth, and then you keep the bookmarks bar open on the side.

    If you have more than one monitor (or a very large one) you could even detach the bookmarks bar to a popup window so it isn't in the way.

  • Adding the notion of a template layer is massively complex, on the surface it seems straight forward, but I can already foresee it being an endless source of bugs.

    Mainly because it would need to "just work" with regular layers, global layers, sub layers, all their combinations and an indefinite level of nesting.

    I don't even want to think about the kind of setups that could be made, like a template global layer which is also a sub layer of another template, or something to that effect.

  • I looks like you should be using Tween "On finished" trigger, rather than Sprite "On finished".

  • I will try to fix this for the next stable version. It looks like it's a subtle problem with looping.

    It would be better if you make an issue in our bug tracker.

    github.com/Scirra/Construct-bugs

    That is the best way to make sure it's not forgotten!.

  • I looked at the implementation and it's slow because it's technically correct (checks if the incoming set of tags is a sub set of the corresponding instance tags), but does so in an inefficient way.

    I think it can be made to be about 50% faster, by handling the special case of a single tag and in other cases, improving the check against the existing tags set. That would be it for improvements though, I don't think it can be made to be much faster because the condition is inherently more complex than just comparing two values.

  • This is not possible in a browser. If your server does not support web sockets at all you will need a proxy that does so it can stand in the middle and translate the messages.

  • You are running into an edge case.

    When the focus is on the TextInput, then the Keyboard object no longer handles keyboard input, instead Construct is allowing the browser to take control. Handling the interaction between the keyboard and a text input is surprisingly difficult (if you want it to work as users expect it should work that is), so instead of reinventing the wheel, we just let the browser do it's thing and for most cases it's the right thing to do, just let the user type normally.

    To do what you describe, you have to get a little bit clever though...

    The first thing I noticed is that after making the input visible, focusing it wasn't working for me, so I included a very short wait to make sure it worked.

    The unintuitive part is hiding the input, to do so I did a couple of things:

    1. Use a trigger that responds to changes in the input.
    2. Use a regular expression to check if the last character of the input is the one I am interested in. In this case the regular expression "'$" does just that. The $ is checking it is the end of the string. "gi" are regular expression flags indicating the match should be global (g) and case insensitive (i), I don't think any of those matter for this contrived example.
    3. Make sure to remove the "'" from the string in the action block, because I imagine you don't want it to be written in the text input.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Construct only understands numbers, strings and booleans. You need to quote the whole thing to pass it as a string.

    '[{"key":"username","value":"JohnDoe"},{"key":"email","value":"test@example.com"}]'

    In your plugin code you can then use JSON.parse(your_string) to transform the JSON string into a JSON object.

    About quotes... make sure the outermost quotes are different to the ones used in the JSON object. In this case I quoted the whole thing in single quotes, that way the computer can easily understand that everything in between the single quotes should be a string.

    If for some reason you wanted to use double quotes in the outermost layer, you would need to escape the double quotes in the JSON string so they are interpreted as the raw character instead of their special meaning and it would look something like this

    "[{\"key\":\"username\",\"value\":\"JohnDoe\"},{\"key\":\"email\",\"value\":\"test@example.com\"}]"
    

    In my opinion you should only do something like that if it's absolutely necessary.

DiegoM's avatar

DiegoM

Member since 24 Apr, 2015

Twitter
DiegoM has 1,774,968 followers

Trophy Case

  • 11-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • RTFM Read the fabulous manual
  • x2
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

20/44
How to earn trophies

Blogs