Ashley's Forum Posts

  • When using Z axis scale 'Regular', a 'Field of view' property also appears in Project Properties, which lets you control the FOV used in both the editor and runtime.

  • Semitransparency in 3D is complicated. See the section on transparency in the tutorial Using 3D in Construct for more details.

  • Hmm, I think some of the content links are dead... but if you use the left navigation it works, which takes you here: https://www.construct.net/en/construct-2/manuals/construct-2/system-object-reference/system-expressions

  • I've avoided the "Every X Seconds" command because if I remember right, using "DT" is more accurate or stable.

    You don't need to avoid "Every X seconds". It's already framerate independent, because as the name suggests, it works in seconds, not frames.

    If you want to make your own time counter based on dt, then just adding dt is all you need to do. I'm not sure what you're trying to achieve with the calculation round((dt+1)/2) - there's no need to change it, just add dt by itself, and that's essentially a time counter in seconds. But you may as well use 'Every X seconds' or the Timer behavior for convenience.

  • This came up in issue 6944 but we haven't figured out why it happens yet.

    Try opening a terminal to the project folder (which has a file named Podfile in it) and run the command: pod install

    That might report some more details about the problem.

  • It's all there in the reference section. There's no more comprehensive source of documentation than the manual!

  • The Construct 2 manual is still available online here.

  • Here is my usage case - I have a dialogue system based on JSON files. These dialogues may call various functions with variable number of parameters:

    Construct does something similar when reading project files: depending on strings in the JSON, it calls different functions. For that we use function maps. Otherwise you end up encoding function names in the data format, which causes the maintenance problems I was talking about: you can never rename any functions without breaking compatibility with all your existing data files.

    I guess you can use the scripting feature if you want to anyway - after all part of the reason it's there is for more advanced use cases like processing complex JSON data structures. It's just if someone prefers to use event sheets and wants to call a function by a string, then I think the first suggestion should be to use function maps. Alternatively for small cases you can use other simple solutions like a string parameter and if-else-if style sub-events doing something different depending on the parameter. Only then if these solutions don't meet the demands of the particular use case would it then be appropriate to talk about scripting. There's no need to use a sledgehammer to crack a nut, as they say.

  • See the guide Exporting to Windows with the WebView2 wrapper. tl;dr - run WindowsIconUpdater.exe.

  • But this is the Scripting section, lol

    But I think they're only here because they read advice elsewhere to use scripting instead of function maps in the event sheet:

    i found this topic where the answer was given which says to use scripting.

    I'm afraid I still don't understand the example you gave afterwards either. I don't see that it is using calling functions by a string variable at all. They just all look like ordinary function calls.

  • Aside from the calling of maps/strings, which is already puzzling, have you considered how strange and limited the forwarding of parameters is?

    I don't understand the point. If you call a function by a variable string, you have to provide the same parameters regardless of the string provided, right? Function maps are no different in that regard.

    I don't think the poll proves anything. It could just mean most people don't have a need for calling a function by a string.

    In Construct's own codebase we use the function maps pattern in several places as it's useful, and one of our goals with event sheets is to design things in a way that mimics how programming languages work. While JavaScript does allow calling a function by a string of its name, it causes maintenance headaches, so we tend to use a Map with string keys and function values - the same approach as used with function maps.

    I think questions like "How do I call a function by name in an event sheet?" are best answered by "Function maps". Otherwise you are telling someone to ignore an existing event sheet feature and use JavaScript coding instead - which is ignoring the preference of the user if they want to stick to event sheets, and was a prospect a lot of people were worried about when we first introduced the JavaScript coding feature - so let's try not to fall in to that trap!

  • Function maps are pretty simple. I think people are overreacting. It's pretty much "map function to string", which assigns a string to a function so you can then refer to it by that string. Then you can have different maps with different names, and "call mapped function" calls a function by its assigned string.

    It also has the advantage of separating the string from the function name. With calling directly by a string of the name, if you rename the function, you break your events. So it's a brittle setup. With function maps, you can rename a function and everything still works.

    The existing "Function maps" example shows it pretty much in full. There's not much else to cover.

  • It's difficult to help without more details. If you run in to a problem please file an issue following all the guidelines, so we have enough information to investigate.

  • Are you aware that you can put data storage plugins like Array, Dictionary and JSON in to a container and get per-instance storage? That feature is aimed at covering exactly this, for more advanced per-instance data storage.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Look in Chrome's dev tools and you'll see the elements Construct is creating are actually <input type="button"> elements, not <button> elements. So the selector button won't match them. Instead try a selector like input[type="button"].