R0J0hound's Forum Posts

  • I mostly have no idea what you’re doing. All I can guess is the object is being clipped by the near plane of the camera when you place an object near the camera. The logical solution is to just move the camera back or the objects further from the camera. You can also mess with where the near plane is when setting up the camera but that probably isn’t what you should mess with.

  • Simplest way would be to use browser.execjs() on that text string. You can access variables with the scripting api but it’s simpler to just provide the values manually.

    Here is an example. It runs the code as as JavaScript and the globals a and b are prepended to that. It’s simple to add more.

    text var result=""
    text var js=""
    text var code="a== 42"
    
    // globals
    number var a=42
    number var b=33
    
    on click
    -- set js to ""
    -- add "let a="&a&";" to js
    -- add "let b="&b&";" to js
    -- add code to js
    -- set result to browser.execjs(js)

    You could do something clever to have it automatically retrieve the variable values. There are also other ways to parse it.

    The pros of doing it this way are you don’t have to deal with any parsing and you can run any JavaScript. The cons are you don’t have a way to really deal with errors and you can run any JavaScript which can be considered a vulnerability to your game.

  • You have the right idea. To bounce you’d need the angle between where the objects hit. But that can be simplified to just the angle from one object to another. Then you can do the bounce in two ways. One is to use the angle of motion and the other is to use xy velocities.

    The angle of motion way.

    Var n=0
    A collides with B
    — set n to angle(a.x,a.y,b.x,b.y)
    — a: set angle of motion to 2*(n+90)-self.angleofmotion
    y)
    — b: set angle of motion to 2*(n+90)-self.angleofmotion

    I’m short on time to write the xy way. But it is expandable to handle differing masses.

    However the one snag in all this is the pathfinding behavior. Does it even let you change the velocity? It mostly just moves along the found path and doesn’t really handle deviations from that path.

    Maybe have do the enemies with two objects. One with pathfinding and the other with physics that gets a force applied to move toward the pathfinding object. Maybe stop the pathfinding object when it’s too far from the pathfinder so it can catch up

  • Well backup your project first before trying any of this.

    If you open the c3p file with a zip program and open the .proj file has the version that you can change to make it so you can possibly open it up in an older version of c3. If you didn’t change your project since then you can see what version you used then. Chances are high it won’t work though if your project uses any new features.

    The second part is opening up an older version of c3. You can specify the version in the url. You’ll need to try out the various versions to see when the c2runtime option was removed or search the release notes.

  • There is a point where a tricky workaround isn’t worth it. 3d vr would require rendering once per eye I’d guess and after that is more required to get it to a headset? No idea. Web browsers have limited capabilities but you can research what’s possible with js since construct doesn’t tout vr as a feature.

    Construct just sounds like it would get in the way if all you want to do is relay input and receive output from another program that interacts with the vr headset. But if this is really something you want to try I’d say go for it. You’ll find the feasibility of it as you go.

  • You’ll have to go back like 50 versions or so. The c2 runtime was removed as an option in later c3 versions.

  • What tools would you need? The only thing I can think of is maybe an isometric version of the tilemap object. Otherwise you can use a grid to pace sprites.

    A lot of the motion behaviors can be used well enough from an isometric view. For motion more aligned to the iso view you can utilize a bit of math.

    For the visual sorting it can be simple is all objects are the same size and cubes. For other shapes it gets more complicated and can yield unsortable cases.

    I think overall any engine that can draw images can do isometric.

  • 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&")")

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.