R0J0hound's Forum Posts

  • I was refering to the one made by yann, which doesn't utilize the array object. Also you could also look at the json format that the dictionary object uses. You should be able to more easily adapt that text to be able to load into that.

  • blackhornet

    The iid isn't related to picking, it's the instance number of the object type. I've utilized this to access values in unpicked objects. Off the top of my head, one use could be to compare two random instances of the same type.

    global number other=0

    pick random sprite instance

    --- set other to sprite.iid

    pick random sprite instance

    sprite x < sprite(other).x

    --- destroy sprite

    liev04

    I didn't look into it previously but after a quick test iids are an instance number of a object type, not a family. So the object.iid will give the instance number of that type and not instance number in that family. However, the family(3).x style expression will give you the forth (counting from 0) instance in the family.

    A brute force solution could be to change the function to:

    on function "getiid"

    for each family

    system: compare function.param(0)=family.uid

    --- function: set return value to loopindex

    --- stop loop

    Another way could be to give the family an instance variable that you set to their index number when you create it. You'll also need to update it when an instance is destroyed. There's probably other ways too.

  • Since it looks like the segments have momentum I'd say some kind of chain of springs. Also when the head isn't moving the body just looks like a sine wave along the line from the head to the base, but that may be a result of the springs, at least somewhat. Another thought is it may just be a clever combination of sine waves to affect the angle.

  • Use a function.

    var = function.call("getiid", enemy.uid)

    on function "getiid"

    pick enemy by uid function.param(0)

    --- function: set return value to enemy.iid

  • Do a search, there are a few examples of this.

  • There's a third party plugin that could help you, or you can use some javascript with the browser plugin or your own to parse it.

  • What are the errors?

  • Try Construct 3

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

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

    There shouldn't be an issue with canvas+ since this plugin makes no use of drawing. Only js is used. Also I only use html5 and nwjs exports.

    AnD4D

    I probably won't be getting around to this any time soon as I don't have a lot of time lately.

  • newt

    It just calculates all the distances and picks the closest.

  • I made up an example for that paper since it looked cool growing from one location:

    https://dl.dropboxusercontent.com/u/542 ... bute2.capx

    That said it is not simpler than the first example. Which tries 200 times per frame to find a good spot. Also it can be made to stop if enough dots are made.

  • It's following what the code you posted does.

    aka take a number of random points and find their distance to a closest other point. Finally just keep the closest of them all.

    In the capx it just creates a bunch of sprites, and destroys all but one.

  • Call events what you will, but they are the way to code the logic in C2. Regardless you can still use a c2 project as a reference to create the same thing in another tool.

  • You can use any program/coding language as a reference for anything else. It'll never be one to one because of syntax differences but the logic/algorithm is the same.

  • SamRock

    You just need to loop over all the isometric objects a find the x and y extreme positions. The scroll clamping assumes the iso objects cover more than the screen, so it uses half the screen size (320,240 in this case) to make scrolling stop at the edge.

    global number boundleft= 99999

    global number boundright= -99999

    global number boundtop= 99999

    global number boundbottom= -99999

    start of layout

    for each sprite

    --- set boundleft to min(boundleft , sprite.bboxleft)

    --- set boundright to max(boundright , sprite.bboxright)

    --- set boundtop to min(boundtop , sprite.bboxtop)

    --- set boundbottom to max(boundbottom , sprite.bboxbottom)

    every tick

    --- scroll to (clamp(scrollx, boundleft+320, boundright-320), clamp(scrolly, boundtop+240, boundbottom-240))