Home   Help Search Login Register  

Author Topic: Script needs work I know  (Read 876 times)

0 Members and 2 Guests are viewing this topic.

Dubieman

  • Guest
Script needs work I know
« on: 02 Feb 2004, 23:51:53 »
Alright I made my code for the blackhawk healing script where I want the bird to be healed once it hits 0.25 damage and I would like to know how this can work in a certain trigger area cause if you rehealed over the whole map, it would one easy mission! ;D
I know I have a lot of things wrong here as this is my FIRST custom script. :o

Code: [Select]
_UH60 = _this select 0

#update

; I want to check on the UH60's damage
?((getdammage UH60) >0.25) : goto "heal"

;time to wait
~1
goto "update"

#heal

_UH60 setdammage 0

goto "Update"

« Last Edit: 02 Feb 2004, 23:53:07 by GuiltyRoachKilla »

Korax

  • Guest
Re:Script needs work I know
« Reply #1 on: 03 Feb 2004, 01:41:25 »
Well for a first script it isnt that bad  ;)
If you want to do it only within a certain area, create a trigger set to the size of the area and "repeadedly", and in its activation field put Heal = true, then in its deactivation field put Heal = false, group it to the blackhawk and set it to "vehicle" present, then change the script as so...

Code: [Select]
_UH60 = _this select 0

#update

; I want to check on the UH60's damage
?((getdammage _UH60) >0.25) AND Heal : goto "heal"

;time to wait
~1
goto "update"

#heal

_UH60 setdammage 0

goto "Update"

Dubieman

  • Guest
Re:Script needs work I know
« Reply #2 on: 03 Feb 2004, 01:49:46 »
Thanks a bunch, this will help cause now I can finish that damn mission! ;D

Dubieman

  • Guest
Re:Script needs work I know
« Reply #3 on: 03 Feb 2004, 02:01:47 »
Err one last thing..... :-[

The script won't activate and I know it is something stupid but I put in

[UH60] exec "Healme.sqs"


 ???

Korax

  • Guest
Re:Script needs work I know
« Reply #4 on: 03 Feb 2004, 02:46:49 »
Hmm are you sure it isnt activating? should work.. did you name it healme.sqs and put it in your users/(name)/missions/(missionname) directory?  Or maybe the trigger isnt set up right?
It should work like that, unless you added the [uh60] exec "healme.sqs" in a place where it hasnt activated yet..

Maybe you could be more specific? is the scriptjust activating or are you not sure whether its activated.. or has it activated and its not working?

Oh yes, maybe you forgot to name the blackhawk UH60?   ;D
« Last Edit: 03 Feb 2004, 02:57:41 by Korax »

Dubieman

  • Guest
Re:Script needs work I know
« Reply #5 on: 03 Feb 2004, 21:02:05 »
I know the script isn't activated already cause I let the armor go down to red and finaly it blew up...... :P

And its defintely in the mission file plus the script name is "Healme.sqs" and I put

[UH60] exec "Healme.sqs" in the trigger activation field and grouped my little team to the trigger under vehicle and such. I am sure the heli is named UH60 but should it be named _UH60?

Ahh let me screw with this a little more..... 8)

Dubieman

  • Guest
Re:Script needs work I know
« Reply #6 on: 03 Feb 2004, 21:18:21 »
 :gunman: :noo:

Well I should shoot myself, I didn't name it before a waypoint got on it.........

Anyways I fixed it all up and the name thing was the whole problem! I put  waypoint on the bird and didn't think to name it.... ::) Works like a charm though cause I hovered there and ppl would go nuts trying to destroy the thing, really the only way to die is if you the pilot get a bullet while sitting there.... :o

Thanks a bunch... I found an efficent code for the pilot/gunner dying thing...

this addeventhandler ["hit",{_this select 0 setdammage 0}]
It works but may make the mission way to easy. :)