faggatron's Forum Posts

  • We are not monkeys => evolution is false

    We can't explain everything => god exists

    WRONG

  • last time I tried to use it, flip horizontal didn't work

  • You live in Brighton? so do I.

    Well until the 30th when I'm going back to uni in Bristol and moving into my own new house heh.

  • In fact, I don't think you need a loop at all

    give the sprites another value called something like 'Team'

    Add another parameter (after the other one) to each of the functions, and set it to 'Team'

    Then make the functions:

    On function

    +sprite value 'Team'=Function.Param(2)

    +sprite value 'Follow'<Function.Param(1)

    +pick with highest value 'Follow'

    That should work, then only the ones in their own team will follow eachother, and they'll follow the next highest value

    so if red team 3,6,8,9 and blue team 1,2,4,5,7,.

    9 follows 8 follows 6 follows 3 which doesn't follow anything (so you'd set it to)

    7 follows 5 etc

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • in that cap, in the "on function" events, the second condition says:

    "Sprite value 'Follow' = Function.Param(1)-1"

    that -1 at the end is what you'd be changing in the loop, it corresponds to how many in front it wants to follow, this is the condition which picks the object it's meant to be following, so you'd check the one with follow=Function.Param(1)-1, if that's not in the group go onto Function.Param(1)-2 etc

  • You could try having another value on each object which designates their team, then when it's looking for the next object, have it call a loop which checks to see if the next follow value is in this team, if its not move on to the next one after that, then once it's found one stop the loop and send that's x and y back to the original object.

    Just don't have about 100 guys or it will probably start to lag with all the nested looping.

  • http://www.quotecats.com/what/congaline2.cap

    Surely if one dies thats exactly what you want it to do, remove it from the line so it doesn't get referenced. You can still have multiple groups.

  • yeah basically you can do whatever you want with the movement, all the function stuff does is find out the X and Y of the next one in the line, ('GotoX' and 'GotoY' in that example) so you can move towards that however you like.

    I can't be bothered to make a whole engine heh, but this just demonstrates how to retrieve information from another specific instance of the same object.

    I have to admit it's not ideal when you need things like on collision between Sprite and Sprite, and you have to call about 4 functions, gets a bit confusing, I'm sure its possible though.

  • I don't understand what you want to do exactly.

    If you set one of their positions somewhere, the ones behind it should follow it. You can also add to the for each object loop something that makes it ignore the one you want to move, if you need to.

    If you want one of the objects to leave the line on it's own (or be destroyed), I guess you can set it's value to -1 or whatever then either set all the values behind it to one less than their value.

    Or you could just make the one behind it temporarily always set gotox and gotoy of the one 2 ahead of it (using the same functions, with the parameter as what it was -1) then when it rejoins the line, stop that event somehow and it would go back to its original position in the line, though this wouldn't really work when destroying it.

  • use " instead of '

  • That's nice.

    I do have some nested loops for minimising an expression, these could well be the cause of the lag. Seems like a decent time to request the "pick by highest/lowest expression" I've requested a couple of times to fix this really nicely.

    EDIT: now fps is ~80 at the start (hell of a lot better than 30) when I disable this event it jumps up another 20ish, clearly an extremely inefficient way of doing it, pick highest/lowest would be really nice.

    Adding pick by distance<2000 to every for each enemy loop seems to have worked. Thanks a lot that was a huge help.

  • Thanks Ashley that's helpful, I'll attempt to hunt down any nested loops, (hopefully they're not necessary). I did try to do the LOS events like you said, even putting them in subevents to make sure.

    I guess what I was suggesting isn't all that useful if it's just my poor coding, if it can be done through events.

    One more thing, are pick by comparison events as processor consuming as for each object loops? (if they loop through each object checking the expression) because I may have those and for each object loops nested together.

  • nice, (I didn't actually try it)

    It's obviously not necessary, but I wouldn't rule it out entirely, just if you can be arsed add it ages after 1.0 and after the vector object, just as an ease of use thing.

  • I really don't like using detectors, *ahem*.

    If you want to pick objects that are under a certain distance from something:

    pick OBJECT1 by comparison: Distance(.x,.y,OBJECT2.x,OBJECT2.y) < Z

    should work.

    If you want line of sight, there is a line of sight behaviour which is pretty much self explanatory.

  • it's a hell of a lot quicker to have:

    canvas object -> paste circle radius r at (x,y)

    than to make a circle vector object and set it up loads and then paste it into it, especially if you've got to set up an erase blend on a new layer with that thing that makes erase work ticked.