A question for JackBQuick or anyone else who can figure this out.
LordTarantor
Member, PRO Posts: 890
Hi everybody:
I ask for Jack because every time I have a question he comes up with a demo for it. He is like a demo librarian...
But for everybody else please feel free to help.
I have some victims actors that are supposed to run away from the predator and they do. At the beginning there is only one predator. Then I add more predators but the victims stop running away from the original predator and every time I put a new predator the run away from that one but not from the rest.
I have some predator with a real inferiority complex.
What I would like to create is victims to run away from all predators.
How can I do this?
I ask for Jack because every time I have a question he comes up with a demo for it. He is like a demo librarian...
But for everybody else please feel free to help.
I have some victims actors that are supposed to run away from the predator and they do. At the beginning there is only one predator. Then I add more predators but the victims stop running away from the original predator and every time I put a new predator the run away from that one but not from the rest.
I have some predator with a real inferiority complex.
What I would like to create is victims to run away from all predators.
How can I do this?
Comments
Magnitude DEMO
and
Repel Mouse DEMO
Okay, not so much the second one but it looks real cool
Maybe you can have a rule (using the first demo) that if a victim actor is close to a predator actor, it triggers behaviors that makes it move away.
I tried the demo but it is what I was thinking and What I am trying to avoid. In the demo the 2 targets have different constraining. One is target 1X, 1Y and the other is target 2X, 2Y. In my case if I have 10 predators I would have to make a different constraining for each one. Is there an easier way? because then I will have to put a reaction for avery single predator on each one of the victims.
Look at the Collision angle demo I made.
Make both your victim and predator actors with circular collision shapes.
The predator actors will be a large circle (transparent PNG with image in the centre), larger than what is required -- this will set up a perimeter. When the victim collides with this perimeter you want it to start running away.
The demo above shows you how to calculate collision angles. The only difference I would make is: in the main actor (blue), it saves its position upon collision to game attributes. I would have it saved to actor attributes within itself.
When the victim actor collides with a predator actor, calculate the angle immediately and then you can have the victim actor move in the opposite direction.
Again, I don't know if this will work but good luck.
- What would happen if multiple victim actors collide with multiple predator actors at EXACTLY THE SAME INSTANT?
- What would happen if a victim actor was cornered by predator actor(s) and didn't have anywhere to go?
- If a predator actor were to "capture" a victim actor what should happen? How can you tell if a predator actor was directly above a victim actor?
Just some things to consider...
So we start with one predator but every time that predator touches a victim, that victim becomes a predator too.
So to answer the question, I don't know what exactly happens if multiple predators collide with victims but I don't think there will be a problem there.
The same thing with the second Q and the 3rd one you know, he will become a predator too.
player1Predator (Boolean)
player1X (Real)
player1Y (Real)
player2Predator
player2X
player2Y
...
etc
Then at the start of the game, I'd have the predator chase a random character (assign another attributed called 'chase' random(1,10) and then have rules that say, if chase = 1 AND player1predator is false, moveto player1X, player1Y, if chase = 2 ... etc)
have a rule that says when predator collides with player1, change player1Predator to false and have them both generate a new chase number.
you'll have to add rules to make sure they only go after people who have not been 'tagged', so that's why you need to put a playerXPredator=false check.
it should work in theory, it's gonna be a lot of work on your end to fiddle with the rules to get it to work right, but this should set you down the right path.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
@ Jon- Thanks a lot. That is exactly what I was trying to avoid. I did it in my Chupacabras game, I don't know if you remember, you were the one who taught me this method. Since it took a lot of time I was trying to see if there was a faster way because in the Chupacabras there were not even half the amount of victims actors I have in this one. I guess there is no other way.
Thanks a lot every one, lets start to work.