[quote:3otdpidt]Any ideas anyone?
I read about IIDs and UIDs but have no idea what to make of those .
I never use IIDs my self only UIDs, never really found a reason to use the IIDs. But UID are just a unique identifier for a given object. Which make it very easy to manipulate specific items. You could do something like it manually if you wanted, but C2 just does it for you automatically, so you don't have to, which is why its easy to use.
But imagine that you are in a dark room with two other people and you cant see each other. But you have to give one of them some instructions. The normal way would be to say there name and then what you wanted them to do,
"Roger come to me" in this case Roger is the UID. Even if they both are called Roger, you might use Roger A or Roger B so they know who you are talking to. So no matter what they can never have the same name.
Here is an example of how to make behaviours for turret this is from a former project I did:
It shows two different turrets a basic "gun" turret and a turret that slows enemies. From the description in the image it explain overall how they work.
The Gun turret
Uses a very simple behaviour it will just shoot the first enemy with the lowest health that are within range.
Since all the turrets are part of the Family "fTurret" I use an identifier "Turret_type = "Gun" to make sure that this behaviour only apply to gun turrets. Then I make sure that it only do this for turrets that doesn't currently have a target.
Since im not sure how many turrets it picks based on these conditions and don't really care to know. I throw in a "for each" in the end so it does it for all of them.
Then I make each of the turrets pick the enemy with the lowest health and set it to the turrets target. And it start all over once that enemy is dead or outside range.
The Slow turret
The first part is about the same as with the gun turret, except I don't really care if the slow turret already have a target. I want it to keep slowing enemies that are currently not slowed. And again I don't know how many turrets it picks so I throw a "For each" in there again. Since in my game an enemy can only be slowed if it have no shield, I make sure that the enemies shield are equal to 0, and that they currently aint slowed, which is just a Boolean that is switch on/off (there is a bit more to it.) And last it picks the one nearest to the turret.
And when that is slowed it start all over.
So if you want to use several different behaviours for the same turret, you can just make a Boolean that you switch for each of them, that also need to be true.
For instant for the gun turret, I could have made it pick the enemy with the highest amount of health, if some Boolean have been set to that. So you can make it like that.