Home   Help Search Login Register  

Author Topic: to make halo start in the air via script  (Read 1231 times)

0 Members and 1 Guest are viewing this topic.

voodzia

  • Guest
to make halo start in the air via script
« on: 17 Apr 2005, 18:01:41 »
Hi,
It's me again and this time I got another chopper and another problem ;)
I want to create a chopper but not to be on the ground. I want it to fly immediately as it being created. So I wrote this:
Code: [Select]
bird = "UH60" createVehicle  [getPos carrier select 0, getPos carrier select 1, 500]
bird setDir 0
bird flyInHeight 250

~1
"SoldierWPilot" createUnit [getPos carrier, alpha, "bird_pilot=this", 1, "LIEUTENANT"]
[bird_pilot] join grpnull;
w_plts = group bird_pilot
bird_pilot assignAsDriver bird
bird_pilot moveInDriver bird

~1
"SoldierWPilot" createUnit [getPos carrier, w_plts, "bird_gunner=this", 1, "SERGEANT"]
bird_gunner assignAsGunner bird
bird_gunner moveInGunner bird

bird_pilot action ["engineON", bird]
Btw, carrier is a GL not a real aircraft carrier ;)
Unfortunately something is wrong here because chopper is on the ground and moreover the engine is off.
Could you tell me what did I do wrong this time?
Thank you in advance for your help.
Kind regards,
voodzia

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:to make halo start in the air via script
« Reply #1 on: 17 Apr 2005, 18:10:58 »
Try :

bird action ["engine on", bird]

or

bird action ["engine on"]


Planck
I know a little about a lot, and a lot about a little.

voodzia

  • Guest
Re:to make halo start in the air via script
« Reply #2 on: 17 Apr 2005, 18:16:08 »
I don't know how you guys do that but it's working. I mean the engine is ON now. But the chopper is still on the ground.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:to make halo start in the air via script
« Reply #3 on: 17 Apr 2005, 18:23:36 »
Strange......emm try creating the crew first, then create the chopper.....then immediately move the crew in and start the engine before it ploughs into the ground.

Unless I missed some typo in your example, the code looks ok....it must be my new vision.   ::)


Planck
« Last Edit: 17 Apr 2005, 18:24:18 by Planck »
I know a little about a lot, and a lot about a little.

voodzia

  • Guest
Re:to make halo start in the air via script
« Reply #4 on: 17 Apr 2005, 18:51:27 »
I did as you said but it doesn't work. I even increased height to 1000m but it didn't help either :(

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:to make halo start in the air via script
« Reply #5 on: 17 Apr 2005, 18:55:58 »
I think I'll fire up OFP and have a go myself.


Planck
I know a little about a lot, and a lot about a little.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:to make halo start in the air via script
« Reply #6 on: 17 Apr 2005, 19:28:49 »
try attached...

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:to make halo start in the air via script
« Reply #7 on: 17 Apr 2005, 19:47:47 »
I got it to work, but I created the chopper at [0,0,0] first, then setpos'ed it to 'carrier'.......however it needs about 800 metres to survive.

Also it just lands on the ground and ignores the flyinheight command.

Try out bedges example though.


Planck
I know a little about a lot, and a lot about a little.

voodzia

  • Guest
Re:to make halo start in the air via script
« Reply #8 on: 17 Apr 2005, 21:22:03 »
I made some changes in my code as you suggested me and now this script looks like this:
Code: [Select]
"SoldierWPilot" createUnit [getPos carrier, alpha, "bird_pilot=this", 1, "LIEUTENANT"]
[bird_pilot] join grpnull
w_plts = group bird_pilot
"SoldierWPilot" createUnit [getPos carrier, w_plts, "bird_gunner=this", 1, "SERGEANT"]
bird = "UH60" createVehicle  [0,0,0]
bird_pilot moveInDriver bird
bird_gunner moveInGunner bird
bird action ["engine ON", bird]
bird setPos [getPos carrier select 0, getPos carrier select 1, 900]
bird flyInHeight 200
bird setDir 0
Code is almost OK I hope - I just need to make this chopper to hover over the carrier object - because now I don't know why but it's landing on the ground :( Or it'd be even better if I could make this halo to have some WP's and follow them. Could you tell me how am I to do that?

EDIT: bedges script works fine but I don't understand actually how it works. And that's why I'd like to stick to my script - if it's possible of course.
« Last Edit: 17 Apr 2005, 21:24:50 by voodzia »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:to make halo start in the air via script
« Reply #9 on: 17 Apr 2005, 22:00:52 »
it's the same as yours basically, all i've added is a 30 second loop which keeps the chopper in the air until the engine has started up properly.

i don't think waypoints can be added in script, but you can 'fake' them using GLs or markers, and lots of 'domove' commands. you're on the right track though - good luck :)

voodzia

  • Guest
Re:to make halo start in the air via script
« Reply #10 on: 18 Apr 2005, 17:56:14 »
Thanks bedges for that tip about "faking" WP's. It works fine and I made this chopper to move to the evac point without any problems. But afaik making AI halos to land can be a real pain in the neck so I'd like to ask if you could recommend me some good script that takes care of that operation.
EDIT: I forgot about one thing - can AI units be fast roped from default Mi17?
« Last Edit: 18 Apr 2005, 23:31:57 by voodzia »