Jump to content
Sign in to follow this  
Meathead

Carrier launch scripts???

Recommended Posts

I did a search on this and couldnt find anything relevant...

I was wondering if anyone has any good carrier launch scripts made up for hawks Nimits or any other ship? for planes not choppers that is.

thx in advance

Share this post


Link to post
Share on other sites

Did you also post in OFPEC Forum Meathead ?

Anyway, did some (more) experimenting on the Nimitz ..... news ain't good ......

You can *realisticly* launch planes off the deck of the Nimitz using a script like NLaunch.sqs;

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; USAGE

; [Plane1,Carrier1] exec "NLaunch.sqs"

_Plane = _this select 0

_Carrier = _this select 1

[_Plane,_Carrier] exec {\hwk_uss_Nimitz\script\katapult1.sqs}

BUT .... Big buts ! sad_o.gif

- RAD F18 one of the few vehicles that DOESNT raise is landing gear while sitting on the deck with an AI Pilot

- You must trigger the katapult script AS SOON AS the AI is in control of the plane (like with a "West Present" trigger) (*X)

- There are 4 "katapult" scripts (1,2,3 & 4) to call but they ONLY activate the 2 blast shields on the MIDDLE (back) section of the ship (*Z)

*X: Why you ask? Because the AI trys to accelerate immediately. Even with the script triggered (*almost* locking the plane to the deck) the plane nose tends to drift left or right.

*Z: Why you ask? Because when you name the vehicle in the Mission Editor, you are ONLY naming one section of the ship. The Nimitz is made up of at least 4 main sections. You can only call the katapult scripts for the named/middle section. The front katapults are in-accessable via simple "name calling"

Unless someone out there knows how to call/select the other sections of the ship (via CLASS or SELECT or .... something) then you can never activate the front katapults animation.

Final note:

The "USS Nimitz" in the "Hawk - Vehicles" editor selection will construct the whole carrier for you (remember its made of many large pieces). If you choose the other "USS ....." bits in the menu you *could* construct the ship manually yourself .... BUT it is extremely difficult.

Why would you do this? Because THEN you can NAME each peice and therefore independantly call the 2 katapults on the front section and the 2 katapults on the back section ...... best of luck smile_o.gif

oh ... and I know katapult is spelt with a "c" smile_o.gif .... I'm just following Hawks spelling/translation. biggrin_o.gif

Share this post


Link to post
Share on other sites

Oh and BTW .... if you wanted to try you hand on a "manual Launch" script, you could use this as a start. Its the basic katapult script from HAWK Nimitz.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_vehicle = _this select 0

_carier = _this select 1

_agle = abs((getDir _vehicle) - (getDir _carier))-180

? (_agle < 4) && (_agle > 2) :_vehicle vehiclechat format["%1: %2",Localize "STR_nimitz_badagle",_agle]; exit

_thrust = 0

_vel = 200

_carier animate ["katapulta1",1]

_vehicle vehiclechat format["%1....",Localize "STR_nimitz_Catapult1"]

_i=0

#stop

_vehicle setVelocity[0,0,(velocity _vehicle select 2)];

_i=_i+1

~0.1

? (_i<50):goto "stop"

_vehicle vehiclechat format["%1,%2,%3 ....",Localize "STR_nimitz_Catapult2",Localize "STR_nimitz_Catapult3",Localize "STR_nimitz_Catapult4"]

_vehicle vehiclechat "5"

_i=0

#stop1

_vehicle setVelocity[0,0,(velocity _vehicle select 2)];

_i=_i+1

~0.1

? (_i<10):goto "stop1"

_vehicle vehiclechat "4"

_i=0

#stop2

_vehicle setVelocity[0,0,(velocity _vehicle select 2)];

_i=_i+1

~0.1

? (_i<10):goto "stop2"

_vehicle vehiclechat "3"

_i=0

#stop3

_vehicle setVelocity[0,0,(velocity _vehicle select 2)];

_i=_i+1

~0.1

? (_i<10):goto "stop3"

_vehicle vehiclechat "2"

_i=0

#stop4

_vehicle setVelocity[0,0,(velocity _vehicle select 2)];

_i=_i+1

~0.1

? (_i<10):goto "stop4"

_vehicle vehiclechat "1"

_i=0

#stop5

_vehicle setVelocity[0,0,(velocity _vehicle select 2)];

_i=_i+1

~0.1

? (_i<10):goto "stop5"

_vehicle vehiclechat format["%1",Localize "STR_nimitz_Catapult5"]

#turbos

?(speed _vehicle) < 20 : _trust = 3;goto "speed";

?(speed _vehicle) < 30 : _trust = 3;goto "speed";

?(speed _vehicle) < 40 : _trust = 3;goto "speed";

