Today I am working on the Hostage/Civilian Class script that will handle the ability to comply(put hands up and drop to his/her knees) when he/she hears the Swat3 issue compliance, Dialog, and comply and arrest animations
This image will facilitate my explanation.
When a member of the swat team issues compliance, and not looking directly at a civilian/hostage the sound's ability to be audible is based on serveral factors.
1. is the hostage/civilian in the same room and if not
2. are there any walls between the swat who issued compliance and the hostage/civilian
3. In what state is the Civilian/Hostage wether it be calm, scared, or other.
4. The value of each of the attributes for the specific character. Most of us remember them by the characters.dat file
values for Stresslevel, Marksmancship, Aggression, Years of experience, or
2 0 7 0 0 (taken from Lori Abbot's Data)
In swat3, the ability to be heard is based on 3 things, wether Swat and the Hostage/Civilian is in the same cell, the Distance between the 2 and character data.
Here is the way I think this should be handled When the player(Swat) issues compliance
Each hostage/Civilian is equipped with a Shere collider that will return collisions detected.
Each hostage/Civilian is equipped with a script that will read the attributes for that character and calculate distance, play dialog, and set animations.
When the player(Swat) issues compliance....
The ability for that character to comply will be based on Distance, Sphere Collider boolean(true/false), character state and the character data.
Let me Explain.
if a collision is detected, we must first determing what the collision(s) are, and if we have a collision with the Issuer; thus:
1. if the collision(s) does not contain the issuer(false) then there must be a wall or an obstruction, reducing the travel of the audible source and thus the ability for that character to comply will be based on distance (with an obstruction) to the issuer and character data.
2. but if a collision(s) is the issuer(true) is detected then, the ability for that character to comply will based on distance( with no obstruction probably same Cell) and character data.
to cover all other scenarios(in case the civilian/hostage is hiding), we will base the ability to comply by the character data, distance and wether or not they are in the same cell.
and of course we should have some bolean(true/false) if the character is DEAD, we dont want them to come back to life.
Once this character is in the Compliant state we can arrest, and call him/her in.
Still with me?
If anyone understands me and like what you see, please let me know by contributing ideas of how we can make this aspect of the game more realistic.