R0J0hound's Forum Posts

  • The rough logic is to keep track of what block the player is standing on, then when that block is moved you’d move the player the same amount.

    As a simple rough example in 2d you could do this:

    Player overlaps platform at offset 0,1
    — set platform.x to platform.x+1
    — set player.x to player.x+1

    There are probably more precise ways to get what the player is standing on. That and you can move the platforms in more deluxe ways. For that you may just want to keep track of the offset the player is from the platform.

  • You either set it up to only create the sprites if the space is free or remove the duplicates after.

    One way is to use an array to keep track of occupied spaces.

    start of layout
    — set array size to 1000,1000,1
    — for each island
    — — array set at island.x/16, island.y/16 to 1
    — for each island
    — — array at island.x/16+1, island.y/16 = 0
    — — — create wall at island.x+16, island.y
    — — — set array at wall.x/16, wall.y/16 to 1
    … same for other directions

    You could also use a tile map instead of the sprites for similar results. Probably could end up simpler.

    Another idea is to clean up the duplicates after.

    start of layout
    For each island
    — create wall at island.x+16, island.y
    — …other directions
    
    Start of layout
    Wall overlaps island
    — destroy wall
    
    Start of layout
    Repeat wall.count times
    Wall: x=wall(loopindex).x
    Wall: y=wall(loopindex).y
    Repeat wall.pickedCount-1 times
    Pick random wall instance
    — destroy wall
    

    At least those are two methods. Another could be to store xy pairs of created walls in a dictionary and check if a location is listed before creating.

  • oraflame

    Glad it helped.

    sarierdnc

    Best to create a new topic. Generally I’m unavailable but when I am I’d just skim all the posts and reply to those that interest me, I have time for and I actually can solve. That said there are many other talented people on here that like to help out too. So a new topic is your best bet.

  • X=100*cos(ang)

    Y=100*sin(ang)

    For any angle.

  • There’s a newer version of this floating around but it must be on another topic.

    Anyways to decide what face is on rope you can do a dot product with all the face normals and the one that’s the most positive is on top.

    Typically you’d calculate the normal using three vertices from each face and doing a cross product. However since it’s a cube you can get the normal from just two vertices: one one the face and one on the opposite side of the cube.

    The strategy I’d go with is make a list of those two vertices for each face and put them in an array sized 6,4,1.

    At(I, 1) would be the first vertex, at(I,2) would be the second. For bookkeeping you’d set at(I,3) to the face value. You’d set at(I,0) to the dot product of each pair to the ground normal. Roughly:

    Dot= (v2-v1) dot vec(0,0,1)

    Then you’d sort the array and the first index will be the top face.

    That’s the general idea at least. It’s just busy work to work that out. Another idea would be to calculate the orientation and work out a formula to spit out the top face.

  • I mean you can do what you did there, screenshot the layout. You could then crop it to the layout area and scale it to what you have as the layout size in the image editor.

    An event way to possibly do it to set the canvas size to be the same as the layout size and use the snapshot canvas action to get an image. There may be some finickiness to deal with such as waiting a tick for things to update before snapshotting. You may also need to turn off full screen scaling. There may be other issues but i'm not sure. I've had issues in the past of capturing everything that way.

    Another way to snapshot the canvas one screen at a time, and then piece them together later.

    Either way you may end up with a rather large image which will be slower to download and take up more vram. It doesn't mean you can't do it but generally most games have reusable images that they place all over the level for decorations.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's one way to do it:

    dropbox.com/s/2j144iheff6rrde/lines_between_sprites.capx

    The only finicky bit is having to use pick all before being able to pick a different instance.

    Here's a variation that uses two instance variables which is a bit cleaner imo.

    dropbox.com/s/5w5xwxi1nnvgm8g/lines_between_sprites2.capx

  • You have to set the texture from a sprite every tick, or at least every time the frame changes. Otherwise it will remain on the last texture used.

  • Hi,

    No bother at all to ask questions.

    Best I recall I made it work with 640x480, so it should work with any size with the same aspect ratio. Anything else would stretch I suppose. I didn’t test with the other scaling modes so I probably didn’t account for some nuances with how they work. I don’t think there is a solution apart from modifying the plug-in. Unfortunately I’ve been prioritizing my time elsewhere as of late. So examples or plug-in modifications will be rarer, but I can still answer questions as those don’t require me to actually be at a computer.

  • One approach to see if a structure is on the ground is to start by marking the blocks touching the ground, then mark the blocks touching those, and so on. In the end you will then know which blocks are supported from the ground or not. It’s kind of like a flood fill. Search for posts by me I think I made a digging example that made unsupported blocks crumble.

    Making those objects not supported be movable is then an easy solution to have things crumble. To have them fall in chunks of connected blocks is harder. You can do more flood fills to find all the individual chunks or blocks as a first step. But the second step of connecting them together with physics isn’t really possible with the physics behavior. Best you can do is with joints but that can’t make the shapes rigid.

    To have rigid shapes the only option I can think of is to not use the physics behavior and either roll your own solution or attempt using a JavaScript library to do the physics I suppose.

  • Official support is harder as it kind of needs to work with everything else in Construct.

    Unofficial support, such as most of my examples need only to work with a small set of construct features. The limit of not being able to rotate 3dshapes on other axis's is solved with distort meshes and math, or in the plugin api draw 3d quad function, like the third party 3dobject plugin. My examples implement simplified 3d physics with events and since I'm cramming them within the free limits often take shortcuts.

    If you use javascript you could just utilize a 3d physics library. Just setup the scene with javascript and when you run the simulation you'd update the distort mesh points every frame.

    If someone chose to do that from a plugin they could likely hide much of the complexity from the user. Maybe call it dynamic3dshape. It would use some 3d physics library behind the scenes and you'd be able to set orientation and velocity of the objects and if it's static or dynamic. Bonus if it can interact with the standard 3d shape for collisions, or you could just have it interact with only dynamic3dshapes to be simpler to implement.

    In no way would official support be needed. It just takes someone interested enough to do it.

  • That sprite overlayed over the screen to simulate a flashlight is probably the simplest way.

    With the C3 engine we are pretty limited with what we can do with 3d lighting.

    Hard shadows can be possible as shown by this test. But it may not scale well with more objects.

    construct.net/en/forum/construct-3/general-discussion-7/possible-add-3d-light-172761

    Even with JavaScript there isn’t much you can do to make 3d lighting with c3’s renderer. What was done with most of the 3d stuff in C2 is another engine and renderer separate from construct was stacked on top or underneath your game. That’s what q3d did. Another option was to use constructs renderer in a way it wasn’t intended to be more integrated with the game. Rojo3d did that in c2. In c3 that is much harder, and even if a way is found to do it c3 is constantly getting updates which would require constant updates to keep the solution working.

  • It looks like it should be working. I’m out of ideas with the information provided. I probably am missing something. I’ll defer to whoever else has ideas.

  • You didn’t show the event that adds to bodycount. The rest is unrelated.

    The event should look like this:

    Badguy: hp < 0
    For each badguy
    — destroy badguy
    — add 1 to bodycount

    Without the “for each” there could be cases where more than one bad guy has hp less than 0, but only 1 is added.

    I guess you could do this instead which would also work:

    Badguy: hp < 0
    — destroy badguy
    — add badguy.pickedcount to bodycount
  • There likely can be differences with this and other plugins. The z direction could be positive in the other way. With this you can set the angle with (x,y,z) Euler angles. Other plugins could rotate in a different order like zyx. You can do that with multiple actions

    Set angle to (0,0,z)

    Rotate by (0,y,0)

    Rotate by (x,0,0)

    And like I said before to get the angle it gives it in a 3x3 matrix. You can either convert that with a formula you can find online or you can save the Euler angles to variables.

    The solution you’re after is probably some combination of the above. I’m not going to attempt a solution as this plug-in is mostly self contained and I only made sure it works with a minimal set of other construct features.