Home   Help Search Login Register  

Author Topic: Cops  (Read 733 times)

0 Members and 2 Guests are viewing this topic.

redfox

  • Guest
Cops
« on: 20 Aug 2003, 01:28:42 »
So what I have been trying to do is have a cop car go around to way point. But when he sees a enemy he goes after it. This is a messed up script I was try to make:

#init
   _cop = _this
   DetectedEnemy=_bad
#loop
   _cop setCombatMode "GREEN"
   _cop doTarget _bad
   _cop setpos getPos _bad  <------- mabey a way to follow the bad guy?
   globalchat "Suspect found. In persute"

goto "loop" <---------- need to find a way to stop this after the bad guys dead or cant be found

Can anyone HELP?
 ???

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Cops
« Reply #1 on: 20 Aug 2003, 12:09:31 »
Ok, here are some suggested revisions ... this is not a script, it's a sketch of a script.    

It might be better to ignore all combatmode and setbehaviour stuff, let him sort it out for himself.  

You may want to add a line to make the cop get out of his vehicle, although he may do that himself.

#init
_cop = this
not sure how you'll pass the bad guy to the script

globalchat format [ "%1.  Suspect spotted.  In pursuit.", _cop]

#loop
? not (alive _bad): exit
? _cop knowsabout _bad < 2: exit
? _cop distance _bad < 10: _cop reveal _bad; exit
(you should also have a line here to make the script exit if the cop and/or his vehicle can't move)
_cop doMove getPos _bad
~5
goto "loop"
Plenty of reviewed ArmA missions for you to play

redfox

  • Guest
Re:Cops
« Reply #2 on: 21 Aug 2003, 01:42:21 »
Thanks! I still looking for some way to pass the bad guy to _bad without a trigger. anyone else?

Kyle

  • Guest
Re:Cops
« Reply #3 on: 21 Aug 2003, 17:19:22 »
You should download Runaway scientist's Cessena Fun from ofp.gamezone.cz, he has some pretty amazing scripts in the mission file, including a nice couple cop scripts!

Hope It HeLpS!
        Sniper_Kyle ;D

redfox

  • Guest
Re:Cops
« Reply #4 on: 21 Aug 2003, 23:14:42 »
Yeap thats what i did. But its all related to _player (the player). I think after looking around there is no way to have a script work as a trigger :-( oh well

redfox

  • Guest
Re:Cops
« Reply #5 on: 22 Aug 2003, 01:24:37 »
ok so I reworking the script. the only thing chaged is now the bad guy has to be name BADGUY.