?(speed _vehicle) < 50 : _trust = 3;goto "speed";

?(speed _vehicle) < 100 : _trust = 3;goto "speed";

?(speed _vehicle) < 150 : _trust = 3;goto "speed";

?(speed _vehicle) < 200 : _trust = 3;goto "speed";

#speed

_vehicle setVelocity[(_trust*(sin getDir _vehicle))+(velocity _vehicle select 0),(_trust*(cos getDir _vehicle))+(velocity _vehicle select 1),(velocity _vehicle select 2)];

~0.08

? (speed _vehicle >= -5) && (speed _vehicle <= _vel):goto "turbos"

_vehicle vehiclechat format["%1",Localize "STR_nimitz_Catapult6"]

_carier animate ["katapulta1",0]

exit

Share this post


Link to post
Share on other sites

OH ! ...... Silly me ..... I can now see whats happening in the various forums ........  *sigh*

<span style='font-size:11pt;line-height:100%'>Hey Placebo !   Here's one #@$#@$ side effect of your competition !</span>

Everyones going to get all possessive about *their* scripting. Will be interesting what happens for a month if the usual suspects who assist others clam up too because they are making missions as well ... LOL biggrin_o.gif

Maybe I should spend some time on MM'in myself then.

Nice looking sequence BTW Meathead.

Share this post


Link to post
Share on other sites

smile_o.gif all good Meathead ...... not an issue. cant load the mission due to addons .... but.

Looks like you get the F14 off the deck with a p1 setvelocity [25,-60,5] LOL .... ranther simpler than above. smile_o.gif

but one question;

- What are the p1 setdammage 0's all about ?

Cheers.

Share this post


Link to post
Share on other sites

well I set those there just as a precaution because there was a give in take there with how low I could do the setvelocity... The lower I had the plane take off it would have a tendency to bounce off the edge of the flight deck and took dammage. But at the right height I had to set it at to prevent this it just looked too ugly because the plane lifted off the deck way too early. So in the interest of keeping the launch looking good I just let the plane bounce down the flight deck and let the set dammage triggers fix it as it goes biggrin_o.gif

I never claimed to be no Scripting wizard..Im more of a Mcgyver smile_o.gif lol

ALSo I found that if you do the setvelocity just right the landing gear wont retract on ya...dont know if thats just with that plane or all of them though. I did try it with RAD F-18 a couple times and seemed to work just as well.

Share this post


Link to post
Share on other sites

thats odd...never had that happen rock.gif maybe I accidently moved the pilot to an area of the nimits where he can fall through the deck...might want to try moving him somewhere else. Dont know what to tell ya on that one sorry.

Share this post


Link to post
Share on other sites

i had him moved onto the desert island  wink_o.gif

Edit 1: he was 2 far away from the plane i moved him back on the carrier and it worked

Share this post


Link to post
Share on other sites

BTW I have noticed that the deck "faults" move from machine to machine and that sometimes the ...+19] is not the best for some missions, 20 seems a better number to stop deaths and damaged vehicles.

This could be due to Tide variations, and yes, tide does affect object placement, I've seen this while working on my "anti-sea" spectate/revive script.

Thx Meatheat .. smile_o.gif ... understand now.

Share this post


Link to post
Share on other sites
Quote[/b] ]

*Z: Why you ask? Because when you name the vehicle in the Mission Editor, you are ONLY naming one section of the ship. The Nimitz is made up of at least 4 main sections. You can only call the katapult scripts for the named/middle section. The front katapults are in-accessable via simple "name calling"

Unless someone out there knows how to call/select the other sections of the ship (via CLASS or SELECT or .... something) then you can never activate the front katapults animation.

Maybe if the other sections are named in the moment to create them, this could be made. I am not an expert in this but I think that it can take the name of the section that is named and to link it with some generic name like Section1,... SectionN.

For example if the name of the vehicle is MyCarrier the rest of the sections they would be MyCarrierSection1,...., MyCarrierSectionN

Share this post


Link to post
Share on other sites

You would have to change or override the scripts in the original addon to put each section into either a global array or individual variables.

I'm gonna do something along those line for an AI Air Traffic Control thing I'm working on, it's addon based so it will give you access to all the anims on the Nimitz.

There is a topic about this over at OFPEC:

http://www.ofpec.com/yabbse....tart=30

Air09.jpg

An AI F18 landing on the Nimitz and in the background an AI C130 landing on the Nogova North runway.

Share this post


Link to post
Share on other sites
sure thats no problem but im kinda working on my contest entry mission...If it werent for that I would just post you the mission file. Theres really not alot of scripting to how I did it. Just alot of smoke and mirrors smile_o.gif

Heres a vid of it in action:

