Home   Help Search Login Register  

Author Topic: Police Guard  (Read 3153 times)

0 Members and 1 Guest are viewing this topic.

Offline Yasirotta

  • Members
  • *
Police Guard
« 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

Offline faguss

  • Members
  • *
    • Faguss' Website
Re: Police Guard
« Reply #1 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:
  • adding/removing weapon by user action; if player hasWeapon then alert
  • detecting player current animation with Fwatch 1.1

Offline Lenyoga

  • Professor of Misanthropology
  • Members
  • *
Re: Police Guard
« Reply #2 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.
As a grandmother I've got lots of gold.

Offline robertoHrvat

  • Members
  • *
    • Area 51 modification
Re: Police Guard
« Reply #3 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
RobertoHrvat