Home   Help Search Login Register  

Author Topic: Add a loaded laser designator  (Read 613 times)

0 Members and 1 Guest are viewing this topic.

Offline Gadjuka

  • Members
  • *
  • Programmer
    • Operation Flashpoint: Commander
Add a loaded laser designator
« on: 18 Nov 2005, 12:48:03 »
Hi all!
When I add a LaserDesignator and its ammo to a trucks cargo space they is put there as two separate units - that is, you have to pick up the laser designator (which then doesn't have any ammo loaded) and then pick its ammo up and reload it. I want the ammo to be loaded directly! ???
I have tried both 'addMagazineCargo' followed by 'addWeaponCargo'  (which usually work for other weapons) and also the other way around. Any ideas?
Currently working on Operation Flashpoint: Commander.
Website: http://www.nordserver.se/commander/

klavan

  • Guest
Re:Add a loaded laser designator
« Reply #1 on: 18 Nov 2005, 13:08:15 »
You can set up a trigger.
For example:
 
"Activation": none, once or repeatedly (at your choice)
Size: 0x0
In the "Activation field" put: player hasweapon "laserdesignator"
In the "On Activation" field put: player addmagazine "laserdesignator"

Hope this help
Klavan
« Last Edit: 18 Nov 2005, 13:13:05 by klavan »

Offline Gadjuka

  • Members
  • *
  • Programmer
    • Operation Flashpoint: Commander
Re:Add a loaded laser designator
« Reply #2 on: 18 Nov 2005, 13:45:14 »
Hm, yeah, that seems to work! Problem now is to figure out who is taking the weapon. ;)
Thanks!
Currently working on Operation Flashpoint: Commander.
Website: http://www.nordserver.se/commander/

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Add a loaded laser designator
« Reply #3 on: 18 Nov 2005, 19:34:41 »
add an action to the ammo truck

Code: [Select]
unit addAction ["Take Laser Designator Magazine","takedesig.sqs"]

Then you can start your script with:
Code: [Select]
_unit = _this select 1
; _this select 1 is the unit that executed the action

#LDCheck
? (_unit hasWeapon "LaserDesignator") : _unit addMagazine "LaserDesignator"; exit
~1
goto "LDCheck"
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08