Straskal's Forum Posts

  • Ashley

    Never mind about the suggestions & ideas response. Was looking on there and does in fact seem the place to ask for SDK enhancements.

  • Hey, friends.

    TLDR

    I wrote a behavior to allow families to pick sibling objects, including other family siblings.

    https://www.construct.net/en/make-games/addons/365/sibling

    About

    I saw that someone on the forums created a similar addon, but couldn't find a link to it anywhere.

    So for my own game, I developed an addon to allow families to pick other sibling objects, including families. The original implementation was better but used undocumented SOL APIs, so I changed it to just enable you to grab the sibling UID, then pick it yourself. It's a bit less intuitive, but still works really well and am using it in my game.

    I've many composite objects, using containers. And now the containers can benefit from abstraction.

    I didn't originally plan on releasing it, but I figured it would come in handy to others.

    Let me know if you find it useful :)

  • What workflow gain is there from loading an image via URL, as opposed to loading the file from your pc?

  • You'll have to combine events and scripting. You cannot access addon sdk properties, expressions, etc... from scripting.

    What you can do is create 2 local variables in your event/group.

    Set those variables using events. You can use events to access your plugins expressions.

    Then access those properties through localVars in your script.

  • Okay. There is a part in the ACEs documentation that mentions object picking as if it was intended on being a public API at some point.

    ACEs - isStatic

    Might want to update the verbiage on that.

    There's another way that I can go about writing this addon, but not nearly as intuitive.

    If addon devs need more object and methods available, how to we go about getting that on Scirras backlog? It seems overly complex to request documentation in suggestions & ideas.

  • The integrated event style is how I've been going about it, but I do feel like sometimes it creates more complexity.

    Thank you, sir

  • I'd like to use math functions. i.e. math.distance(...).

    Is there any way to access system expressions in scripts, or has anyone found a work-around?

  • Ashley

    I appreciate the feedback! That's understandable.

    Would it be feasible to take baby steps and document the bare essentials for object picking?

    Thanks.

    Edit

    To be more specific, the methods that I'd request in order to enable the development of my addon:

    • ObjectClass.GetCurrentSol()
    • SolStack.SetSinglePicked(...)
    • SolStack.SetArrayPicked(...)

    https://github.com/Straskal/c3addons/blob/4132421befaa55d256b3ac06e3e2e016570dc903/addons/Straskal_Sibling/c3runtime/instance.js#L69

  • Ashley

    I know Scirra is a small team and you probably are getting a ton of messages each day, but I'm hoping to grab to your attention again.

    Any thoughts on this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey, Mikal.

    I dont think that there is a documented way to do this right now.

    The addon sdk is still a bit limited. If you need additional functionality, you should request it.

    Unfortunately, the scirra team is small and sometimes slow to respond.

  • Ashley

    Are you willing to add official, documented support for the SOL object and object picking to the Addon SDK?

    Why I'd like to have the SOL API:

    As a POC, I wrote a plugin to allow family objects to pick other family objects/siblings that may exist in in the object's container using the following methods.

    • [Family object] Pick first sibling [Object type/Family type]
    • [Family object] Pick all siblings [Object type/ Family type]
    • I could easily add more useful conditions, but these are all I needed for my game.

    It enables further abstraction of objects, allows event re-use and is extremely useful for keeping event sheets maintainable by combining the power of containers and families.

    BUT, it relies on the undocumented SOL object and picking methods, so I cant use it as I'd be risking breaking my game if the API changes, which I doubt will actually happen as the SOL object and methods are used heavily throughout official plugins.

    Looking forward to hearing from you.

  • My team wouldn't appreciate me sharing our project file. And I'd rather write up a tutorial than create a template project.

    For now, Just remember that its entirely an illusion, the jumping and platforming I mean.

    You have to do some "tricks" that make it appear that this kind of perspective is on all three x, y, and z axes.

    Creating a mental model is made a lot easier with the method I've described above.

    Shadows are x axis, when moved left and right.

    Shadows are z axis, when moved up and down.

    The sprite object casting the shadow is used to convey the y axis, when moved up and down.

  • I also working on something similar. More of a hack n slash but from the same perspective of a beat em up.

    The way that I have handled this is composite objects.

    Moving characters, like the player and enemies, are made of two objects: their shadow, and their sprite.

    The shadow is what the player/AI is controlling. Up, down, left and right.

    The shadow is the characters solid collision object, and the sprite is the non solid hit box object.

    The sprites position is updated at the end of every frame to match the change in movement of the shadow. (Pinning doesnt work, you'll see why)

    When "jumping", I use a tween to move the Sprite object in a jumping manner. This works great because I use the shadows Y position as the "ZDepth", which tells the sprite where to "land", or "what is ground". (If using the pin behavior, then the sprites x and y cannot be changed)

    I'm about to be implementing the pseudo platforming and was thinking that I can use raycasts.

    The idea is that when the player is jumping, I can raycast down from the players feet. If that raycast intersects a "platform object" that matches the "z depth" of the shadow, then I can just move the shadow "on top" of the platform object, and then the Sprite will use that newly updated position as the "where to land".

    It still needs some thought, because you will also need to handle falling off platforms and such, but that's where I'm at right now.

    Hope this helps or inspires other ideas!

  • Construct typically logs detailed error messages in the browser's console. That'll be worth checking out as it can provide more information about the issue.