Home   Help Search Login Register  

Author Topic: Chopper script wont work  (Read 2066 times)

0 Members and 1 Guest are viewing this topic.

Offline BuhBye

  • Members
  • *
  • I'm a llama!
Chopper script wont work
« on: 04 Jun 2007, 22:14:32 »
Hi guys Ive got this up on the BIS forum and so far Im getting nothing that works.

The deal...

The script works fine until it gets to the #drop. When everyone gets out the chopper just sits there. Any ideas? Thanx


Code: [Select]
helo1 flyinheight 30
helo1 setbehaviour "stealth"
helo1 domove getpos start1
helo1 setspeedmode "NORMAL"

#loop
?helo1 distance start1 < 300 : goto "land"
~0.5
goto "loop"

#land
helo1 setspeedmode "NORMAL"
helo1 land "GET OUT"
_height = getpos helo1 select 2
?_height < 1 : goto "drop"
~0.5
goto "land"

#drop
helo1 flyinheight 0
@(not((w1 in helo1) or (w2 in helo1) or (w3 in helo1) or (w4 in helo1) or (w5 in helo1)))
goto "leave"

#leave

helo1 domove getpos gone1
helo1 flyinheight 30
helo1 setspeedmode "FULL"
@helo1 distance gone1 < 200
goto "empty"

#empty

deletevehicle helo1
exit

Offline BuhBye

  • Members
  • *
  • I'm a llama!
Re: Chopper script wont work
« Reply #1 on: 05 Jun 2007, 01:13:38 »
Figured it out thanx.

Offline Landdon

  • Members
  • *
Re: Chopper script wont work
« Reply #2 on: 05 Jun 2007, 08:40:20 »
Could you enlighten me as to what the problem was and how you fixed it?

Offline BuhBye

  • Members
  • *
  • I'm a llama!
Re: Chopper script wont work
« Reply #3 on: 05 Jun 2007, 18:54:37 »
Sure Landdon...

Code: [Select]
#drop
helo1 flyinheight 0
@(not((w1 in helo1) or (w2 in helo1) or (w3 in helo1) or (w4 in helo1) or (w5 in helo1)))
goto "leave"

#leave

helo1 domove getpos gone1
helo1 flyinheight 30
helo1 setspeedmode "FULL"
@helo1 distance gone1 < 200
goto "empty"

When I ran it, the chooper would land, all got out and it just sat there. So I ASSuMEd the "not in" check didnt work. So while testing it I put a "hint" message in right after the "@(not((w1 in helo1) or (w2 in helo1) or (w3 in helo1) or (w4 in helo1) or (w5 in helo1)))" and the hint went off so I knew the check worked. Then I looked at it and HIT myself cause "start1" is an invis. H (object) and "gone1" is an empty marker, thus "helo1 domove getpos gone1" didn't work. As soon as I changed it to "helo1 domove getMARKERpos "gone1" it worked great.

I tried about 6 different checks and like 7 hrs chasing that! Ahhh the joys of scripting.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Chopper script wont work
« Reply #4 on: 06 Jun 2007, 01:13:44 »
Did you update your version in the Beta Thread?
urp!

Offline BuhBye

  • Members
  • *
  • I'm a llama!
Re: Chopper script wont work
« Reply #5 on: 06 Jun 2007, 06:59:19 »
Yes I did Peanut. :D