Home   Help Search Login Register  

Author Topic: Createunit special function  (Read 1493 times)

0 Members and 1 Guest are viewing this topic.

BrAinOfJ

  • Guest
Createunit special function
« on: 19 Jan 2006, 14:48:25 »
Hey guys,
Making a script in which i need a helicopter to be created, and start airbourne. Dunno if its possible ?

For lag reasons it needs to not be there until its called for, for effects reasons (players hearing the engine starting) i would like it airbourne.

Anyone able to help on this one ?
« Last Edit: 19 Jan 2006, 15:37:10 by BrAinOfJ »

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Createunit special function
« Reply #1 on: 19 Jan 2006, 16:49:57 »
Best way to do this, is to create your helo, with crew somewhere on the island out of harms way in the mission editor and set the helo fuel to 0

(Avoid Createunit where possible, as causes a bit of lag, especially if the type of unit doesnt already exist on the mission already)


MISSION EDITOR
create your helicopter, with crew, and any waypoints it needs
Set the helo's fuel to 0 using the fuel slider
name the helo "Helo1"
Place the helo away from any playing area, eg on an offshore island where players wont be able to get to it

Create a game logic and place it wherever you want the helo to start flying from (We will setpos the helo to this location when it is needed)
Name the gamelogic HeloLogic

and then run the following code when it's required


Helo1 setfuel 1
Helo1 flyinheight 50
Helo1 setpos  [getpos Helologic select 0,(getpos helologic select 1), 200]

the value 50 is the crusing height that you want the helo to fly at, once it steadies itself out, edit this flyinheight value to create your desired effect

the value 200 is the height above ground that the helo will be setpos'd to before it starts flying.
This value could be reduced somewhat, experimentation will give you the desired effect

make sure the first waypoint is a sensible path from the gamelogic
« Last Edit: 19 Jan 2006, 16:50:50 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re:Createunit special function
« Reply #2 on: 20 Jan 2006, 03:19:02 »
The easiest way to create a chopper in the air is just create it on the ground and tell the pilot to fly. As soon as his getpos select 2 is more than one you can just setpos him to the position you want.

If you are trying to create a chopper with the engine already running I don't think its possible.
I like your approach, lets see your departure.
Download the New Flashlight Script!