http://myfilelocker.comcast.net/tfahler/tgDemo.WMV

Hey Meathead, would I be able to have the soundtrack which you used in your video??

PM me if possible.

Thanks smile_o.gif

Share this post


Link to post
Share on other sites
Gnat @ June 13 2004,15:06)]Did you also post in OFPEC Forum Meathead ?

Anyway, did some (more) experimenting on the Nimitz ..... news ain't good ......

You can *realisticly* launch planes off the deck of the Nimitz using a script like NLaunch.sqs;

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; USAGE

; [Plane1,Carrier1] exec "NLaunch.sqs"

_Plane = _this select 0

_Carrier = _this select 1

[_Plane,_Carrier] exec {\hwk_uss_Nimitz\script\katapult1.sqs}

BUT .... Big buts ! sad_o.gif

- RAD F18 one of the few vehicles that DOESNT raise is landing gear while sitting on the deck with an AI Pilot

- You must trigger the katapult script AS SOON AS the AI is in control of the plane (like with a "West Present" trigger) (*X)

- There are 4 "katapult" scripts (1,2,3 & 4) to call but they ONLY activate the 2 blast shields on the MIDDLE (back) section of the ship (*Z)

*X: Why you ask? Because the AI trys to accelerate immediately. Even with the script triggered (*almost* locking the plane to the deck) the plane nose tends to drift left or right.

*Z: Why you ask? Because when you name the vehicle in the Mission Editor, you are ONLY naming one section of the ship. The Nimitz is made up of at least 4 main sections. You can only call the katapult scripts for the named/middle section. The front katapults are in-accessable via simple "name calling"

Unless someone out there knows how to call/select the other sections of the ship (via CLASS or SELECT or .... something) then you can never activate the front katapults animation.

Final note:

The "USS Nimitz" in the "Hawk - Vehicles" editor selection will construct the whole carrier for you (remember its made of many large pieces). If you choose the other "USS ....." bits in the menu you *could* construct the ship manually yourself .... BUT it is extremely difficult.

Why would you do this? Because THEN you can NAME each peice and therefore independantly call the 2 katapults on the front section and the 2 katapults on the back section ...... best of luck smile_o.gif

oh ... and I know katapult is spelt with a "c" smile_o.gif .... I'm just following Hawks spelling/translation. biggrin_o.gif

@[APS]Gnat

Am I able to stop the plane drifting? I'm just saying because I have a mission but there are two other planes stationary on the front two catapults, and when i use your script to make a plane on catapult1 take off - it crashes into the two stationary ones.

Is there anyway I can stop this  rock.gif

EDIT: I'm using the Rad F18s - is that the problem?

Thanks

Aook smile_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]Is there anyway I can stop this

Use a loop every 0.01 seconds and keep calling setDir:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

STOPLOOP=False

_Dir=GetDir _Plane

#Loop

_Plane SetDir _Dir

~0.01

If !(STOPLOOP) Then {goto "Loop"}

Calling this code while your stationary will lock the plane in the direction it was facing. As soon as you have taken off just set STOPLOOP to True.

Oh and to get the other sections of the Nimitz using scripts just use either NearestObject or the NearestBuilding command. You will have to mess around getting the correct positions relative to the Main section of the Nimitz.

When I get the chance I will right a function to return all the relevant bits.

Share this post


Link to post
Share on other sites

This still isn't working for me  sad_o.gif  Maybe i'm doing something wrong.....lets see.....

1) I have a West activated trigger which starts as soon as the mission does which contains <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[Plane1,Carrier1] exec "catapult.sqs"; [plane1] exec "takeoffloop.sqs";

Catapult.sqs

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; USAGE

; [Plane1,Carrier1] exec "catapult.sqs"

_Plane = _this select 0

_Carrier = _this select 1

[_Plane,_Carrier] exec {launch.sqs}

takeoffloop.sqs

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">STOPLOOP=False

_Dir=GetDir _Plane

#Loop

_Plane SetDir _Dir

~0.01

If !(STOPLOOP) Then {goto "Loop"}

launch.sqs<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_vehicle = _this select 0

_carier = _this select 1

_agle = abs((getDir _vehicle) - (getDir _carier))-180

? (_agle < 4) && (_agle > 2) :_vehicle vehiclechat format["%1: %2",Localize "STR_nimitz_badagle",_agle]; exit

_thrust = 0

_vel = 200

_carier animate ["katapulta1",1]

_vehicle vehiclechat format["%1....",Localize "STR_nimitz_Catapult1"]

_i=0

#stop

_vehicle setVelocity[0,0,(velocity _vehicle select 2)];

_i=_i+1

~0.1

? (_i<50):goto "stop"

