Santhenar's Forum Posts

  • R0J0hound

    Worked a charm!

  • R0J0hound

    Thanks!

    Sounds like a plan!

  • I have a condition which is

    Sprite width < 5

    Destroy sprite.

    (Wanted a screenshot, but imgur is down)

    Surely this should only destroy sprites whose width is less than 5 pixels, but when the width of one sprite drops below 5, it destroys 80% of the sprites.

    Here's a capx if you like:

    dropbox.com/s

    vc3geyox3dqpmt0/line3.capx?dl=0

  • It's not the tidiest capx in the world...

    dropbox.com/s

    duti0pbjm8j7k1j/lines2.capx?dl=0

    Click mouse to create paths

  • I found a different way of doing it

    Thanks for your help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Okay I think I'm beginning to see what some of the problems are here.

    It works when there is only 1 sprite in existence, but when more are added it starts to break down.

    This is because when it is calculating distances or toggling variables it is doing it for all instances instead of one at a time.

    So IF sprite distance < 10, toggle boolean to true.

    When ANY sprite is close to a node it sets the boolean for ALL sprites.

    I suppose because the distance check is running as a system action, but it doesn't seem possible to run a distance check as an object action... Is it?

  • jojoe

    Point taken <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy" />

    Hope this works.

    dropbox.com/s/i6qi9gwhq3ro1 ... .capx?dl=0

    Arrghhh not enough rep!

    dropbox.com

    s/i6qi9gwhq3ro111/

    lines.capx?dl=0

  • This is really messed up...

    System - distance(Sprite.X,Sprite.Y,Sprite.PathX,Sprite.PathY) < 10

    set sprite.x to pathX

    set sprite.y to pathY

    When the less than value is set to 10, the object never teleports.

    However, when the less than value is set to 5, it does.

    How does that make any goddamn sense at all?

  • Thanks guys!

    Using int(sprite.x) makes it work about 80% of the time.

    But that reduces as soon as I increase the speed above 1px.

    I did already try and put in a function which would calculate the distance between the object and the finishing point and teleport it if it got close enough, but it's pretty ropey.

    It goes

    System - distance(Sprite.X,Sprite.Y,Sprite.PathX,Sprite.PathY) < 10

    set sprite.x to pathX

    set sprite.y to pathY

    But it it always triggers regardless of distance. Not sure what's going on there.

    I'm afraid a capx probably won't help, it's quite messy at the moment

  • Hi,

    I have a very simply trigger which I do not know why it is not firing.

    My object has 2 variables: PathX and PathY. The object moves towards these coordinates at the rate of 1 pixel (for testing)

    When it arrives it should trigger an event.

    The conditions are:

    PathX = Sprite.X

    PathY = Sprite.Y

    Yet the event does not trigger.

    If I replace these conditions with OnKeyPressed, it works fine, so it's not a problem with the event. I'm really baffled and it must be something simple I am doing wrong.

  • Alright!

    It's still a bit weird but seems to be working to some degree.

    To help anyone else out: It only works in the following order:

    System - Pick All

    Object - Pick instances where not equal to UID

    Object - Pick nearest

    Now that I read it that makes sense. Thanks!

  • Okay, how can I explain this...

    I have a sprite object called Critter.

    I want critters to do things (run away) if they get too close to each other.

    In order to do this I want to use...

    For Each Critter

    Get Nearest Other Critter

    Get Distance Between the two

    If Distance is Less than 500

    Run Away Function

    The problem is all critters are instances of the same object, which means... I don't really know what it means but it's fucked up.

    Pick nearest without picking yourself just... Doesn't seem to work.

    This is what I've got...

    I'm testing to see if I can just get a critter to move towards the closest other critter.

    With this code, the movement actions just don't run.

    I understand if further clarification is required.

  • Okay, so here's what I'd like - For all my sprites to show as black silhouettes, until they interact with a light mask.

    So I have a sprite representing the light, when that is over another sprite, the sprite shows it's colours normally. When it is not over the sprite, the sprite is a black silhouette.

    It's a lightmask, basically.

    I've been playing about with blending for a few hours now and I can't seem to find what I'm looking for. I thought I found it for a moment and then... lost it?

    Wonder if anyone else has found anything like this?

  • I really do love the dust particles in the light effect.

    I've been trying to do something similar myself, but I just can't get this destination out setting to do what I want.

    How exactly does the transparent tiled layer need to be set up to get rid of the boxes appearing around my particle sprites?