OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Yasirotta on 01 Nov 2010, 06:24:28

Title: Police Guard
Post by: Yasirotta on 01 Nov 2010, 06:24:28
Ok, trying make classic bankrob etc. mission multiplayer. 2-8 players, as robbers.

Now theres 2 things i been thinking. First is, making Cops walking at city pointless (random waypoints). I was thinking to make their behaviour "safe", and give waypoint of "guard" big as city area is. Before that, "Cycle". Will this make them walking at city, and draw guns when alert is made ?

Alert would be set whit changing players side. First civilians, then change their side to East. Cops are west, friendly to civilians. Now, the trick is that alert (=change side) is made when a) player takes gun (pistol) out of his pocket or b) bank is robbed. Robbing the bank could made whit trigger whit "addaction" line.

Thats whats i would need help. If aint too hard, can this made more tricky ? Point is, that players can hide pistols, but if M16 at shoulder, that also makes alert ? I guess it would need script whit "knowsabout" and "Checkweapon" (?), but my skills arent high.

Once again made it short:
1. Cops patrolling at safe first
2. Cops shoot players if they see player whit gun
3. After alert, Cops go combat behaviour
Title: Re: Police Guard
Post by: faguss on 11 Nov 2011, 23:43:44
Quote
making Cops walking at city pointless
Better to do it with a script rather than Mission Editor. Are you familiar with scripting?

Quote
changing players side
It is not possible to do so. However, you can change their rating so they become an enemy to anyone.

Quote
alert is made when a) player takes gun (pistol) out of his pocket
That could be achieved by:
Title: Re: Police Guard
Post by: Lenyoga on 19 Dec 2011, 17:36:57
Changing the player's side doesn't work, but it's possible to change the player's unit's side to EAST in the mission.sqm file, and add "this setCaptive true" to the player's init line - when the alert is triggered, you can add "player setCaptive false" to the activation line and the police will open fire.

There is a command called hasWeapon - everytime the player is within a police unit's field of vision, you could execute a script - something like


Code: [Select]
?(player hasWeapon "M16") : goto "Alert"
?(player hasWeapon "Revolver") : goto "Alert"

exit

#Alert

player setCaptive false

exit


I don't know if it's possible to check if a handgun is holstered, but I think it's unlikely to accomplish that.

I hope that was helpful.
Title: Re: Police Guard
Post by: robertoHrvat on 29 Dec 2011, 17:01:37
you can create one EAST soldier on some smaller island near that big island named: PoliceEnemy

?(player hasWeapon "M16") : goto "Trouble"

exit

#Trouble
Player Join Group PoliceEnemy
enabeRadio false
~0.1
(Now when he is joined russian group, he is now Resistance enemy, and now russian will be removed from game but you will stay like an res enemy)
deletevehicle PoliceEnemy
enableradio true