fisholith's Recent Forum Activity

  • Hey VictoryX, <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Filmation math

    http://bannalia.blogspot.de/2008/02/filmation-math.html

    This is one of the best explanations I've found for a general approach to Z ordering objects for isometric rendering.

    Isometric depth sorting

    https://mazebert.com/2013/04/18/isometr ... h-sorting/

    This dev blog article walks through implementing and optimizing isometric Z ordering for a game targeted at mobile devices.

    It actually links to the first article, but this one spends more time talking about the actual code, pitfalls, and making it efficient.

    My isometric demo capx

    https://www.scirra.com/forum/viewtopic.php?f=147&t=127352&p=900336#p900336

    (see my 1st and 3rd post for details. 3rd post has capx.)

    Finally, here's a reply post I made a little bit ago, for some one asking about jumping in isometric games.

    I built a simple isometric demo capx, which you can download there.

    Granted I'm using a simpler Z ordering system than is described in the above articles.

    Example image:

  • Thanks for the reply Rex,

    I looked over the Function runtime code.

    So it looks like "AddVariadicParams()" is passed as an array to the corresponding runtime function single parameter.

    Is it okay to use it for Plugins and Behaviors?

    Ashley mentioned in an older post that it was a hack for the Function object, and was not recommended for use in 3rd party plugins. Granted, he said that was not recommended, 'for the time being', and that was back in 2012.

    Do you know off hand if whatever limitations that existed then are no longer an issue?

    The plugin I'm working on would ideally be usable as a behavior.

  • Is there an official way to make Conditions and Actions with unlimited params (variadic)?

    I know Expressions have the "ef_variadic_parameters" flag.

    And the Function object uses the "AddVariadicParams()" method for the "Call Function" Action, but I'm not sure if this method is for the Function object only, or if it's okay for general use in 3rd-party plugins.

    So, I'm curious if there is an official way to do this for Conditions and Actions.

    Thanks in advance for any info or suggestions.

  • Hey all,

    Does anyone know where in the C2 runtime shader Effects are applied?

    In particular I'm trying to find the code which sets up each effect's coordinate space, for an object with a list of applied effects.

    That is, inside the GLSL code, the X and Y sample coords are different from layout or canvas coords.

    I'm trying to find the code that does the canvas-to-GLSL coord space conversion.

    Granted, it might be that the effects are just called on some kind of quad, and the coords are taken from the quad corners, I'm not sure how exactly GLSL coords work in C2.

    Basically where ever the GLSL coord space is explicitly or implicitly determined is what I'm trying to find.

  • Thanks Rex and Ashley for the info

    I looked through the example code you posted, Rex,

    and in the context of some of the things you said, Ashley,

    I think I kind of see what's going on.

    Is there a place in any of the runtime files I could look to see the implementation of the SOL system?

    In particular I'd be interested to see a list of the available methods and fields you can use to interact with the SOL.

    Kind of the SOL "interface".

    Is a SOL attached to each C2 object type, and implemented as a SOL JavaScript object, assigned to a JavaScript field of the c2 object type?

    Or is it something global to the entire runtime?

    I might be misremembering, but it seems like I've been seeing things that looked to me like they could indicate that it's handled on a per C2 object type basis.

    I haven't yet been able to track the references to the SOL far enough back upstream to see where they are originating from.

    I also gather that there is a SOL stack that is used to store (for later restoration) SOL state as you recurs into deeper levels of events. Though again, I'm having trouble finding the actual code that would make it clear if that stack is a field of a C2 object type. I suspect that it might be in the commonace.js file, but I haven't been able to spend much time poking around in it yet.

    Sorry for the noobly questions.

  • Is there a good place or plugin to look at to learn how to implement object picking?

    I've been looking around a bit, and it's hard to tell what is and is not special-case picking code.

    (Kind of the same way the function object has the "fast trigger" system that's not intended for general SDK use.)

    Does anyone know of an SDK picking tutorial, or a plugin that has generally applicable picking code?

    Part of the reason I'm interested is that I'm building a document full of template code snippets for various common ACE related tasks, such as looping, executing triggered conditions, and now picking and SOL manipulation, if I can figure it out.

    Any thoughts or advice much appreciated, thanks.

  • Hey Thndr, <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    You might be able to solve this by using "Families" to escape the reciprocal picking that happens with containers.

    Manual > Families: https://www.scirra.com/manual/142/families

    Setup:

    Place the person into a family named "Damageable".

    Event:

    Hitbox is attacking. // Selects all attacking Hitbox objects.

    For each hitbox.

    Event:

    Hitbox is overlapping Damageable family

    Pseron.UID does NOT equal Damageable.UID // Prevents the Hitbox from attacking the Person who owns it.

    Actions:

    Damage Damageable. // Deals damage to all Persons overlapping the Hitbox who are not the Hitbox owner.

    Note the sub event condition that includes Person.UID.

    Here we are assuming that the Hitbox's Person is selected because they are both in the same container, and we're also hoping that won't influence the selected objects in the Damageable family, and it shouldn't, BUT...

    If you want to be absolutely sure that the containers aren't involved, and thus can't get up to any of their containerly shenanigans, then instead of getting Person.UID from the Person implicitly selected along with the Hitbox, you can store the Person UID directly in the corresponding Hitbox when the Hitbox is created.

    Event:

    Hitbox, On created:

    Actions:

    Set Hitbox private variable "parentPersonUID" to Person.UID.

  • Hey unska, <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Construct 2 has a feature called "Families" which might help out in this case.

    Manual > Families: https://www.scirra.com/manual/142/families

    You can put several objects in a family, then write events that apply to the family , and those events will affect all the family member objects.

    You can also add private variables to a family, and all family member objects will get their own local copies of those variables. This could be handy for the properties common to all monsters, speed, bullets, health, sprite, name, loot drop, and such.

    As for collisions and graphics, for a single character I usually create two separate dedicated objects. One for collisions, physics, and motion, and one for the graphical representation of the object in the game. The physics object will be invisible. The graphics object will be pinned to the physics object. This way my collision geometry can be very simple and predictable, and my graphics can be modified without affecting the collision properties of the character.

  • Hey farflamex,

    I'm not sure if this is what you're looking for, but the Browser object has expressions for screen width and height, as well as a "Request fullscreen" action.

  • You could try using the "overlapping at offset" condition of the Sprite object to test to see if it *will* be overlapping a wall if it makes a given move. You can use that information to cancel the move if it would result in overlapping a wall.

    The "overlapping at offset" condition basically ghost moves your object temporarily to a nearby offset, where it checks for an overlap, and afterwards returns the object to it's real location.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Awesome, glad it helped out.

    Oh, I fixed the images. My "Img" tags were around the web address, not the file address. Derp. :)

  • (edit: just realize that "ran" variable was declared just above the if statement, and added it in.)

    I just found a block of code in the Function object's runtime that seems to log info to the browser's(?) console when the game is in preview mode.

    // Note: executing fast trigger path based on fs.name
    var ran = this.runtime.trigger(cr.plugins_.Function.prototype.cnds.OnFunction, this, fs.name);
    
    // In preview mode, log to the console if nothing was triggered
    if (isInPreview && !ran)
    {
    	log("[Construct 2] Function object: called function '" + name_ + "', but no event was triggered. Is the function call spelt incorrectly or no longer used?", "warn");
    }[/code:3owxtq4i]
    
    What do "isInPreview" and "!ran" represent here? I have a guess, but I haven't come across "isInPreview" in the SDK documentation, though I might have just missed them.
    
    Is this method of logging safe to implement as a third-party plugin developer, or is it a special case thing. 
    Any weird pitfalls to be aware of? 
    
    Just curious. Thanks.
fisholith's avatar

fisholith

Member since 8 Aug, 2009

Twitter
fisholith has 2 followers

Connect with fisholith

Trophy Case

  • 15-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
  • Email Verified

Progress

19/44
How to earn trophies