R0J0hound's Recent Forum Activity

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

    uc2b9f955182cb5b8840813a40b1.dl.dropboxusercontent.com/cd/0/get/Ch6AH8HZmucTNitaUPUESye-Cn4QC_yn1Dg0Y1Nikjtrdub5EQ9UxLFFEUtt60jUPUreSrYjyoHA0aeBqpIEyLEQ-qK62fqxbwz3vmNANZL2tgectql8EJPPs5ipuGD1bPA/file

    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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I’m on my phone but I may have one idea. Could be vastly different to your project, idk.

    So I’m guessing you have something like this currently:

    Set marker position to minimap.x + enemy.x/32, minimap.y + enemy.y/32

    If the minimap is 1/32 scale

    Relative, just mean subtract the players position from the enemy position.

    Set marker position to minimap.x +(enemy.x-player.x)/32, minimap.y + (enemy.y-player.y)/32

  • There’s this older topic with some ideas. The ones I did I’ve never been super happy with:

    construct.net/en/forum/construct-2/how-do-i-18/creating-top-down-car-traffic-127583

    Best I can tell it involves solving a lot of little problems that together can give the result you’re after.

    * making car follow road. Obeying traffic rules.

    *avoid collisions with obstacles.

    *avoid collisions with other moving cars.

    Pathfinding is too much for this, and it can’t handle moving obsticles. It’s enough to only look ahead a short time in the future. Basically calculate where the cars will be like 10 frames in the future if the stay in the direction they are going, and if they collide then brake or steer now to avoid collision. Seems there are a lot of options here, you could do something arbitrary or come up with something more sophisticated to choose what to do.

    Probably you’d add some events for the cars ai so it can break some of the rules depending on the situation. On example is the pursuing vehicle, it would want to crash into the player car, and maybe wouldn’t mind hiring other cars or walls to do it.

    Speaking of collisions, you’d probably want to use physics instead of the car behavior in this case. The solid behavior isn’t up to snuff for collisions.

    For the Sunday drivers following the road, you can probably just have it decide where to drive as it goes. Mostly just knowing what road section it’s on and what intersection is coming up.

    Out of ordinary stuff would be good to handle too. Like it the car is knocked off the road it may need to backup or whatnot to get back on the road. Or maybe it could need to navigate around cars blocking the road or make excessive maneuvers to avoid reckless drivers. There’s probably a lot of extra finesse you could add.

    Kind of complex overall I think.

    A simplification would be to just think of each car individually responding to its sensors of what’s around it. Could give some interesting divergent behavior.

  • I guess I’ll point out that you didn’t provide enough information. What did you do exactly to get that result.

    Anyways, the issue you’re having probably isn’t because of the math, it’s because the number is rounded a bit when it’s displayed as text. If you manually convert a number to text with str() then it doesn’t do any rounding.

  • Construct only deals with numbers and text. You’ll have to do it via JavaScript. You could make it into a plugin later if you like.

    Anyways it’s a straight JavaScript problem. Roughly you do this.

    1. Create a image

    2. Set the source to the data url.

    3. When it loads, create a canvas, and draw the image to it.

    4. The canvas then has a function to get the image data array.

    I don’t know any of the syntax exactly offhand but it’s something you can find online.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 156 followers

Connect with R0J0hound