Jump to content
Sign in to follow this  
Meathead

Carrier launch scripts???

Recommended Posts

Quote[/b] ]I know. But if you read you can activate the BACK ones, you just can't activate the front ones ...... unless you can answer this problem

I did, in my last post:

<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]

Assuming the front animation is called with the same name, just use the same command you use for the back section. But pass in the reference returned from the game logic I mentioned:

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

Is it possible to contact Hawk about the Nimitz? I could add the scripts to handle all the anims for any number of carriers in a mission.

Share this post


Link to post
Share on other sites

ok unnamed_ ..... your right ... we can do it that way!

As for contacting Hawk, forget it, he seems to have moved on to other things. I was basically was the last person to modify the addon.

If you have an idea how to get the 4 catapults to work for any number of carriers, let me know, cuz I can't see how to do it, even with the code below.

<span style='font-size:12pt;line-height:100%'>Carrier Catapult Script</span>

<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

_Carrier = _this select 1

_Pad = _this select 2

_FrontGL = _this select 3

; catapult launch script by Gnat, for USS NIMITZ addon

; per UNNAMED's idea, a GameLogic has to be placed just forward

; of the bridge to enable the front catapults to be used. (_FrontGL)

; although Nimitz has 4 catapult scripts/animations, they seem

; to be copies of just 2 scripts.

?(_Pad == 1) : goto "pad1"

?(_Pad == 2) : goto "pad2"

?(_Pad == 3) : goto "pad3"

?(_Pad == 4) : goto "pad4"

exit

#pad1

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

exit

#pad2

[_Plane,NearestBuilding _FrontGL] exec {\hwk_uss_Nimitz\script\katapult2.sqs}

exit

#pad3

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

exit

#pad4

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

exit

use; [Plane1, Carrier1, 2, GLFront] exec "NLaunch.sqs"

Catapults are as per this;

NimitzCat.jpg

Share this post


Link to post
Share on other sites
Quote[/b] ]If you have an idea how to get the 4 catapults to work for any number of carriers.

Use a bit of Trigonometry and camcreate the game logic as a local variable:

<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

_Dir=GetDir _Carrier

_Pos=GetPos _Carrier

_Dir=_Dir+180

? _Dir>360 : _Dir=_Dir-360

_XOffset=Sin(_Dir)*50

_YOffset=Cos(_Dir)*50

_Logic="Logic" CamCreate [(_Pos Select 0)+_XOffset,(_Pos Select 1)+_YOffset,_Pos Select 2]

_Front=NearestBuilding _Logic

DeleteVehicle _Logic

Hint Format ["Front %1",_Front]

When the Nimitz is at zero degrees, you have to have the Game Logic behind it (180 degrees) and about 50 meters away to get the front section. So just camcreate a Game Logic in the right place and delete it, for each version of the nimitz.

Quote[/b] ]As for contacting Hawk, forget it, he seems to have moved on to other things.

Shame, I wanted to fix the altitude bugs in his version of the C5-Galaxy and Antonov. Perhaps I could post up the fixes anyway, assuming I'm not pushing it, submitting them on his behalf?

Share this post


Link to post
Share on other sites
Quote[/b] ]Game Logic in the right place and delete it, for each version of the nimitz

Problem is, what are we planing to name the front section of each Nimitz so a user can access the catapults ?

We can name it something similar to the name the user has given the ship, ie User names it "Nimitz1", we name the front "Nimitz1_Front". ...... BUT because of a "no way" answer per my previous posted problem on custom names, there is NO WAY to get that user defined name string from the OFP:R engine.

We can always hardcode the name ("NimitzFront") BUT then you can't use more than one Nimitz in a mission. We can't random name it, because then the user who wants to call the catapult script doesnt know what its called.

ie ...... using the Gamelogic etc is fine, but the naming of each section of the multi-addon addon just wont work ... as far as I can see.

One option may be to break the ship into 2 when its built, a front and a back, that way they each can be named.

Problem is of course, if you move one piece you gotta make sure the other is moved at the same time.

Somehow I think your/my script above is a better solution, until a whole new Nimitz is made ! biggrin_o.gif

