R0J0hound's Forum Posts

  • Mesh point positions aren’t in layout coordinates, they are relative to the object’s quad. So 0,0 is the top left corner and 1,1 is the bottom right. You’ll have to convert it over. So say you want to use x,y as a position you’d need to do:

    X=(x-self.x)/self.width

    Y=(y-self.y)/self.height

    Texture coordinates are similar.

  • It comes down to there is no perfect solution. You have to deal with some complexity somewhere.

  • I’d just make an invisible spikySprite that would be created over anything you want to be spiky. Placing them over all the relevant objects is pretty straightforward with events. And you could use pin or something to attach it to moving objects.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • igortyhon

    No worries, I just made a new topic to share the solution. This is at least the second time that user deleted a topic I posted a solution to. No harm done though, I should recognize his username next time and save the posts so I can repost the topic. I was curious to check out your example as well but the link was broken for me when I tried it.

    New topic

    construct.net/en/forum/construct-3/how-do-i-8/re-generate-level-map-179636

    MPPlantOfficial

    Apologies for derailing your topic. Tangent over.

    -cheers

  • There was an interesting question posted asking for a solution for generating a branching path but seems the topic was deleted by the user jentry after he got a few solutions.

    Deleted topic:

    construct.net/en/forum/construct-3/how-do-i-8/generate-level-map-179620

    Oh well, I think he did that to me before after I posted a solution to one of his other topics. Actually, looking at his posting history he deletes everything. Good to know.

    Anyways!

    I thought the solution was interesting enough to post again. It generates branching paths like this:

    The algorithm I came up with starts with multiple parallel lines with nodes in columns, and it repeatedly collapses random adjacent nodes in the columns. This image roughly illustrates the algorithm:

    Download link. In code blocks because this forum breaks new dropbox links otherwise.

    https://www.dropbox.com/scl/fi/ukgwp8kful81ztfg7s3qc/branch_path_gen.capx?rlkey=nsyu7ofa95ie9sng6b7a0xeeb&dl=1

    There is probably cleaner ways to implement it.

    igortyhon also posted a solution but I didn't get a chance to download it.

    -cheers

  • No violation that I know of. The original poster probably deleted the topic and it took all the replies with it. I’ve seen it happen before a few times. I guess this forum allows that but it always irks me a bit. We go out of our way to post a working solution to a problem and they get selfish and delete the topic after they get it. The solution was meant to help them, sure, but it’s also for the benefit of anyone else browsing the forum.

  • Mesh points are positioned relative to the object’s quad. 0,0 for one corner and 1,1 for the other opposite one. It’s a bit different but setting the pos to 0,0 and the size to 1,1 is one way to let you use layout coordinates and mesh point positions. Another way is to take and xy position and convert it with:

    (X-self.x)/self.width

    (Y-self.y)/self.height

  • Set the Sprite size to 1x1 and the position to 0,0

  • You do not have permission to view this post

  • If you want to try an ai coder then go for it. I wouldn't be interested in trying since it would create more work for me to verify made working changes and if it broke it I'm not interested in debugging it.

    I'm happy you've found enjoyment in using this plugin, but at this point I'm not likely to revisit it at all. I'm more likely to make a stand alone tool independent of Construct since most of what I want to do in Construct requires workarounds and once I made such a tool I'd probably disappear from here rather quickly.

  • The colors that construct support are just one single number. That js library appears to return an objects so I guess you'd get the color with rgbEx255(gotColour.r,gotColour.g,gotColour.b) but I'm almost certain that rgb function is accessed differently in js than in events.

    If you want a event based solution there's this:

    construct.net/en/forum/construct-3/how-do-i-8/hex-colour-values-code-179603

  • Here's an event based way

    https://www.dropbox.com/scl/fi/0zafmr4lyclg3mmcodkea/hex2color.c3p?rlkey=6ird9o8ud8opsp2k3v7chtb3x&dl=1
  • Here's an example. Uses helper functions with uids to access 1d arrays. local arrays are created as temporary and are automatically cleaned up each tick. Shows examples of global, local, static and instance variables.

    https://www.dropbox.com/scl/fi/92uyaria57umj85d6vsps/arrayVariables.c3p?rlkey=kcnxwxheph0g7poe3lo7h7qc1&dl=1

    Could be modified for 2d arrays.

  • Using some kind of id to reference each array and having helper functions to access or manipulate them is probably the easiest way to go. Uid is good as an id since you can access newly created instances immediately. Iid is an alternate idea where you can access data without a helper function. For ex: array(a).at(5). But for iid you’d not want to be creating instances on the fly, instead you’d want an object pool that you’d allocate from.

    Global, static or instance variables would require you to create arrays. And for instance variables you’d need to manually destroy them.

    For local variables you could either manually destroy them when done with them (tedious to keep track of) or just mark them as temporary and then clean up all the temporary instances at the end of the tick. Still it will be on you to make sure you don’t store temporary arrays in non local places.

    Another strategy for locals is to just have a small amount that you juggle the use of. Typically you don’t need too many.

    You mentioned json. You could use a single json object to store all the arrays instead instances of the array object. I say a single instance because that could be simpler to work with than dealing with picking.

    If you use helper functions to access stuff you can implement things anyway you like under the hood. Here’s a possible design of the helper function.

     new(tempBool) -> id
    delete(id)
    isTemp(id) -> true/false
    clone(id) -> newId
    copy(id, other)
    equals(id1, id2) -> true/false
    clearToValue(id, value)
    mergeX(id, otherId)
    mergeY(id, otherId)
    getwidth(id) -> width
    getheight(id) -> height
    setSize(id, width, height)
    get(id, x, y) -> value
    set(id, x, y, value)

    Anyways. Just some ideas. I’ll have a look at an implementation later. There are usually simplifications that can be done.

  • Probably something like this or so.

    https://www.dropbox.com/scl/fi/tp34591xsnw69ga17m58r/fish_maybe.c3p?rlkey=wquwjk7sfp51hgj56v31y70mw&dl=1