I have been thinking about this idea for a while but last night I developed it a lot and am ready to tell you about it.
The permise of it is you have a 2D overview of a counter strike map and about five people on the team. Before you start you can set paths and waypoints to them where to go and what to do, however it is more complex than it sounds.
Here is an example, say you where controling the terrorist team on aztec. You wanted your team to go up to the door and stop, peek round the door. And if only one team member is left they retreat. To make it simple I will only use three team members.
1. The first threat is that the counter terrorists might get through the door or up the ram before you, and you dont want to be sitting ducks for them. You create a way point between the three spawns and just round the corner of the corridor, then you create a path between them. The path is automatically named "A", by defauly a soldier will always follow path A from a way point and aim in the direction they move. The waypoint they are going to is automatically given a serial, which will be #001. When they get there you want them to do different things, if they see an enemy fire at them for a couple of seconds, if they dont see one countinue to the door while aiming at the door, archway from the bridge or the ramp (each soldier being given its own area to cover. So here goes, you type this into the games "console"-
alpha #001
S: IF seeEnemy: stop(2) AND aimFire: path(A)
D: path(B)
A: aim(274698)
Now let me explain this, the first line tell the console which soldier being at which waypoint the following rules. The first is a "special" line, which means it only happens in a speical circumstance, this being if the soldier sees and enemy, he is then told to stay at the waypoint for two seconds and fire at the enemy, stop2 has an amount of time linked to it, so it is completable so that if it is finished it moves onto the nextphrase of code as nothing else in that phrase can be completed, the soldier is then told to retreat down the path back to the spawn waypoint.
The next line of code is "default", so if none of the conditions for the special lines are true, then it is used. This tells the soldier to go down pathB.
The third line is the "aim" line, it is like defaut but is stays true until a different place to aim is said, so while alpha stays at that waypoint he aims at said coordinates, the first three numbers being on Y, and the last three being on X. Instead of having to find the co's youself you can use an AIM tool which inserts them when you click on that point on the map. The AIM point is the middle of the cone of view that the soldier is aware of.
alpha A
S: IF seeEnemy: pathBackward(2) AND aimFire: goTo(#005)
D: pathForward
A: aim(274698)
For a start this code is linked to a path, the being the path going toward the waypoint next to the door.
Line one is like the "special" line in the last peice of code, except it tells the soldier on seeing an enemy to retreat back down the path while firing at the enemy for a couple of seconds before going to the waypoint #005, which is behind a crate so they can hide from the enemy fire. It does not go along a path, so the soldier must pathfind its way there itself.
If there are no enemies encounterd the soldier is free to carry on to waypoint #003. This waypoint gives the following code
G: IF die: send(alphaDead)
alpha #003 //Behind gap in door
F: path(C) //F = first time at waypoint
D: stop(2): path(C)
S: IF receive(bravoDead) AND receive(charlieDead) OR health(<50): goTo(#005)
A: aim(274698)
alpha C
A: aim(274698)
D: pathForward
S: IF receive(bravoDead) AND receive(charlieDead) OR health(<50): goTo(#005)
S: IF damage: pathBackward
alpha #004 //Infront of gap in door
A: aim(274698)
D: stop(5): pathBackward
S: IF receive(bravoDead) AND receive(charlieDead) OR health(<50): goTo(#005)
S: IF damage: pathBackward
S: IF seeEnemy: aimFire(2): pathBackward
See if you can work out yourself what is going on here. See if you can identify any potential probelms.
Thanks for reading, I hope your intrested and understand my idea, tell me if I have made any mistakes or contraditions. :afro:
The permise of it is you have a 2D overview of a counter strike map and about five people on the team. Before you start you can set paths and waypoints to them where to go and what to do, however it is more complex than it sounds.
Here is an example, say you where controling the terrorist team on aztec. You wanted your team to go up to the door and stop, peek round the door. And if only one team member is left they retreat. To make it simple I will only use three team members.
1. The first threat is that the counter terrorists might get through the door or up the ram before you, and you dont want to be sitting ducks for them. You create a way point between the three spawns and just round the corner of the corridor, then you create a path between them. The path is automatically named "A", by defauly a soldier will always follow path A from a way point and aim in the direction they move. The waypoint they are going to is automatically given a serial, which will be #001. When they get there you want them to do different things, if they see an enemy fire at them for a couple of seconds, if they dont see one countinue to the door while aiming at the door, archway from the bridge or the ramp (each soldier being given its own area to cover. So here goes, you type this into the games "console"-
alpha #001
S: IF seeEnemy: stop(2) AND aimFire: path(A)
D: path(B)
A: aim(274698)
Now let me explain this, the first line tell the console which soldier being at which waypoint the following rules. The first is a "special" line, which means it only happens in a speical circumstance, this being if the soldier sees and enemy, he is then told to stay at the waypoint for two seconds and fire at the enemy, stop2 has an amount of time linked to it, so it is completable so that if it is finished it moves onto the nextphrase of code as nothing else in that phrase can be completed, the soldier is then told to retreat down the path back to the spawn waypoint.
The next line of code is "default", so if none of the conditions for the special lines are true, then it is used. This tells the soldier to go down pathB.
The third line is the "aim" line, it is like defaut but is stays true until a different place to aim is said, so while alpha stays at that waypoint he aims at said coordinates, the first three numbers being on Y, and the last three being on X. Instead of having to find the co's youself you can use an AIM tool which inserts them when you click on that point on the map. The AIM point is the middle of the cone of view that the soldier is aware of.
alpha A
S: IF seeEnemy: pathBackward(2) AND aimFire: goTo(#005)
D: pathForward
A: aim(274698)
For a start this code is linked to a path, the being the path going toward the waypoint next to the door.
Line one is like the "special" line in the last peice of code, except it tells the soldier on seeing an enemy to retreat back down the path while firing at the enemy for a couple of seconds before going to the waypoint #005, which is behind a crate so they can hide from the enemy fire. It does not go along a path, so the soldier must pathfind its way there itself.
If there are no enemies encounterd the soldier is free to carry on to waypoint #003. This waypoint gives the following code
G: IF die: send(alphaDead)
alpha #003 //Behind gap in door
F: path(C) //F = first time at waypoint
D: stop(2): path(C)
S: IF receive(bravoDead) AND receive(charlieDead) OR health(<50): goTo(#005)
A: aim(274698)
alpha C
A: aim(274698)
D: pathForward
S: IF receive(bravoDead) AND receive(charlieDead) OR health(<50): goTo(#005)
S: IF damage: pathBackward
alpha #004 //Infront of gap in door
A: aim(274698)
D: stop(5): pathBackward
S: IF receive(bravoDead) AND receive(charlieDead) OR health(<50): goTo(#005)
S: IF damage: pathBackward
S: IF seeEnemy: aimFire(2): pathBackward
See if you can work out yourself what is going on here. See if you can identify any potential probelms.
Thanks for reading, I hope your intrested and understand my idea, tell me if I have made any mistakes or contraditions. :afro: