Home   Help Search Login Register  

Author Topic: getdammage to run a script  (Read 1251 times)

0 Members and 3 Guests are viewing this topic.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
getdammage to run a script
« on: 08 Feb 2003, 18:06:32 »
Each chopper in my mission runs the following script


What i have been trying to do, is add lines to the script, checking the damage of the choppers, and if it is a certain amount, have the script then activate the "tail-rotor fail script by Vektorboson"
Notice the lines in various colours, these are what i have been trying to get to work

Initially i want to have the rotor failure script activated if the chopper that runs the following script has dammage of between 0.2 and 0.4



Any help would be greatly appreciated

Quote
;Nam Chopper respawn limited weaponry
 ~1
 ?!(local Server): exit  
 _vcl = _this select 0
 _class = _this select 1
 _rspn = _this select 2
 _azimut = _this select 3  
 #start0
 _vcl lock False
 ~5
?(getdammage _vcl > .01):goto "Lost"
 ~2
 ?(count crew _vcl > 0):goto "start1"  
 ~2
 goto "start0"
 ;*************************************************************
 #start1
 ?!(Alive _vcl):goto "end"
 ?(count crew _vcl == 0):goto "Lost"
 ~5
 goto "start1"
 ;*************************************************************
 #Lost
 ~1
?(getdammage _veh >= 0.2) and (getdammage _veh <= 0.4):goto "rotorfail"
 ?!(Alive _vcl):goto "end"
 ~15
 ?!(Alive _vcl):goto "end"  
 ~15
 ?!(Alive _vcl):goto "end"
 ?(count crew _vcl == 0):goto "end"
 ?(count crew _vcl > 0):goto "start1"
 goto "start0"
 ;*************************************************************


goto "end"



 #end
~30
 _vcl setfuel 0
 ~1
 _vcl setdammage 1
 deleteVehicle _vcl
 ~10
 _vcl = _class createVehicle getpos _rspn
 _vcl setdir _azimut
 _vcl lock False  
?(_class == "sebuh_1gs"): _vcl removeweapon "sebuh1zuni48"
?(_class == "sebah_1j"): _vcl removeweapon "sebah1zuni38"
?(_class == "sebuh_1guns"): _vcl removeweapon "sebah1zuni14"
?(_class == "sebah_1a"): _vcl removeweapon "sebah1zuni76"
 goto "start0"

  #rotorfail
 Hint "Tail rotor dead"
exec "tailrotor.sqs"
;; _vcl exec "tailrotor.sqs" (tried this too)
if (Player in thisList) then { vehicleRadio [format["Mayday!\n Mayday\n"We lost the tail rotor\nWe are going down",name (thisList select 0)],"Plain down"]
   something wrong with this too
 goto "end"





and i cant get it to work

I have tried allsorts of lines, but i am afraid my scripting skills aint that good
« Last Edit: 08 Feb 2003, 18:07:14 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:getdammage to run a script
« Reply #1 on: 09 Feb 2003, 02:10:46 »
Hey Terox ;)

With your first coloured line there... is the variable supposed to be _veh? Or _vcl?

God know's it's the little things that trip us all up most often... ;D

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:getdammage to run a script
« Reply #2 on: 09 Feb 2003, 11:26:22 »
arent i the plonker, god knows how many hours ive spent on this

Thx, eventually got the hint message to show, which then highlighted more problems when the script actually run,  thats now sorted


Still have one problem, which is getting an "In vehicle message to show to the pilot and passengers

Think it warrants a new post as it isnt anything to do with the title of this post  thx again
« Last Edit: 09 Feb 2003, 11:27:19 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123