Scoremonger's Recent Forum Activity

  • Heya all, I know how to build gameplay logic in various systems and a thing or two about object oriented programming in general, but I'm not an expert in JS or web programming.

    I would like to add some functionality to the Platformer plugin, like coyote time and an arbitrary number of double-jumps. It's easy to do with event sheet logic, but I'd like something more portable. I hate having to redo my work (and C3 projects get corrupted when you try to copy paste things you shouldn't, I've found.)

    My instinct is to say, "OK, Platformer does a bunch of what I want, I'm not sure how to access its properties and methods directly in this system, and I don't see an easy way to make a component that's fully independent of that behavior while fully leveraging it", so my first thought is to make a child class of the Platformer behavior and just add a few new methods to it. Is that possible, or is there a clean alternative?

  • I can't find a way to search or filter purchased assets and there seems to be no way to hide old purchases from the downloads list. Since I have many purchases, this makes the act of figuring out whether I've already bought something, or locating something I definitely bought a pain. Am I missing something or is the store lacking these features?

    On that note, it would be useful to have a download link on product pages if that product has already been purchased.

  • You do not have permission to view this post

  • WackyToaster Interesting, thanks for the idea! That is generally what I do already - create a family-specific function to spawn arbitrary members of the family by name, so this test could slot right in. Much-appreciated.

  • winstreak Thanks for the suggestion! That would work in a test where I know exactly when things are created, but I'm talking more about confirming object spawns using event sheet logic so I can log errors and otherwise respond to an object that failed to spawn. I'm often spawning at unpredictable (and very fast) rates, so it's not always possible to manually monitor which spawns succeeded and which failed.

  • Noah1 that looks very similar to what I'd tried, but I'll copy what you have verbatim and see how it goes, thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In the Example Browser you can find a template project called "Gamepad Twin Stick Shooter" that illustrates how this works. It's using the right analog stick for aiming, not the left, but otherwise it sounds like what you're looking for.

  • Ah, thanks R0J0hound, that's a great idea. It seems so obvious now that you handed it to me on a silver platter, haha. XD

    And yeah, I am using create by name as a half-baked way of composing more complicated objects in a way that the pieces can be swapped in and out dynamically (a very poor man's component system, I guess.) So, I'll add some name variables or an array of names to an object, and at runtime I'll spawn objects with those names and add them to a hierarchy or manually store their UIDs. If I ever want to change them to another type, I can delete the instances, change the names, and spawn new objects. Since we don't have object or family type variables in this engine, I used this workaround, but it's also fraught with peril. It's so error-prone.

    Anyway, thanks again, much-appreciated.

  • OK, thanks, I'll use that one!

  • Noah1 Thanks, great tip! I tried it, and it does work in a vacuum, in terms of confirming that the function created an object when that function was just called once.

    Unfortunately, waiting a frame to do that test breaks downstream logic that depends on immediately getting a valid UID back from the object's creation. But worse, if I'm calling the creation function multiple times in a frame, passing in different object names, I can't say which function calls succeeded and which didn't. At least not if I'm using logic that simply checks how many objects exist after the function call(s) and comparing that to how many existed before them. Maybe there's a different method I don't know about, or maybe there's just no simple way to do this in C3 yet.

  • In most engines there is a way to create an object and then immediately know if it was created or not. I.e., if (createObject("spaceship") != null) etc. In Construct you can reliably create a family or object instance if you set it explicitly, but if you create an object by name there seems to be no way to know for sure that the thing you tried to create actually got created (or even exists, for that matter.)

    I tried making my own function to mostly do this, but it doesn't work. The logic for it is like so. I did it in event sheet logic, btw; this is just pseudo code.

    Local number startingObjectCount = 0
    Local number finalObjectCount = 0
    
    startingObjectCount = customobjectfamily.count;
    System.CreateObjectByName("MyObjectName");
    finalObjectCount = customobjectfamily.count;
    if (finalObjectCount > startingObjectCount) {
    	PickLastCreated(customobjectfamily);
    	return customobjectfamily.UID;
    } else {
    	return 0;
    }
    

    Unfortunately this always returns 0, I'm guessing because the object isn't actually created until the next frame? Does anyone know if there's a simple way to test at runtime whether the object type you're trying to create got created. I love creating objects by name because it's so powerful, but man it's annoying when there's a typo or something gets renamed and not all the calls that create that object type are manually updated too. Thanks.

  • Does anyone know if there's a new suggestions platform in the works (or already existing?) I was about to add a suggestion, but there's a note on what I think is the current platform that it will be replaced in early 2022. Did that happen? I did a quick search but couldn't find anything newer than that.

Scoremonger's avatar

Scoremonger

Early Adopter

Member since 10 Feb, 2014

Twitter
Scoremonger has 3 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x2
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

15/44
How to earn trophies