Home   Help Search Login Register  

Author Topic: Removing weapon and ammo cargo  (Read 896 times)

0 Members and 1 Guest are viewing this topic.

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Removing weapon and ammo cargo
« on: 24 Mar 2004, 16:49:49 »
I am using a vehicle respawn script in my mission, and running the following in the script,(among other things):

clearweaponcargo _vcl
clearmagazinecargo _vcl
removeallweapons _vcl
goto "start"

The vehicles respawn and have no weapon or magazine cargo when the mission is previewd in the editor, and when played as a mission on my computer, the problem is when this mission is run from our dedicated server the vehicles have their cargo and weapons again!

I have the line ?!(local server): goto "end" in the script to prevent multispawn

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:Removing weapon and ammo cargo
« Reply #1 on: 30 Mar 2004, 20:49:26 »
If your creating new ones, their name must be used, not the trucks names that were destroyed. If that is the case tho. Generally it's better to use the setDammage 0 method. If you are creating them with a name, and it's the same all the time, the most recent one will replace the old, so no prob there. Maybe the clearcargo commands should be ran on clients too, as you know in the editor you are the server and see those results.
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Removing weapon and ammo cargo
« Reply #2 on: 31 Mar 2004, 14:40:10 »
Actually I don't name the vehicles at all.  In the init of each I run:
[this] exec "myvrs.sqs"
which will respawn them, and give a custom loadout.  The problem is it won't remove the weps and such from the challenger.
  I have also been able to incorporate the turbo action in this script and I have tried to incorporate the altmonitor script also, but it doesn't work this way.  I have attached the file for troubleshooting purposes. I am certain the answer is easy, it just is hiding from me.  The script is based on vrs.sqs from karrillion

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:Removing weapon and ammo cargo
« Reply #3 on: 31 Mar 2004, 15:55:31 »
Ah but I don't see a label for the challenger itself, it and some others go straight to the turbo label, at which you start the alt-monitoring only after one respawn? That would be a prob. You'd have to have the speedloop running before the start label, and to the speedloop add this line
? (! canMove _vcl) : goto "start"
and remove that @ !(canMove... from there.

Anyway, just put this below the turbo (or a challenger if you make one) label, it should work for any vehicle needing it's weapons removed.
Code: [Select]
{_vcl removeMagazine _x} forEach (magazines _vcl)
{_vcl removeWeapon _x} forEach (weapons _vcl)
« Last Edit: 31 Mar 2004, 15:57:15 by MI_Fred »
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Removing weapon and ammo cargo
« Reply #4 on: 31 Mar 2004, 16:16:03 »
yeah, I actually took the label for the challenger out because it wasn't working.  I put it back in now tho.  Will test and let ya know, thanks!

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Removing weapon and ammo cargo
« Reply #5 on: 31 Mar 2004, 16:48:34 »
My caffiene deprived brain is missing something.  The script as of now will work once, then after a respawn the speedloop doesn't run, but the turbo action does.  And the challengers still have all their wep and ammo cargo.
Code: [Select]
;;BEGIN vrs.sqs
;;By KaRRiLLioN
;;VehicleType Loop by Sefe
;;Original script by Backoff
;;Updated for 1.75 by Jaeger Neo
;;IMPORTANT: ADD A GAMELOGIC NAMED Server
;;to the mission to prevent multispawn

_vcl = _this select 0

_vcl AddAction ["Turbo On","RTS3-VCL-TurboOn.sqs"]

?!(local Server): Goto "end"
_respawndelay = 10
_dir=Getdir _vcl
_position=Getpos _vcl
_Vehicles=[]

_WTrucks=["Truck5tOpen","Truck5tRepair","Truck5tReammo","Truck5tRefuel","Truck5t"]
_ETrucks=["UralRepair","UralReammo","UralReFuel","Ural"]
_CivTrucks=["TruckV3SGCivil","TruckV3SGRefuel","TruckV3SGRepair","TruckV3SGReammo","Bus","TruckV3SG"]
_Jeeps=["Buggy2GLG","JeepPolice"]
_Cars=["Challenger","basklr250dese"]
_Helos=["bas_mh6"]
_Planes=["Cessna","A10LGB","A10","SU25"]
_WArmor=["M1Abrams","M60","Bradley","M113Ambul","Vulcan","M2StaticMGE","M2StaticMG","M113","BoatW"]
_GArmor=["T80Res","T72Res"]
_EArmor=["T80","T72","BMP2","BMPAmbul","BMP","BRDM","BoatE","ZSU","T55G"]
_Other=["Mash"]

_Vehicles=_WTrucks+_ETrucks+_CivTrucks+_Jeeps+_Cars+_Helos+_Planes+_WArmor+_GArmor+_EArmor+_Other

_i = 0
#Loop
? (_i > (Count _Vehicles)) : Goto "speedloop"
_VehicleType = _Vehicles Select _i
_VehicleTypeDoesMatch = ((_VehicleType CountType _this) == 1)
? _VehicleTypeDoesMatch : _type = _VehicleType
? _VehicleTypeDoesMatch : Goto "speedloop"
_i = _i + 1
Goto "Loop"
#speedloop
?!(canmove _vcl): goto "start"
(driver _vcl) sidechat format ["speed:%1 ----altitude:%2",speed _vcl, getpos _vcl select 2]
~.3
;;criteria for starting jump distance is 1 meter as height
?((getpos _vcl select 2) < 1) : goto "speedloop"
player sidechat "measuring jump distance"
_startgl = "Logic" camcreate getpos _vcl
@ ((getpos _vcl select 2) < 1)
_dx = (getpos _startgl select 0) - (getpos _vcl select 0)
_dy = (getpos _startgl select 1) - (getpos _vcl select 1)
_dist = sqrt ((_dx * _dx) + (_dy * _dy));
deletevehicle _startgl

(driver _vcl) globalchat format ["%2  jumped %1 meters!!!",_dist, name driver _vcl]
;;~4

#start
~2
@!(Canmove _vcl)
~_respawndelay
deleteVehicle _vcl
_vcl = _type createVehicle _position
_vcl setdir _dir

#Skip

#CustomArming

?(_type == "basklr250dese") OR (_type == "Buggy2GLG") OR (_type == "Mini") : Goto "Turbo"
?(_type == "Bus") OR (_type == "Kolo") OR (_type == "Rapid") OR (_type == "Tractor") : Goto "Turbo"
?(_type == "Challenger") : goto "challenger"
Goto "start"

#challenger
{_vcl removeMagazine _x} forEach (magazines _vcl)
{_vcl removeWeapon _x} forEach (weapons _vcl)
goto "Turbo"

#Turbo
@!AddingTurbo
TurboCar = _vcl
Publicvariable "TurboCar"

Goto "start"


#end
Exit
;;END vrs.sqs

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:Removing weapon and ammo cargo
« Reply #6 on: 31 Mar 2004, 18:21:47 »
#Turbo
@!AddingTurbo
TurboCar = _vcl
Publicvariable "TurboCar"

Goto "start"

Should Goto "speedloop", right?  ;D

But on that cargo thing, you do mean their usable weapons or really cargo as in cargo? You tried to see if it still has it's weaponry? If not then it's prolly a matter of serious pondering, can't quite figure it. clearMagazineCargo _vcl and clearWeaponCargo _vcl should work for cargo naturally.
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.