part12studios's Forum Posts

  • that did it! i thought my condition would work, but i can see how your approach is more active.. i thought it was constantly checking when i would use the kind of comparison i did.

    Thanks!

    Caleb

  • hey there, sorry got caught up with some other stuff.. so no problem, yes i think overall i have it based on the examples i worked with and i've managed i believe to strip it down as easy as possible.. but yea this behavior baffles me but of course it's probably something simple, i just don't see why it would do what it does.. with my limited understanding of the multi touch system. here's the cp3

    dropbox.com/s/2rjhj4x7q9jnnaw/sf_hand_orientation.c3p

  • just making sure. you did test with a touch device right? put fingers down on both sides? see what goes wrong? the orientation of the hands are good if you only touch one side or the other.. but if you touch one down (keeping on screen) and then the other one.. the orientation of the 2nd one is off.

  • yes but not "drawing.. i just want a single object (hand) in this case be locked to one box while a second hand is locked within the range of the other.

    The game i did (cyball) was more like a paint function.. i adapted the example from that project to this.. technically i'm "painting" hands but destroying them because i was having trouble figuring out how to draw and pin a single object with the same core logic..

    there is a "left hand" and a "right hand" graphic so the hands differ on the left and right because i'm just flipping to the "red" or "blue" animation..

    but notice how it behaves if you touch on one side.. and then the other side.. the 2nd touched hand gets confused and defaults to the first hands orientation point.. but doesn't do this when it's just one or the other hand.

  • been mulling over this one for a week or so.. just can't seem to crack it.

  • Hey everyone, so I got some amazing help in the past with a project i did that required multi touch and it's worked well with a new project (after some hacking)

    However try this on a touch device and you'll see what i have going on:

    part12studios.com/games/SoapyFun/sf_22

    I still struggle with what's going on sometimes with multi touch. i get it and yet things happen so fast and because it's not possible (that i know of) to simulate true multi touch on a PC/Mac without a touch surface so i have to publis to web and test on phone.. not a terrible workflow but still slower.

    I just want each hand to be it's own unique hand and be oriented to each respective corner (eventually the art will better reflect a full arm, not just a floating hand.. but i can't get that to look right till i get the basic orientation.

    the logic i have right now is using animation name (blue and red) to be what say "if this hand is x animation, point to y coordinate".. it works fine with one hand or the other.. but once one or the other spawns, it seems like something is overriding it. making the 2nd object that spawns to have the same animation name as the other.

    I did a previous attempt to completely create two separate touch objects / hands completely restricting one to be unique from the other but there was still some weird crossover going on that i can't explain.

  • i found the solution was to close the browser and reopen it. i had a lot of tabs opened and didn't want too have to close them all out but after a few minutes opted to try it.

    I can say i think what broke it and possibly lead to this issue if anyone at Scirra sees this. I loaded an extrememly lard (15,000 x 25000) pixel png as a replacement for an existing graphic (i didn't realize how massive this was before loading it) and after that it seemed like layout got broken.

  • Not I get why this is happening. i'm on windows with chrome. everything worked fine before today. using latest beta build.

    Thanks,

    Claeb

  • this is awesome! super helpful. i need to spend some time examining it but definitely spot on!

  • I have a pretty good grasp of the turret behavior and it's working well but each of them are doing full 360 degree targeting and i'd like to limit it to say.. 180 degrees or even narrower ranges.. otherwise still just trying to target whatever is within range AND within a certain degree of rotation range.

    Maybe there is some way to determine the angle of difference between two objects? and i'd need to compare something like:

    1. is the object an enemy?

    2. if it is an enemy is it in range?

    3. if it is in range, is it within the angle of attack based on the current turret in question

    4. if it is, then fire..

    My close to successful approach was simply to compare the X of the turret with the X of the enemy.. this worked fine with a single target, but things got weird when I had to then compare multiple enemies. I made a family called "Enemy" and compared the X of that enemy class and it works pretty well even with multiple targets but i hit some snags where it still didn't perfectly right..

    I wanted to try and use families because it seemed like the better way to handle many enemies rather than making a bunch of unique unit objects with their own variables, etc..

  • Ok really it wasn't even the clamp.. margin stuff was good though.. but ultimately linear dampening was the key to getting things to calm down when they get closer..

    dropbox.com/s/dgqz048gxv5jn8u/physics%20question%203.JPG

  • ok linear dampening seems to be helping. but i'm going to see how it goes with moving to an X and Y position, but i get it now.. friction is probably how items rub against each other on their sides.. not it slid on a surface.. that makes sense because this is a 2d game engine..

  • maybe someone knows an elegant way to some how measure an objects velocity (has to factor in X and Y, which tends to get me tripped up) as it gets closer and to introduce a smaller counter impulse? I'm going to try some stuff but basically it seems that the impulses are great moving to the right destination but nothing is slowing it down.. i just don't understand why i can't seem to get any friction.. no matter what i set my car's friction too it still seems to just glide.. i have world gravity set to 0 for now (since it's top down).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • it's still doing the same basic thing.. i have an audio clip to let me know when the impulse is firing off.. but i can hear that the tolerance is still working as the sound turns off while in the acceptable range so it's working. this is what it looks like:

    dropbox.com/s/tvivt775zi17x2d/physics%20question%202.JPG

    NOTE: for some reason i can't upload a picture today so i'm using dropbox.

    It still does the same back and forth never getting closer to the target. there has to be some way to reduce the impulse value drastically faster than a steady downward slow (which is what you get when you simply apply an impulse value based on distance difference)

    the "tollernace" var is just a value set to i think 25 right now.. mostly just so i could hear the pause in audio triggering.. but it doesn't make any noticable difference if i change it to a tighter value like 5.. but also it actually has no effect if i make it 100 either..

    I've noticed also that friction doesn't seem make any difference either.. which is odd. i'd have thought friction would fight impulse.. or at least hinder it's effectiveness.

  • Ok i see what you're saying now about margins i think. i'll give it a try and see how it goes! Looks promising!