Home   Help Search Login Register  

Author Topic: Spawn units and move to point  (Read 1189 times)

0 Members and 1 Guest are viewing this topic.

Offline Preacher1985

  • Members
  • *
  • I'm a llama!
Spawn units and move to point
« on: 09 Mar 2005, 21:56:35 »
Hey guys,


I have looked through these forums for about 3 hours now, and I've found a few things that have come close to answer my question but when I try and adapt the script or code it does'nt work for me and I dunno what im missing or doing wrong. Here's my scenario..

I need to spawn two A10's whenever I reach and activate a trigger, which are supposed to fly to a certain point on the map and airstrike (without using my MP radio/or help from me, must be AI only) a base I've built. I've no idea how to edit the few scripts and posts I've saw on the forums to get this to work for me.

So my question, how can I get the planes to spawn and fly to a waypoint

Also, finding and airstrike script that I can understand for 1.46 is hard, does anyone have a method or pre-made script that I can add into the spawn script for the planes.



I know I'm asking for alot of help here guys but im honestly stuck.


thanks

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Spawn units and move to point
« Reply #1 on: 12 Mar 2005, 11:25:23 »
this is the methodology

1) in the mission editor, create both your A10's, have them set on the ground somewhere safe and out of the way. Name them:
Air_1
Air_2

2) Create 2 gamelogics and place them where you want each aircraft to start flying
name the gamelogics.

eg
Air_1Logic
Air_2Logic
or whatever other name you feel is suitable

3) set their fuel to 0

4) Create your move,  search & destroy or whatever waypoints you need

The planes are then set to go whenever you want them too.

Now when you want them to start flying have your trigger execute a script

in this script have the following lines of code
Quote
Air_1 setfuel 1
Air_1 flyinheight 150
Air_1 setpos (getpos Air_1Logic)
;;;;;Air_1 setpos [getpos Air_1Logic select 0, getpos Air_1Logic select 1,150]

Air_1 setdir 0

Air_2 setfuel 1
Air_2 flyinheight 175
Air_2 setpos (getpos Air_1Logic)
;;;;;Air_1 setpos [getpos Air_2Logic select 0, getpos Air_2Logic select 1,175]

Air_2 setdir 0
exit

NB>>>>
.....a) If the first setpos line (in blue) has the plane crash to the ground, use the second blue setpos lines, this will hopefully setpos the plane at a decent height

.....b) Edit the red number so that the aircraft are pointing towards the first move waypoint

..... c) make sure the first move waypoint is on a sensible route between the gamelogics and the next waypoint

When the trigger activates, the script will give the A10's fuel, set them high in the sky and will fly through their waypoints.


If an "Attack" effect is all that is required, then you can create a laser guided bomb at the location you want the explosion, say by having a waypoint run a script that createvehicle'2 the bomb at the appropriate time and place

alternatively, the A10's will automatically attack the heighest threat they see, which is normally a piece of manned armour.


Have the aircraft flyinheight 20 to 40 for a really nice low level attack


hope that helps you.


There are other ways to do this, but thats the simplest



You can simplify this further, by simply having the aircraft on the ground underneath the location you want them to start flying in, and then there is no need for the gamelogics or the setpos command, simply run the flyinheight command
« Last Edit: 12 Mar 2005, 11:27:56 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Preacher1985

  • Members
  • *
  • I'm a llama!
Re:Spawn units and move to point
« Reply #2 on: 13 Mar 2005, 00:31:47 »
Thanks buddy,

I'll give it a try ASAP

* Preacher1985 hopes it works


If it works, I'll buy you a pint  8)