_vehicle vehiclechat format["%1,%2,%3 ....",Localize "STR_nimitz_Catapult2",Localize "STR_nimitz_Catapult3",Localize "STR_nimitz_Catapult4"]

_vehicle vehiclechat "5"

_i=0

#stop1

_vehicle setVelocity[0,0,(velocity _vehicle select 2)];

_i=_i+1

~0.1

? (_i<10):goto "stop1"

_vehicle vehiclechat "4"

_i=0

#stop2

_vehicle setVelocity[0,0,(velocity _vehicle select 2)];

_i=_i+1

~0.1

? (_i<10):goto "stop2"

_vehicle vehiclechat "3"

_i=0

#stop3

_vehicle setVelocity[0,0,(velocity _vehicle select 2)];

_i=_i+1

~0.1

? (_i<10):goto "stop3"

_vehicle vehiclechat "2"

_i=0

#stop4

_vehicle setVelocity[0,0,(velocity _vehicle select 2)];

_i=_i+1

~0.1

? (_i<10):goto "stop4"

_vehicle vehiclechat "1"

_i=0

#stop5

_vehicle setVelocity[0,0,(velocity _vehicle select 2)];

_i=_i+1

~0.1

? (_i<10):goto "stop5"

_vehicle vehiclechat format["%1",Localize "STR_nimitz_Catapult5"]

#turbos

?(speed _vehicle) < 20 : _trust = 3;goto "speed";

?(speed _vehicle) < 30 : _trust = 3;goto "speed";

?(speed _vehicle) < 40 : _trust = 3;goto "speed";

?(speed _vehicle) < 50 : _trust = 3;goto "speed";

?(speed _vehicle) < 100 : _trust = 3;goto "speed";

?(speed _vehicle) < 150 : _trust = 3;goto "speed";

?(speed _vehicle) < 200 : _trust = 3;goto "speed";

#speed

_vehicle setVelocity[(_trust*(sin getDir _vehicle))+(velocity _vehicle select 0),(_trust*(cos getDir _vehicle))+(velocity _vehicle select 1),(velocity _vehicle select 2)];

~0.08

? (speed _vehicle >= -5) && (speed _vehicle <= _vel):goto "turbos"

_vehicle vehiclechat format["%1",Localize "STR_nimitz_Catapult6"]

_carier animate ["katapulta1",0]

exit

2) Then to have STOPLOOP=True I have a "move" waypoint that is completed when the plane is theoretically away from the carrier.

3)This still causes the plane to crash into the other parked planes.

Any help would be greatly appreciated...

Aook  crazy_o.gif

Share this post


Link to post
Share on other sites

You have to call the loop script from the planes init field. The AI has it's own ideas as soon as you put it in a plane with fuel.

If your on the desert island, or an island that has nor runway or taxi way defined. The AI will try and take off straight away. Point the Nimitz at position [0,0,0] your plane will take off in a straight line without the need for scripts.

If there is a runway defined the AI will try and taxi directly to it, and probably fall off the side smile_o.gif

I called this straight from an F18's init field:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[Nimitz01,Plane01] Exec "NimtzLaunch.sqs"

NimitzLaunch.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Carrier=_This Select 0

_Plane=_This Select 1

[_Plane] Exec "TakeOffLoop.sqs"

Hint Format ["Back Section \n%1\n\nFront Section \n%2",_Carrier,NearestBuilding GLFront]

_Count=0

#Loop

_Vel=Velocity _Plane

_Plane Setvelocity [(_Vel Select 0) * 1.01,(_Vel Select 1) * 1.01,_Vel Select 2]

~0.1

_Count=_Count+1

If (_Count<50) then {goto "Loop"}

STOPLOOP=True

Oh. I added the line to get the other sections of the Nimtz for the animations.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Hint Format ["Back Section \n%1\n\nFront Section \n%2",_Carrier,NearestBuilding GLFront]

GLfront is just a Game Logic I placed close to the section I wanted.

Air15.jpg

Doh!...I forgot the parameter in the Loop code I posted before.

takeoffloop.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Plane=_This Select 0

STOPLOOP=False

_Dir=GetDir _Plane

#Loop

_Plane SetDir _Dir

~0.01

If !(STOPLOOP) Then {goto "Loop"}

It's a basic example, but you get the idea?

Share this post


Link to post
Share on other sites

Woohoo.....yeah i've got the idea, but one last question.

Is there a command to animate one of the back 2 catapults, preferably the one furthest away from the air traffic control tower, on the carrier.

Cheers

Aook smile_o.gif

Share this post


Link to post
Share on other sites

Erm doesnt this link just take us to page 1 of the topic??

(Yes i have tried dragging the link to the address bar..etc, etc)

Aook crazy_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×