Home   Help Search Login Register  

Author Topic: Modifying Loadouts in Vehicle Respawn Script (Doolittle)  (Read 553 times)

0 Members and 1 Guest are viewing this topic.

Offline Vortrog

  • Members
  • *
  • Ski'in, Fish'in, Shoot'in, OFP'in
    • Vortrog's Lair
Ive sent an email to Doolittle direct on this one, but any other help would be appreciated.

I wanted to modify Doolittles vehicle respawn script so that one of the respawning vehicles (ie am WGL_A10) respawns with a different loadout to its basic loadout (ie remove AIM9's, 2xAGM65s, 2xMK82s and 2xGAU12s and replace them with 4xGAU12s and 4xAGM65s)
Where in the script would this work best? I had tried placing a subroutine in as follows, but I get an error in the first addin line. Refer to the section below. My addins are with ** infront. What I am trying to do is detect if the vehicle respawning is an "WGL_A10" and then modifying its loadout on respawn. Got a better idea?

The below is an extract from Doolittles Vehicle Respawn script for 1.46 with my addins shown. I get an error in the first ** addin line.

http://www.ofpec.com/includes/download2.php?id=424

Quote
#notalive
~30
_vtype = typeOf _v
deleteVehicle _v
~1
_v = _vtype createVehicle getPos _vl
_v setDir getDir _vl
vehicles set [_i, _v]
;_vtime set [_i, 0]
**?_vtype !="WGL_A10":goto "nextstep"
**_v removeweapon "WGL_AGM65Launcher2"
**_v removeweapon "WGL_Mk82Launcher2"
**_v removeweapon "WGL_Aim9Launcher2"
**_v removeweapon "WGL_GAU12Launcher2"
**_v addweapon "WGL_AGM65Launcher4"
**_v addweapon "WGL_GAU12Launcher4"
**_v addmagazine "WGL_AGM65Launcher4"
**_v addmagazine "WGL_GAU12Launcher4"

**#nextstep
publicObject = _v
publicVariable "publicObject"
goto "continue"

What part of my syntax did I get wrong? Can anyone shed some light on this?

Thanks in advance.

CopyrightPhilly

  • Guest
Re:Modifying Loadouts in Vehicle Respawn Script (Doolittle)
« Reply #1 on: 30 Jan 2005, 10:19:34 »
try:

Code: [Select]
#notalive
~30
_vtype = typeOf _v
deleteVehicle _v
~1
_v = _vtype createVehicle getPos _vl
_v setDir getDir _vl
vehicles set [_i, _v]
;_vtime set [_i, 0]

?(_vtype=="WGL_A10"):goto "WGL_A10"

publicObject = _v
publicVariable "publicObject"
goto "continue"

#WGL_A10
_v removeweapon "WGL_AGM65Launcher2"
_v removeweapon "WGL_Mk82Launcher2"
_v removeweapon "WGL_Aim9Launcher2"
_v removeweapon "WGL_GAU12Launcher2"
_v addweapon "WGL_AGM65Launcher4"
_v addweapon "WGL_GAU12Launcher4"
_v addmagazine "WGL_AGM65Launcher4"
_v addmagazine "WGL_GAU12Launcher4"
publicObject = _v
publicVariable "publicObject"
goto "continue"

you might want to add some removemagazines lines as well as the removeweapon line...

not sure if that will work or not
« Last Edit: 30 Jan 2005, 10:27:01 by CopyrightPhilly »

Offline Vortrog

  • Members
  • *
  • Ski'in, Fish'in, Shoot'in, OFP'in
    • Vortrog's Lair
Re:Modifying Loadouts in Vehicle Respawn Script (Doolittle)
« Reply #2 on: 30 Jan 2005, 22:37:46 »
Thanks for that. I realised a little while later that OI was missing the bracket to the ? line for the vehicle type.
But it is a good point you raise about the removemagazines. I still get an issue where it takes about 60 seconds for the added launchers to load ammo, so that is probably my problem.