Any ideas on cell (organism) movement?

So due to a multitude of reasons the cells spawn as individual objects, however they are appointed an id at birth. Any ideas on how to give movement to all cells of a specific id?

2 Likes

how did you assign an id? I can’t find the code for that

1 Like

Inside the stem cells objects it chooses a random number (which it then inputs into a number list to prevent repeats which would cause problems in the future) and applys it as the starting value of the cells that make up its body.

Depends on how you want them to move.

Let’s say, it would move straight for 1 second before changing direction.

Have a Random behavior get a number between 1 and 4, then put the result through 4 Filters. If it is equal to 1 go up, 2 go right, etc. Then have it start a timer for 1 second to roll the Random behavior again. To stop it from going in the same direction twice have the Filter go into a Switch that will turn itself off, but will turn another Switch on. If that Switch receives an input it will tell the Random behavior get a new number. When another Switch gets an input it will turn that second Switch off and the first on back on. This means that every direction would need 1 Filter, 2 switches, 1 timer, 1 Number behavior for the speed of the cell, and 1 behavior to move the cell (can be Velocity, Speed, Position, what ever works best for you). You will also need 1 Once behavior to start off the Random behavior.

You can also make the Random behavior 1-8 and have 8 filters if you want to add diagonals. For the diagonals it would be the same except you would have 2 behaviors to move the cell (one for the X movement, and one for the Y movement). I you have any questions I’ll be happy to answer them.

I know, my problem is having only the cells with a certain id move

If the IDs are randomly generated how would you know which one will move?

If it’s in a Object ID behavior use an extractor to see what the ID is. Otherwise you could just use a Filter if you want to see if it’s above/below a specific amount. I need more info of the code to help.

Each stem cell has an id which it passes on to all of its cells as the starting value. when a leg cells wants to move it would send its id to all cells and the ones with the same idea will move. my problem is that im having trouble deciding the direction it should move in after this is done.

wdym? Is this a different question now? It seems that you figured out how to make them move, are you just asking how you want them to move (how they look when they move)? If it’s not and you’re saying you are having trouble with making them move I can help with that (and my first statement, but I need more info on how you want it to look). The first thing you can do is what I said in my earlier reply, but if you wanted them to all move in the same direction I would send a message to itself when it gets input to move a specific way, then have it turn off all the other ways it can move and resend an input to the same direction as before (If it was already going this way have a switch turn the input to the message off). Then have a timer reset all of this once it finishes its movement. If this is confusing all explain it better when I have a chance, but before I try to figure out more I want to know if this is what you’re looking for.