Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: i need help with script!  (Read 1165 times)

0 Members and 1 Guest are viewing this topic.

Offline dancuc

  • Members
  • *
i need help with script!
« on: 10 May 2007, 16:25:56 »
i have mission and objective is get from forrest, via area guarded by (not enemy!) units to barracks. units must be friendly, this is only training and they can“t shoot on player, when they catch player (distance from him 1 meter) mission end how can i do this? thanks

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: i need help with script!
« Reply #1 on: 13 May 2007, 22:38:25 »
if you make the units you don't want to be shot at you can do the following in the units init line.
Quote
this setcaptive true

The enemy will not shoot them.

You may also want to check out the Distance Command.
« Last Edit: 13 May 2007, 22:49:35 by JasonO »

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: i need help with script!
« Reply #2 on: 15 May 2007, 21:54:26 »
1) Add the following to your init.sqs
Code: [Select]
unitsArray = [chaseunit1, chaseunit2, chaseunit3,....]where chaseunitX are the names you have given to whatever units are chasing your player. If you have placed a crewed vehicle in the editor also add it to this array.

2) Add a trigger with the following Condition
Code: [Select]
({(huntedunit distance _x) <= 1} Count unitsArray) > 0)Where huntedunit is the name of your player unit. If this is a single player mission you could substitute player for the player unit's name.

If you have many units chasing the player and they start in a separate area you could instead put a trigger that covers all the chasing units(but not the player unit), set it to fire side present once with the On Activation
Code: [Select]
unitsArray = +thislist
Then you neither need to name all the chasing units nor use the line I have given for the init.sqs
urp!