R0J0hound's Recent Forum Activity

  • Apologies, I missed that this was a question for c2 plugins. There is no way to make custom interfaces in the editor with that, and they aren’t working on c2 anymore so there’s no possibility of doing that in the future.

    You could make a separate program that modifies capx files, but you’d have to close the project in c2 first so that workflow isn’t ideal.

    Another idea is to have an editor at runtime. You could do whatever you want there. probably pause the game, and draw your editor on a div on top of the game canvas. The only annoyance there is to get the changes back into your capx you’d need to either have it download a file that you’d need to manually reload into your project or maybe copy a text of the data and manually paste that into c2 somewhere.

    Either isn’t super useful.

    In c3 like I said you could create a div, add it to the body, set its position to absolute and make it cover the screen, and set its z index to be higher than 10000 or so so other editor elements aren’t clickable through it.

  • Best you can do is to open a pop up windows with a link. Basically create a div covering the entire screen and making your own interface there.

    There is no documented sdk feature to make something more integrated into the c3 editor.

    Officially they are opposed to bypassing the sdk to access undocumented internals. So probably you could make a feature request to add to the sdk.

  • You could use a tilemap to do text too. That would let you only update the characters you wanted.

  • You’d have to implement your own on value changed scheme. Maybe store the old values in a separate array.

  • So slower?

    Apart from changing between text,spritefont or html element to draw text ( they all work the same with a set text action), you could use js instead of events to update the text. Or maybe use multiple instances vs one big one.

    That’s mostly what you have control over in construct.

    In general JavaScript will be much faster than events if you don’t mind using it. Personally I don’t mind using js but I find it very unpleasant using js within construct.

  • The event system has nothing to do with JavaScript. That’s just what it’s implemented in and actually events do not have a direct correspondence with js.

    If it helps being able to use ors between groups of and’d events has been suggested at least a few times before.

    I think one roadblock is that conditions aren’t just logical, they also deal with picking which leads to some quirky situations.

    Anyways you can largely do what you want to do is just with the system compare or evaluate condition and the and/or expressions (“&”,”|”). But that mostly depends on there being a single instances of the objects you’re comparing and if there’s an expression equivalent to the conditions.

  • I second the idea to use spritefont instead of the text object. Or you could even try setting the text of an html element.

    If rendering all the text is still what’s making it slow you could make the memory view scrollable and only draw on screen text.

    If the rendering isn’t the bottleneck then you could try doing the update over multiple ticks to spread the load. There is an overhead with events over doing it in straight js but it varies. Generally it doesn’t matter but even a small overhead adds up when you do a lot at once.

  • How are you placing the cubes?

    If you are placing the cubes from isometric coordinates (ix,iy,iz) the diagonal would just be iy.

    As an example here is the math to project an isometric position (ix,iy,iz) to the screen (x,y):

    X=ix-iy

    Y=(ix+iy)/2-iz

    If instead you only have the xy positions of the cubes you can reverse the formulas above to get the iso position. But the iz value can be anything per cube.

    ix=y+x/2+iz

    iy=Y-x/2+iz

    Possibly you can look at the zorder and relative position of overlapping cubes to calculate the iso position too. But you’ll often have ambiguous solutions. For example if there isn’t a cube at the center intersection then it out guess four iy layers instead of three.

  • Typo on my part. It should be mid(a,loopindex,1). I wrote i instead of 1

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One way could be to find individual letters in the first string in the second. Anytime a letter is found you’d remove that letter from the second. It would mess up the second string so you’d want to copy it first. Should be pretty doable in a function:

    function findMatches(a, b)
    -- var match=""
    -- var letter=""
    -- var i=0
    -- repeat len(a) times
    -- -- set letter to mid(a,loopindex,i)
    -- -- set i to find(b, letter)
    -- -- compare: i>-1
    -- -- -- add letter to match
    -- -- -- set b to left(b,i)&right(b, len(b)-1-i)
    -- -- -- set return value to match
  • Had another go at it so now the logic is a bit more understandable and fits within 25 events.

    When you click on a tile it does a search for valid moves from that tile to other matching tiles. the path from one tile to another can only bend twice and the path has to go through an empty space first.

    Then when you click on a matching tile it destroys the tiles and draws the path.

    If you want to see the pathfinding in action make the marker sprite initially visible in the editor.

    It's trivial to change the number of unique tiles, but just be sure there are enough tiles on the board so there can be pairs.

    dropbox.com/scl/fi/gpd6ss46cm1a7vfb469ev/onet2.capx

  • Is it the same thing?

    That example was after me plating an Onet game just long enough to infer some rules. Best I could tell matches consisted of adjacent tiles or tiles connected with a path with at most two bends. There are probably simpler and more understandable ways to do it.

    I know the common way to make games now a days is to find a tutorial or find/buy a template. But usually you can get pretty far just by making a list of the rules of a game and figuring out how to do each of those.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound