objects interacting with object

This forum is currently in read-only mode.
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • I don't understand what you want to do exactly.

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

  • Thanks for the help, the death thing would work. problem is I want to separate the group into an irregular sequence, such as red team 3,6,8,9 and blue team 1,2,4,5,7,.

    The ideal solution would be to tell the unit to pick the next highest number in his team, and fallow him. Just have no idea how to tell him to do that(if it�s even possible)

    i might try making a different object to represent each team. mabie an array of some kind.

    If you had ever played cannon fodder it�d be easier to explain. But it was kind of an unknown game.

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

  • that would probably work. but how do i get it to move onto the next?

  • 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

  • so i,d make a variable to represent the -1,-2,-3 ext. such as if Function.Param(1)-variable(dog) = 0 add 1 to variable (dog).

    or is there an expressions that dose that?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

  • Yay faggatron ! your a genius!

    wow.... that sounds pretty messed up....

    I'm not being sarcastic. seriously thanks. was really racking my brain on that one.

  • If you need to select two objects that are of the same family type in such a manner that you can apply an action to one object and a different action to the other, one work around is to use families because they have separate Selected Object Lists.

    This example you click an object, it turns white, and all the objects overlapping the object you clicked turn green, and all the objects that are overlapping green become blue..and its all done with one action

  • thats cool.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)