R0J0hound's Recent Forum Activity

  • Basically you’ll want to loop over all the tiles, aka consider each tile one by one and remove it if it’s overlapping the sprite.

    However you can only check for an overlap with the entire tilemap and not one tile. One solution is to check if the center of a tile is overlapping the sprite, another idea is to position a tile sized sprite at the tile to use a collision detector.

    Also you only need to check the tiles that overlap the sprites bounding box.

    Event would roughly be this. It assumes the tilemap is at 0,0 and has a tile size of 32x32

    For x from int(sprite.bboxleft/32), int(sprite.bboxRight/32+1)

    For y from int(sprite.bboxtop/32), int(sprite.bboxbottom/32+1)

    Tilemap at x,y <> -1

    System: point (x*32+16, y*32+16) overlaps sprite

    — tilemap: remove tile at x,y

  • There is no api to access global variables and such in c2 like there is in c3. Since we are dealing with JavaScript you can find a path to access the global but the minifier will break that.

    Generally you’d just covert the variable to a string when you use execjs.

    Browser.execjs("alert("&myglobal&")")

  • You’ve pretty much covered what is available. There is also a pay for third party plug-in called 3dobject by mikal that lets you load 3d meshes.

    You can load 3d files such as .obj with vanilla features too. You just need to parse the file, then create and distort the sprites to make up the polygons. I guess that isn’t what most want to do though.

    But to answer you last question, yes, cubes is your easiest option and the kind of 3d construct is currently designed for. Anything beyond that takes more work and creativity with the features available.

  • Would it be feasible to make one tailored to how you want it to work? Just have to break it down into manageable steps.

    A way to display text and a list of choices.

    A way to select a choice

    Then a change the text and choices.

    All easily doable but I guess there’s some aspects you have a more complex behavior in mind. Also json, xml, or arrays are just ways to organize the dialogs. But you can do it in many other ways.

  • Maybe try making the width negative.

    If that doesn’t work then it is possible to take a sprite with a distort mesh to position the corners any way you want. But you’ll have to mess with a fair amount of math.

  • Whatever works I guess. I don’t use waits. Most I’ve done is wait till the next frame to work around a physics behavior quirk.

    Typically the way picking works with newly created objects is fine, although you may need to approach the problem from another angle.

    Even in complex picking involving newly created objects you can do it in the same tick, with two events, one to create, and one to pick.

    Also in the interest to make things simpler I’ve also tried keeping track of the uids somewhere to be able to use the pick by uid condition.

    Sounds like the there’s a bug/quirk/oversight or nuance involved with hierarchy in your case though.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The pick children could have a different behavior. I haven’t tried using that yet though. Anytime there’s events surrounding creating objects this sort of thing comes up one way or another. A bug report could be valid since there was more complexity added for the children feature.

    Most of the events I write work around when new objects can be picked. It is a rough aspect of the system. The picking system works great when all the objects already are created. It also works well when all you’re doing is modifying some object just created. Beyond that I tend to try a two pass method like create all the objects I need in one event then in a second event pick things again. The wait 0 can work but it makes it harder for me since I often require things to be done in a certain order.

    At one brief point the new objects were added to the object list once created. However that was changed to fix cases where infinite loops were being caused with some events. It’s an interesting design process to try to come up with a different way to handle the picking in a robust reliable way, but I know I haven’t come up with anything I’ve liked. Overall I’ve found the event system to be more complex and nuanced over time so I try to use a simple subset of it that I know the precise behavior of.

  • The why has to do with when new objects are pickable. Basically new objects aren’t added to the list of objects till an event ends and the next event is a top level event. A top level event just means it’s not a sub event of another event, but it can be in a group. Search for “top level event” for other attempts to describe this behavior.

    Wait 0 will delay things being run till the end of the event sheet so the new objects will be added to the object list by then.

    Now pick by uid is a special case. If you created an object you can pick it at any point.

  • Look at the “relative to” parameter of most actions. If you use “camera” you can position relative to the camera pretty easy.

  • You can use the angle() expression for that.

    angle(0,0,xaxis,yaxis)

  • Hmmm…

  • You don’t need the json object. You just need a text variable. The process looks basically like this:

    1. Pick old instance of a sprite and set the text variable to sprite.asJson.

    2. Then create a new sprite, and load it from json with the set from json action.

    text var old=“”
    Pick sprite
    — set old to sprite.asjson
    — create sprite at (0,0)
    — sprite: load from json old
R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound