piranha305's Forum Posts

  • You do not have permission to view this post

  • Here is a quick exmaple of how i have done the conversion in the past

    here is the c3p file

    https://drive.google.com/open?id=1SeUkVyk3SzIXhc5UNTBOXW-55ldiE1yp

  • yep that worked, forcing the function to pick it, and changing the getAllInstances to getPickedInstances worked thanks

  • Hmmm let me try that out... And see if the instance gets picked

  • Okay thanks for the explanation, based on that I will move the creation logic to the script to have access to the instances thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley I was wondering if this is expected behavior? or if i should file a bug for it, so basically inside a trigger i am create some spritefont instances inside that same trigger after the spritefont instances have been created i set some properties, then i call a function. inside that function i am just trying to log all the instances of the sprite font to the console. those 2 arrays always come back empty when using getAllInstances, if i use getFirstInstance that reference comes back null, if i add a wait 0 seconds before calling the function those objects are then logged as expected.

    I did a bit more testing and moved the java script block inside the trigger, and got the same result it seems like created instances are only available in the java script api on the next tick after they are created

    so i got a bit more curious, and i tried to execute the javascript on the on created trigger for the sprite font, and that also came up with the same results... empty array

    when creating instances in events and trying to modify them through the javascript api are there any other ways to access the created instance in the same tick? or is wait 0 the recommended approach. would it be possible to attach hooks on the life cycle of an instance, like we have hookson the lifecycle of layout?

    runtime.object.Instance.oncreated = () => { ... }
    
  • I currently have 2 games that demonstrate how to mix events and java script, they are not really tutorials but going through might help a bit. you can get the c3p files here

    https://www.patreon.com/posts/tank-trax-clone-28597133

    https://www.patreon.com/posts/word-finder-28761484

    with that said It would be nice to see some more official templates integrating the scripting feature

  • Yeah I since have updated to use firebse directly log should have update at the bottom.

    And the not seeing your score is an oversight...

  • Yeah... I know I am not artistic... But yeah I agree some color would be nice.

  • https://piranha305.itch.io/word-finder

    the game uses dreamlo and and firebase for the online leaderboard, you can download the project file and a dev log HERE

    Tagged:

  • I think there will be tradeoffs. The more something is abstracted out and made more high level, the more you lose the ability to customize it at a granular level.

    I remember products like Dreamweaver back in the day that was a wysiwyg web page creator. They had drag and drop html elements.

    Even with something like that there is still this tradeoff that happens. And to fully customize what you were making you had to dig deeper. If you use the high level tools you lose some control. And i feel like that leads to cookie cutter solutions.

    If you think moving to unity because you have to write a bit code in construct is going to speed up your development time you gonna be in for a surprise...

  • Couldn't you do this mapping in events? Kinda of how you map strings to function you can map dom element events to c3 functions. You would just need a bit more information such as the element ID and the event you want to map?

  • i think the issue with those native dom elements would be the positioning? how do you position them? drag and drop? and use absolute position? that would be very hacky and depends on the ratio of the consumers windows.. relative positioning? you lose the ability to position the ui elements in the game window, and what you see might not be what you get in the end.

  • I kinda agree with you, but building UI widgets in webgl is not trivial, that would be a huge undertaking. plus why rebuild all those widgets when you kinda already have them in html and css, it seems like there needs to be a better way to incorporate html and css with the canvas.

  • drive.google.com/open

    trying opening the link form there, it's public image?

    well in a nutshell

    Browser Execute Javascript => self.c3_callFunction("functionName", ["param1"]);

    should work as long as functionName is a valid function