R0J0hound's Recent Forum Activity

  • It's always been fuzzy to me, so I had a look at the runtime source in C2. C3 is probably very similar, since if they changed it it would be a breaking change.

    It seems that the it picks the default instance by going through the layouts in order they are in the project, and then the layers in order and the instance with the lowest uid becomes the default.

    I didn't look too much further but another thing to test is the order of the layers. Are they defined by their order in the editor or the order they were added? I'm guessing just their order. I have no idea if global layers mess things up. I think the layout order is the most useful thing to know.

    Anyways, from that it seems that a nice strategy to control default instances is to create a new layout and add one instance of each object. Then drag that layout to the top of the layout list. Be sure to set the initial layout in the project properties.

    Thanks for the interesting question, it revealed something useful I didn't know before.

  • nelostic

    There are two things:

    collision groups. When two instances are in the same group they won't collide. It's just a number.

    Collision layers. It's a series of 1's and 0's, one for each 32 layers. Two objects will only collide if they share a one in the same position.

    the Mnk

    It adds collision filtering, and a lot more joints as well as other improvements, as well as various differences.

  • TeamOne

    Naw, just here.

  • You mean like the platform behavior just with events instead?

    It's basically called parabolic motion, and you could use the bullet behavior with gravity if you wanted.

    Anyways to do it with just events you'd add two instance variables to the sprite : (vx and vy). Those would be the horizontal and vertical velocities. Then the event would be:

    every tick
    -- sprite: add 100*dt to vy
    -- sprite: set position to self.x+self.vy*dt, self.y+self.vy*dt

    I can't really think of a application of lerp or clamp with just that.

    You could clamp the vertical velocity so that it doesn't fall too fast?

    set vy to clamp(vy, -100, 100)

    I may have bungled the order of the parameters though.

    You could limit the y position for some kind of ground too:

    set y to min(self.y, 400)

  • Try Construct 3

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

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

    I don't use C3 but I don't think this is currently possible without a custom physics plugin. Same can be said for C2 I'm pretty sure.

    OhhBaby

    I thought I replied to this. Any feature you had a question about? The examples were all over the place and I'd rather not dig them up.

    nelostic

    Pretty much you'd just add the behavior to two objects and at the start of layout use one of the add joint actions. It asked you to specify the uid of the other object and you'd then mess around with the other parameters.

    TeamOne

    Any motion would probably be done on a top view. I hear many find the pathfinding behavior useful for ai.

    You'd then hide the top view and place the objects in a way to match the effect.

    I've abandoned the effect though. I found it too tedious to use. The math to position objects is basically taking what the effect does and reversing the math.

  • nelostic

    The behavior lets you utilize joints and collision filtering. Those would be used as the building blocks to make the more complex examples you listed. I have no pointers at the moment but it's just the kind of thing you'd just figure out to do as you go.

  • You needn’t look for offense where none was meant. I was merely mentioning that I ended up having to use local host independent of Construct. So my thought is that construct probably uses it for similar reasons.

  • It’s loading images and sounds.

    I’ve written html5 projects from scratch and there are things the browser won’t let you do when just opening your html file in the browser when on your computer.

    Basically it didn’t want to load my sounds and the console gave an error.

    Basically the solution is to create a local host and run the html file though that. It’s a one liner with python. Then the files were able to load.

  • You’d have to do it manually. Ideally there are expressions to get the position and such I’d the joints. Or if not you could save the values when you add the joints.

    Then you’d just position sprites or use a drawing plugin to place lines and stuff

  • The capx is working here. I don't know what's amiss.

    Here's basically the events. It's like my previous post, and it does what you're describing. The minimap is centered on the player and is scaled down from the level size. It creates markers from everything, but if you only want the buildings close, you can add another condition to the for each loops like:

    distance(building.x, building.y, player.x, player.y) > 200

    every tick
    -- destroy playerMarker
    -- destroy EnemyMarker
    -- destroy BuildingMarker
    -- create playerMarker at minimap.x, minimap.y
    -- playerMarker: set size to player.width/10, player.height/10
    -- playerMarker: set angle to player.angle
    
    
    for each building
    -- create buildingMarker at minimap.x +(building.x-player.x)/10, minimap.y + (building.y-player.y)/10
    -- buildingMarker: set size to building.width/10, building.height/10
    -- buildingMarker: set angle to building.angle
    
    for each enemy
    -- create enemyMarker at minimap.x +(enemy.x-player.x)/10, minimap.y + (enemy.y-player.y)/10
    -- enemyMarker: set size to enemy.width/10, enemy.height/10
    -- enemyMarker: set angle to enemy.angle
  • The idea I gave should still work. No need to use lerp, and it will automatically center the minimap on the player. This example just maps everything but you can add a distance check before adding things to the map.

    dropbox.com/s/zdtztrfrl4q7p1x/car_streets_minimap.capx

    I also was messing around with some traffic. No behaviors, and a manually laid out road map. Works decently, although the ai seems to have some road rage issues. They seem to like to tailgate, and slow down when someone is behind them, not to mention all the collisions. I was attempting for some more orderly stuff.

    Maybe useful for some ideas.

  • With what you’re saying about prefabs I’d say objects can be kind of thought like that. Just create multiple instances of the same object, and you’ll only ever need one set of events.

    Personally I tend to use as few object types as possible so I don’t have duplicate events if I can help it.

    I’d reccomend reading about picking in the manual. It makes a lot of things fairly easy.

    There are aspects where picking isn’t ideal, such as when created instances can be picked, or wanting to pick two separate instances indavidually, but there are strategies for that.

    Also generally you don’t need to use a list of data. Placing instances and tweaking their variables is the normal way to go about it in construct.

    I guess it depends on what you want to do.