Home   Help Search Login Register  

Author Topic: Eject then kill plane trigger??  (Read 740 times)

0 Members and 1 Guest are viewing this topic.

rancor_man67

  • Guest
Eject then kill plane trigger??
« on: 17 Mar 2003, 07:34:18 »
Hi,

I have a mission were i want a plane to get shot down, the pilot ejects, and the plane crashes.

Two big problems with this:

1) the Shilka normally MISSIES the plane. (the planes is a Tornado)
2) when the Shilka Does hit the plane, the pilot dies, and has no chance to eject.

I thought that i could have two triggers, close together.

One would make the pilot eject, then the second one would make the plane exploade, looking like it had been hit!!

How do i do this?? Or does anyone else have a better idea??

Thanks,

Rancor.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Eject then kill plane trigger??
« Reply #1 on: 17 Mar 2003, 12:11:40 »
Increase the skill of the Shilka.     Experiment with doTarget and doFire commands.   Try putting it in a better place.    Have two Shilkas.    Add an AA soldier.     Whatever.

Make a trigger:

Condition:    tornado1 getdammage > 0.5
On activation:   blowup=true;  pilot1 setdammage 0; the pilot ejects

can't remember how to make the loon eject, but its an action and you can find out how in the Unofficial command ref in the Editors Depot.

Second trigger

Countdown:     3   3   3    
Condition:   blowup
On activation:   tornado1 setdammage 1 (or setFuel 0?)

This answer is just a sketch, you'll need to check the syntax and play with the numbers.
Plenty of reviewed ArmA missions for you to play

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re:Eject then kill plane trigger??
« Reply #2 on: 17 Mar 2003, 22:07:21 »
loon action["EJECT", aeroplane]

loon being the name of the pilot, and aeroplane being the name the aircraft.


;D macguba's solution looks good, although you might want to make an "emergency trigger" in case the plane doesn't get hit, i.e the same only that the loon will eject once it reaches a certain point and a couple of seconds later the plane will explode. Yes...

G'luck.

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

rancor_man67

  • Guest
Re:Eject then kill plane trigger??
« Reply #3 on: 18 Mar 2003, 04:30:49 »
ok, I'll give that a try.

Thanks very much guys!!

 :) :) :) :) :) :)

Rancor

rancor_man67

  • Guest
Re:Eject then kill plane trigger??
« Reply #4 on: 18 Mar 2003, 12:31:05 »
ok, tried it.

Works well.... mostley....

The getdammage thingo dosen't work, the syntax is wrong i think.

I fixed the triggers so that the plane catches fire, leving a nice smoke trail. The pilot and co-pilot then eject, and the plane hits the ground and blows up. (actually, it sometimes exploades in the air!!)

The main problem is that half the time the pilot/ co-pilot gets killed as soon as they eject. They seem to take turns each 'Retry'.

Any other ideas??

Everything else works great though!!!  :) :) :)

Rancor

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Eject then kill plane trigger??
« Reply #5 on: 18 Mar 2003, 12:46:47 »
look up getdammage in the command ref .... I think its getdammage pilot, not pilot getdammage.

Never trust my syntax, always look it up ;)

If the loons are dying then you need to heal them more often with setdammage 0.    Have a repeatedly trigger running with that in the on activation field.
Plenty of reviewed ArmA missions for you to play

Offline Tenchu

  • Members
  • *
  • No Comment
Re:Eject then kill plane trigger??
« Reply #6 on: 18 Mar 2003, 14:32:45 »
I had something similar in one of my many unfinished...forgotten missions and Dinger (Thanks Dinger :) ) wrote the code for me to make the plane blow up and the pilot eject.

Here is the code

removeallweapons AAdude
AAdude addmagazine "9K32Launcher"
AAdude addweapon "9K32Launcher"
AAdude reveal MyA10
AAdude dotarget MyA10
AAdude setcombatmode "BLUE"

~10
AAdude reveal MyA10
AAdude dofire MyA10
_a10driver = MyA10d
_cam camsettarget MyA10
~1
_cam camcommit 1
@(not(someammo AAdude))
_A10driver setpos [0, 0, 1000]
;don't keep him hanging for long
AAdude setcombatmode "RED"
~.3
_cam camsetpos getpos MyA10
_cam camsetFOV .5
_cam camcommit 1
~.5
;vary this time as necessary for missile flight
~.1
bombloc = getpos MyA10
~.4
;modify delay above as necessary for effect of exploding behind aircraft
;if you want, you can use
;?(Getdammage MyA10 > .9):goto "SkipBombs"
bomb1 = "HEAT120" camcreate bombloc
bomb2 = "HEAT120" camcreate bombloc
#SkipBombs
~.5
myA10 setdammage 0
_A10driver moveindriver MyA10
_a10driver setdammage 0
~.5
_a10driver action ["Eject", MyA10]
mya10 setdammage .99
~2
MyA10 setdammage 4
~3
_chute = vehicle _A10Driver
_cam camsettarget _chute
_Cam camcommit 3
~3
;now set off the ordnance for some nice secondaries
bomb1 = "LaserGuidedBomb" camcreate getpos MyA10
bomb2 = "LaserGuidedBomb" camcreate getpos MyA10
MyA10 setpos [0, 0, 0]
_waittime = _Time + 11
@((getpos _chute select 2)<2)
_cam cameraeffect ["Terminate", "Back"]
camdestroy _cam
exit