Quote[/b] ]fix the altitude bugs in his version of the C5-Galaxy and Antonov

Whats the problem? Maybe I can de-PBO them and help.

Share this post


Link to post
Share on other sites

There are a couple more ways of doing it. The Game Logic version is a bit wastefull, creating and deleting a temporoary Logic, every time you need an animation.

You could create global variables on the fly using the call command, this might be better of MP? Using a global counter you could create global variables that point to each version. NimitzFront1,NimitzBack1,NimitzFront2,NimitzBack2 e.t.c

But for myself, I will be using a global array to store all the copies of the Nimitz and each section. Then you just have to look for the Nimitz in the array to get all the sections.

I need to do this for my landing scripts, it will mean altering Init.sqs so it adds each Nimitz created. Perhaps I could talk more with you when I know what needs to be included?

It would be better to have a version of the Nimitz that was already compatible with my AI scripts, rather than releasing another addon to plug into your version.

Quote[/b] ]Whats the problem? Maybe I can de-PBO them and help.

It was the Roadway LOD's, they screw up the GetPos Z value so I cant tell how high the planes are. There is a work around, but I need to move the Roadway's back a couple of meters so the are not directly under the pilots.

Easy enough to do, it's just distributing someone elses addon, without there permission. Not that I would ever try and claim credit for it, I was not sure if it's the done thing?

Cheers

Share this post


Link to post
Share on other sites
Quote[/b] ]move the Roadway's back a couple of meters so the are not directly under the pilots

Oops, when you said altitude, I assumpted coding was need, not object editing ..... sorry you'll need an other person to help there.

Quote[/b] ]Using a global counter you could create global variables that point to each version

Ok, I'm with you, ... but how does the mission maker/user know what each nimitz is called ? I cant think of a non-intrusive way of the mission maker being able to see it ...

Share this post


Link to post
Share on other sites
Quote[/b] ]Oops, when you said altitude, I assumpted coding was need, not object editing ..... sorry you'll need an other person to help there.

I can do all the required changes, I just wanted the fixed planes to be available to anyone else who wanted to use them. I will go a head and post the new versions at OFP Info on Hawks behalf, and hope he wont get to annoyed with me. If I find his contact details, I can always let him know.

Quote[/b] ]Ok, I'm with you, ... but how does the mission maker/user know what each nimitz is called ? I cant think of a non-intrusive way of the mission maker being able to see it ...

The easiest way is to make NLaunch.sqs look something like this:

<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

_Carrier = _this select 1

_Pad = _this select 2

?(_Pad in [1,2]) : goto "FrontPad"

?(_Pad == 3) : [_Plane,_Carrier] exec {\hwk_uss_Nimitz\script\katapult1.sqs}

?(_Pad == 4) : [_Plane,_Carrier] exec {\hwk_uss_Nimitz\script\katapult2.sqs}

exit

#FrontPad

_Dir=GetDir _Carrier

_Pos=GetPos _Carrier

_Dir=_Dir+180

? _Dir>360 : _Dir=_Dir-360

_XOffset=Sin(_Dir)*50

_YOffset=Cos(_Dir)*50

_Logic="Logic" CamCreate [(_Pos Select 0)+_XOffset,(_Pos Select 1)+_YOffset,_Pos Select 2]

_Front=NearestBuilding _Logic

DeleteVehicle _Logic

?(_Pad == 1) : [_Plane,_Front] exec {\hwk_uss_Nimitz\script\katapult1.sqs}

?(_Pad == 2) : [_Plane,_Front] exec {\hwk_uss_Nimitz\script\katapult2.sqs}

exit

Then just call it with:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[Plane1,Carrier1,2] Exec exec "NLaunch.sqs"

Share this post


Link to post
Share on other sites

I've been messing with the Nimitz.6 and the original scripts on the Malden Island. It seems that in order for the planes to takeoff correctly the Carrier needs to be pointed in the direction of the nearest landing strip on land. At least I got all 4 planes to takeoff from the deck and it looks quite impressive I think. I just cant seem to get the afterburners to kick in.

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  

×