Home   Help Search Login Register  

Author Topic: Aircrafts Appear  (Read 557 times)

0 Members and 1 Guest are viewing this topic.

VisciousDog

  • Guest
Aircrafts Appear
« on: 08 Sep 2003, 04:09:11 »
In my mission I am trying to get a few (Add-on) aircrafts, like 2 Su-27 Flankers to appear later (activated by a trigger) in the mission "Flying". I looked at scripts, but they seem to be Respawn scripts. Anyone know?

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Aircrafts Appear
« Reply #1 on: 08 Sep 2003, 09:31:16 »
Several ways of making stuff appear... the "createUnit" command, and "createVehicle", oh and ya can also just put two planes on the map (far away), removing ALL their fuel, and then when needed (say, if a trigger fires) the planes can have their fuel added & be setPos'ed up some 700 mtr's in the air so that they can follw whatever WP's they have.

*wheew*  :P ::)

O Neil

  • Guest
Re:Aircrafts Appear
« Reply #2 on: 08 Sep 2003, 10:44:14 »

Unitname = "Civilian2" CreateVehicle [getpos Game select 0, getpos Game select 1, 0]; "Planename" = "A10" CreateVehicle [getpos Game select 0, getpos Game select 1, 90]; This setpos [(getpos this select 0),(getpos this select 1), 200]; Unitname moveindriver A10

That might work ;)

O'Neil

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Aircrafts Appear
« Reply #3 on: 08 Sep 2003, 11:22:29 »
If lag is not a problem for you I suggest you do it with setpos, because creating units / vehicles during mission will cause a small short time lagging experiance (depending on how much/different units you create) which is not nice.

Put up them planes in the editor with 'special' set to 'none' and fuel set to 0. Name the planes and in a trigger or script or whatever activate a few lines:
plane1 setfuel 1
plane2 setfuel 1
plane1 setpos [getpos plane1 select 0, getpos plane1 select 1,(getpos plane1 select 2)+1000]
plane2 setpos [getpos plane2 select 0, getpos plane2 select 1,(getpos plane2 select 2)+1000]
plane1 flyinheight 180
plane2 flyinheight 200

Moving the planes you can do two ways. Either set waypoints to the planes, or place empty markers and use:
plane1 move getmarkerpos "markername"
plane2 move getmarkerpos "markername"

If you need the planes to patrol around some area I suggest waypoints. If you need the planes to just fly to some point I suggest the marker method.
Not all is lost.

GaryP

  • Guest
Re:Aircrafts Appear
« Reply #4 on: 08 Sep 2003, 14:22:54 »
Quote
If you need the planes to patrol around some area I suggest waypoints. If you need the planes to just fly to some point I suggest the marker method.

Ca you please tell me what the "marker method" is?  I have only done waypoints.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Aircrafts Appear
« Reply #5 on: 08 Sep 2003, 14:55:03 »
---easy info---

It's just moving the unit with direct commands instead of waypoints. Lags less, depending on how it's used..  ::)

Create a marker of type "empty" (type "empty" unless you want the marker to be shown on map)
Name the marker logically.. maybe something like plane1move1
In a trigger or script or whatever you can then use the move commands:

unitname move getmarkerpos "markername"

the "" quotes are essential.. so with your plane it could look something like this:
plane1 move getmarkerpos "plane1move1"

---easy info ends---

---stuff ment to confuse you starts---

You can also use 'domove' command. The difference is that with domove a single unit moves and with move the whole squad moves.. if I'm correct. But that's really not important because I assume you will have your planes as their own separate groups (ie not grouped together).

Furthermore if you don't want to use 'getmarkerpos' command you can use 'getpos' with any object or unit found on map. It's very popular to use gamelogics to give positions.. however I prefer markers.. it's just me. To use game logics your command line could look something like this:
plane1 move getpos gl1

Where gl1 is a gamelogic named as gl1. Note that you don't use the "" quotes as you do with the getmarkerpos command. Also note that as I said above it doesn't have to be a gamelogic, you can use what ever objects on the map, if they happen to be/ if you place them, to a spot suitable for you.

---stuff ment to confuse you ends---

---smartass stuff starts---

You can also use these commands so that you don't have to use gamelogics or markers. What the getpos and getmarkerpos do is they take the x,y,z coordinates of an object/marker (except getmarkerpos only x and y coordinates if I remember correctly). So why not input your own coordinates directly? Yes, why not.

plane1 move [x,y,z]
plane1 move [6000,7000,100]
x is east/west, y is north/south, z is height.

You can get the coordinates easily by using the camera.sqs method.. which can be found in the FAQ I assume. try searching with keywords 'camera.sqs' or 'coordinates' if you really really want to get into this


edit
btw I just typed so much useless information just to make Tomb look bad  ;) ;D
---smartass stuff ends---
/edit
« Last Edit: 08 Sep 2003, 14:56:43 by Artak »
Not all is lost.

GaryP

  • Guest
Re:Aircrafts Appear
« Reply #6 on: 08 Sep 2003, 18:37:01 »
Very cool.  Thanks.  I did not know markers has a position in the real game.  I thought that they just applied to maps.