locohost's Recent Forum Activity

  • Z-indices are indeed unique, at least per layer. Though even if they weren't, bladedpenguin's method would likely work all the same.

    If every sprite on same layer has a unique zIndex, I may be un-screwed

    I can draw each sprite in ascending order of zIndex. This should always put the next sprite in it's proper front/back orientation. I think...

  • Is every zIndex unique? If not, I'm backed to screwed

  • I'm probably in some huuuuuge trouble because I think this is completely impossible in C2...

    I wrote a function that iterates over every terrain tile in my isometric map layout. I saved the terrain.type, terrain.zIndex, terrain.X and terrain.Y in an array and then downloaded it as JSON.

    Wrote another function to load that JSON file back into the array and recreate/draw the terrain.

    Now the very, very sad (for me) part...

    Remember, this is an isometric layout: There is no way to re-set the original zIndexes on the terrain sprites!

    I'm screwed right?

  • Yann Very nice work my friend! Working well so far. One trick escapes me: I have an array of objects I need to get into.

    How would I get to the attribs in an object within an array? Like...

    {
        "_id": "blahblahid",
        "units": [
            { "unitId": "blahUnitID1", "qty": 7 },
            { "unitId": "blahUnitID2", "qty": 5 },
            { "unitId": "blahUnitID3", "qty": 3 },
        ]
    }
    [/code:5q4ibz47]
    
    How would I get to the units[1].unitId or units[2].qty?
  • > lennaert Notice how you spelled Missle_New_Arrow wrong? Yeah so did I in the function name

    >

    If you use chrome, this could have shown up in the console: CTRL SHIFT J as an error about referencing a none existent function

    Really? I am using Chrome to test. But I wasn't looking at console errors. I'll have to look for that. Thank you!

  • lennaert Notice how you spelled Missle_New_Arrow wrong? Yeah so did I in the function name

  • Uhhh, I've tried to post the solution to this thread two times now and my post is not appearing? What's happening?...

  • > Hi,

    > Have you tried using Pick All condition before the second Pick by UID?

    >

    I thought that with pick by UID it was not needed.

    If the sub condition is at first level you don't.

  • Hi,

    Have you tried using Pick All condition before the second Pick by UID?

    Yeah I tried that, but you don't need that if the sub is out at first level. It repicks from the full list.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just a simple instance factory? The code below never executes inside where I'm picking the arrow created by the factory call. If I move the "Add_Message" line up above to the Token pick, I can see the arrow UID is 201. So it is getting created. I've tried the arrowUID both static and not static.

    Should this work or no?...

    [attachment=0:173n4lin][/attachment:173n4lin]

  • Yeah you guys are right, it's easy. I used a ternary operator to basically perform a trunc()...

     decimalAngle = ( decimalAngle < 0 ) ? ceil(decimalAngle) : floor(decimalAngle)[/code:36vds46g]
    This works. Thank you everyone!
  • Hmmm... Ok you're right. Perhaps using the negative number in the OP is making this harder to understand

locohost's avatar

locohost

Member since 19 Sep, 2014

None one is following locohost yet!

Trophy Case

  • 10-Year Club
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

14/44
How to earn trophies