this uses an AA soldier to shoot the plane but those bits could be removed for a shilka :)

also the best bit is the little switch Dinger played with the pilot so he is not in the plane when it blows up so he can't die  ;D....Or at least he shouldn't...

_A10driver setpos [0, 0, 1000]
.
.
.
.
.

myA10 setdammage 0
_A10driver moveindriver MyA10
_a10driver setdammage 0
~.5
_a10driver action ["Eject", MyA10]
mya10 setdammage .99
~2

you must fix the A10 for a short time so the pilot can get back in for the ejection but you could try

myA10 setdammage 0

You will probably have to fiddle around with the timing and the placements to get the effect just right.....I know I did :P

hope some of this helps  :)
if you don't understand just ask  ;D

Tenchu

There is a time and a place for the use of weapons.
- Miyamoto Musashi, The Book of Five Rings, The Ground Book

Strangelove

  • Guest
Re:Eject then kill plane trigger??
« Reply #7 on: 18 Mar 2003, 21:02:57 »
Cut and paste

A boon or a bane?

Discuss.  ;)

rancor_man67

  • Guest
Re:Eject then kill plane trigger??
« Reply #8 on: 19 Mar 2003, 00:31:23 »
CRICKEY!!!  :o :o :o

Is that a script or something in the trigger????

I am no good at anything to do with scripting but i think i will give it a try!!

Thanks very much.


p.s: I dont understand  ;D

rancor_man67

  • Guest
Re:Eject then kill plane trigger??
« Reply #9 on: 20 Mar 2003, 11:18:25 »
Ok, i think its a script. I have never used scripts in any of my missions befoure. How do i get this excellent code to work???

Thanks,


Rancor

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Eject then kill plane trigger??
« Reply #10 on: 20 Mar 2003, 11:30:46 »
It is indeed a script.  

scripting = piece of piss

First off, read snYpir's excellent Introduction to Script Snippets.     There are some other tutes, Tutorials - Scripting - General is probably the place to go, Johan Gustaffson and Devilchaser's tutes are well thought of.   Also make sure you read Scripting Topics in the Official command ref

For a kick start look in Tutes - Getting started and download the Tutorial Mission.    It has a couple of very simple scripts with some info on how they work.     Copy one of these files to your own mission folder.   Delete the text in it and replace it (copy and paste) the stuff that Tenchu posted.     Save the file with a handy name, like ejectscript.sqs

Now create a trigger, activated as you like.    In the on activataion field write

[] exec "ejectscript.sqs"

and there you are.    The commonest problem with all this is the file managed to rename itself ejectscript.sqs.txt, so watch out for that.   You'll need to name the relevant units AAdude, MyA10 etc.     You can change the names if you like.

~5   tells the script to wait for 5 seconds

; anything starting with ; is just a note, it doesn't do anything

#skipbombs - this is a label, you can tell the script to go there with goto "skipbombs"

But go through some tutes, its all there.     Come and ask if you get stuck.
Plenty of reviewed ArmA missions for you to play

Offline Tenchu

  • Members
  • *
  • No Comment
Re:Eject then kill plane trigger??
« Reply #11 on: 20 Mar 2003, 14:40:19 »
Yea scripting and using scripts is easy once you try :P

I think macguba covered everything you need to know ???

but just make sure you save the text file with the code in it
"something.sqs" not "something.sqs.txt"

best advice read the tutes then come back and ask any Q's

The code I posted will need a lot of tweaking including the pauses which are

~12

you will need to change the numbers

In my example i used a AA soldier so if you still want to use a shilka this will need tweaking... ask if u are not sure.

also the placement of your units will need to be careful. I had my AADude on a large hill with views all around so he could track the plane in the sky  ;D if he was behind a hill or something the plane would have flowen over before he could shoot  :-X

So placement and timing are everything


That code was for an Intro so it contains some Camera scripting you might want this or you might not so  ???


Anyway glad to have helped  ;D
If you get stuck read the tuts and get back on the forums find the "Answer"  8)

Tenchu

There is a time and a place for the use of weapons.
- Miyamoto Musashi, The Book of Five Rings, The Ground Book

rancor_man67

  • Guest
Re:Eject then kill plane trigger??
« Reply #12 on: 23 Mar 2003, 01:29:17 »
ok....

This isnot for an intro.

I'll type in the script, set some random values and see what happenes!!!!  ;)

thanks.

Rancor