View Full Version : LHD (Aircraft Carrier) spawning script
armatech
Jun 6 2009, 11:15
http://i193.photobucket.com/albums/z232/ArMaTeC/arma22009-06-0611-51-07-89.png (http://i193.photobucket.com/albums/z232/ArMaTeC/arma22009-06-0611-51-07-89.png)
LHD (Aircraft Carrier)
I created this simple script that you can now create the Aircraft Carrier any where on the map and on any island
Example mission and script
Script Version
http://rapidshare.com/files/241430421/LHD_Spawner.utes.rar (http://rapidshare.com/files/241430421/LHD_Spawner.utes.rar)
Addon Version (Thanks to myke)
http://www.armaholic.com/datas/users/372-glt_lhd.7z
Nicholas
Jun 6 2009, 11:16
Cool, thanks! I downloaded.
Lightninguk
Jun 6 2009, 12:10
thanks using it now
schaefsky
Jun 6 2009, 12:43
Thanks, cool!
Foxhound
Jun 6 2009, 13:58
As always thanks for informing us :cool:
Release frontpaged at the Armaholic homepage (http://www.armaholic.com/page.php?id=5848).
http://www.armaholic.com/datas/users/3-animation.png (http://www.armaholic.com/page.php?id=5846)
Ammobox re-filler (http://www.armaholic.com/page.php?id=5846)
http://www.armaholic.com/datas/users/3-animation.png (http://www.armaholic.com/page.php?id=5847)
LHD spawner (http://www.armaholic.com/page.php?id=5847)
Thx for this nice scripts, ArMaTec :)
Put it on our script section at Assault Mission Studio
http://www.assaultmissionstudio.de/images/downloads/dlicon.gif (http://www.assaultmissionstudio.de/downloads.php?page_id=164)
Ammofiller script by ArMaTec
http://www.assaultmissionstudio.de/images/downloads/dlicon.gif (http://www.assaultmissionstudio.de/downloads.php?page_id=165)
LHD Spawner Script by ArMaTec
armatech
Jun 6 2009, 17:00
thanks for hosting
Thanks this is great! spawn one onto main island now :D
armatech
Jun 6 2009, 19:41
I'm working making it drivable ATM so hang fast just as soon as i can get my game to reinstall
[FRL]Myke
Jun 6 2009, 22:48
Excellent script, armatech. I've created an Editoraddon out of it which adds the LHD in the Editor under WEST/USMC/SHIPS/LHD and also under EMPTY of course.
It uses 100% of armatech's script so full credit to you mate. I've just packed a config and Editor Icon with it. Also added 2 lines to the script to make sure it runs server-side only.
You can get the addon version of armatech's script here:
http://www.armaholic.com/datas/users/372-glt_lhd.7z
armatech
Jun 7 2009, 00:54
added to first post i have not tested it yet but i guess it will work else you would not post it :bounce3:
Cyborg11
Jun 7 2009, 20:02
Addon works nice :)
Thanks for the script armatech :>
First test to make it driveable :)
http://www.youtube.com/watch?v=MOSQbXn6jQw
http://www.youtube.com/watch?v=MOSQbXn6jQw
yyccccc
Jun 12 2009, 14:02
Addon works nice :)
Thanks for the script armatech :>
First test to make it driveable :)
http://www.youtube.com/watch?v=MOSQbXn6jQw
http://www.youtube.com/watch?v=MOSQbXn6jQw
How did you make it driveable?
how to set a runway on LHD for airplanes to landing and take off ?
if i walk to the front, the player falling into the water.. thrue the Model.
Great stuff thanks. (Previous post edited as the problem I highlighted was not caused by the script as I had thought, but rather occured somewhere between the keyboard and the chair).
Killy_McMurder
Jul 21 2009, 21:12
*Edited because the other one was edited so this no longer made sense...
Um. Yeah. Seems to have sorted itself out since I read the last post. Have edited my previous post so as not to mislead anyone into thinking there's a problem with this script. Works great. Thanks mate. (Please feel free to mock me in a different thread.)
Warspite2
Jul 28 2009, 03:46
Any of you guys know how to place planes on the carrier? I went to the default location the LHD is at on the map, my troops can be placed on the deck but I can't get any planes to be on top. The planes end up below the deck and blow up. How can I get them where they are on top of the deck and can take off?
Yakavetta
Jul 28 2009, 08:49
I've recently created a mission using the LHD as a spawn point. All of the testing I do indicates that the mission was successfully created. The LHD plays out nicely.
But when I upload it to a dedicated server, I get a lot of unusual side effects. The walls appear to be clipping with themselves. The best way I can describe this is there appears to be two LHD's spawning immediately on top of each other, but at slightly different heights. I've taken a screenshot to demonstrate:
http://img.photobucket.com/albums/v190/BigDaddy5/ArmA%2031st/arma22009-07-2801-28-44-07.jpg
Yet in my editor, it looks like this:
http://img.photobucket.com/albums/v190/BigDaddy5/ArmA%2031st/arma22009-07-2723-22-45-14.jpg
This causes issues on lots of levels. Initially it caused my planes to bounce around. I was able to counteract this by raising the LHD to .4, but the walls are still offset, and it doesn't seem to really be helping it. I don't know why the planes aren't bouncing anymore, honestly, because the "ghost" LHD still appears to be above the LHD I placed in the mission editor.
Murklor
Jul 28 2009, 09:01
But when I upload it to a dedicated server, I get a lot of unusual side effects. The walls appear to be clipping with themselves. The best way I can describe this is there appears to be two LHD's spawning immediately on top of each other, but at slightly different heights.
Are you using the original script? I dont think that check if its a server, so you'll have the LHD spawning on all machines connected (ie 2 in the case of a dedicated and 1 connected player). But I cant remember since I last tried it out, cant download files right now.
Kremator
Jul 28 2009, 09:10
The MOVEABLE LHD is brilliant. I'm sure that some clever people will be able to use the attachto command to make us walk around/land on/take off from the LHD in time.
But it looks superb so far ! Keep at it !
Murklor
Jul 28 2009, 11:10
The MOVEABLE LHD is brilliant. I'm sure that some clever people will be able to use the attachto command to make us walk around/land on/take off from the LHD in time.
But it looks superb so far ! Keep at it !
And if its half as good as the carrier in BF1943 was, it's gonna be awesome to ram it into Utes :p
Yakavetta
Jul 28 2009, 11:22
Are you using the original script? I dont think that check if its a server, so you'll have the LHD spawning on all machines connected (ie 2 in the case of a dedicated and 1 connected player). But I cant remember since I last tried it out, cant download files right now.
Yes, I'm using the original script. I'm not using the editor-addon.
What's interesting, though, is it's always just "two" LHD's. Even when I have multiple people connecting to the dedicated server, it always looks like the first image. It's very difficult to try and pinpoint.
Murklor
Jul 28 2009, 11:28
Well you could try wrapping the spawn script in if(isServer) and see what happens, if the "second" carrier still spawn. Otherwise I would guess there's something borked with the carrier pieces themselves.
Yakavetta
Jul 28 2009, 11:56
The problem is I don't know if it's actually spawning a 2nd LHD, or not. I don't know what else it could be, though. All I know is when I host a mission, I don't get that "ghost" LHD, but when I toss the .pbo on a dedicated server, it's there.
I'll try the (IsServer) command, and see what happens. Thanks for the tip!
[XDF]Banksy
Aug 6 2009, 23:26
Hey guys I also seem to be getting the same issue on editor only one carrier is spawned the same when I host a mission however when the mission is put on a dedicated server there seems to be two carriers one on top of the other only very slight but definately there, to the point that any characters you place on the carrier at mission start all drop dead. Was wondering if you guys had managed to find a sove for the with the (IsServer) command in the script.
Excellent script, armatech. I've created an Editoraddon out of it which adds the LHD in the Editor under WEST/USMC/SHIPS/LHD and also under EMPTY of course.
It uses 100% of armatech's script so full credit to you mate. I've just packed a config and Editor Icon with it. Also added 2 lines to the script to make sure it runs server-side only.
You can get the addon version of armatech's script here:
http://www.armaholic.com/datas/users/372-glt_lhd.7z
Don't suppose you could tell us how you made it server-side only so that clients don't require the addon?
Nevermind, it's simply a case of adding.
if (isServer) then {
_LHDspawn = _this select 0;
_LHDdir = getdir _LHDspawn;
_LHDspawnpoint = [getposasl _LHDspawn select 0, getposasl _LHDspawn select 1, 0];
deletevehicle _LHDspawn;
_parts =
[
"Land_LHD_house_1",
"Land_LHD_house_2",
"Land_LHD_elev_R",
"Land_LHD_1",
"Land_LHD_2",
"Land_LHD_3",
"Land_LHD_4",
"Land_LHD_5",
"Land_LHD_6"
];
{
_dummy = _x createvehicle _LHDspawnpoint;
_dummy setdir _LHDdir;
_dummy setpos _LHDspawnpoint;
} foreach _parts;
};
Thanks for the scripts! :bounce3:
nominesine
Aug 21 2009, 10:10
I'be neen using this script with very good effects. Great job. A small problem though...
If I populate the ship with units (setPOSASL +15.9 meters) the ship sometimes spawns too slow. Hence my units "collide" with the deck and end up dead or bouncing (static objects and helos). setPosing them to 16.1 seems to solve this issue. But if there's many players in an MP game I suppose the spawning will be reduced even further. Has someone found out a working and simple method to prevent this from happening? I have a few static obbjects that really need to be at exactly 15.9 meters.
I encountered the same issue when creating a simple mission for MP.
Fortunately, I found a solution that works for players spawning and re-spawning on-deck and aircraft remaining stable. Unfortunately, it's still hit or miss if the AI end up in the middle of a bulkhead.
First of all, place an invisible landing pad named: LHD_Center
In the init of that unit place:
this setPosASL [getposASL this select 0, getposASL this select 1, 0]; res=[this]execVM"CreateLHD.sqf"
Then finally modify the CreateLHD.sqf so it's like this:
if (isServer) then {
_LHDspawn = _this select 0;
_LHDdir = 270;
_LHDspawnpoint = [getposasl LHD_Center select 0, getposasl LHD_Center select 1, 0];
_parts =
[
"Land_LHD_house_1",
"Land_LHD_house_2",
"Land_LHD_elev_R",
"Land_LHD_1",
"Land_LHD_2",
"Land_LHD_3",
"Land_LHD_4",
"Land_LHD_5",
"Land_LHD_6"
];
{
_dummy = _x createvehicle _LHDspawnpoint;
_dummy setdir _LHDdir;
_dummy setpos _LHDspawnpoint;
} foreach _parts;
};
Credits go to Alexei Vostrikov for his implementation of the LHD in Carrier Domination.
PhelanKA7
Aug 24 2009, 19:50
I've got a small problem with using the LHD.
I have a light source located in the big cargo area below decks. Unfortunately it illuminates the upper (outdoor) surface as well. Is there some kind of clipping plane or script I could use to illuminate ONLY cargo bay area?
Thanks for any help!
Beny.cz
Aug 25 2009, 09:12
Awesome work man!
I was wondering if it is possible to make the ship sink ... maybe some explosions would be nice.
How about using SetPos or anything else?
PorkyJack
Sep 6 2009, 00:23
That's awesome mate, I can spawn players/ammoboxes/objects on the deck, but when I try to place a fighterjet or a chopper it bounces and blows up, any solutions?
Alexei Vostrikov
Oct 10 2009, 05:35
I encountered the same issue when creating a simple mission for MP.
Fortunately, I found a solution that works for players spawning and re-spawning on-deck and aircraft remaining stable. Unfortunately, it's still hit or miss if the AI end up in the middle of a bulkhead.
First of all, place an invisible landing pad named: LHD_Center
In the init of that unit place:
this setPosASL [getposASL this select 0, getposASL this select 1, 0]; res=[this]execVM"CreateLHD.sqf"
Then finally modify the CreateLHD.sqf so it's like this:
if (isServer) then {
_LHDspawn = _this select 0;
_LHDdir = 270;
_LHDspawnpoint = [getposasl LHD_Center select 0, getposasl LHD_Center select 1, 0];
_parts =
[
"Land_LHD_house_1",
"Land_LHD_house_2",
"Land_LHD_elev_R",
"Land_LHD_1",
"Land_LHD_2",
"Land_LHD_3",
"Land_LHD_4",
"Land_LHD_5",
"Land_LHD_6"
];
{
_dummy = _x createvehicle _LHDspawnpoint;
_dummy setdir _LHDdir;
_dummy setpos _LHDspawnpoint;
} foreach _parts;
};
Credits go to Alexei Vostrikov for his implementation of the LHD in Carrier Domination.
I'm still amazed how many people had a look at my carrier domination and used the tricks i found not sleeping for 1 week on it :P
vengeance1
Oct 10 2009, 14:25
Alexei, I sent you something that works fine using Revive take a look at your PM.
Arma-2-Guru
Oct 11 2009, 11:53
Great! I was sick of using the one in Utes, Chernarus will be much better for it, thanks.
Megahurt50
Feb 16 2010, 16:24
What do you put in the init of a unit that starts on the carrier deck?
Im trying to use the carrier deck as a starting point for an Airborne insertion team that either on a UH Y or ready to board it. Please help with instructions a newbie can use.
Model 299
Jul 27 2010, 08:45
I know this is an older script, but I thought it was significant. I'm wondering why when I run the LHD script my arma2.RPT file seems to be written to in a loop, as long as the mission is running. The error which is repeated is:
Error position: <createvehicle _LHDspawnpoint;
_dummy set>
Error Type Any, expected Number
File C:\Users\(me)\Documents\ArmA 2 Other Profiles\Model299\missions\Annhialation.Chernarus\CreateLHD.sqf, line 20
Error in expression <d_LHD_5",
"Land_LHD_6"
];
{
_dummy = _x createvehicle _LHDspawnpoint;
_dummy set>
the complete file I'm using is
;this setPosASL [getposASL this select 0, getposASL this select 1, 0]; res=[this]execVM"CreateLHD.sqf"
;if (isServer) then {
_LHDspawn = _this select 0;
_LHDdir = 270;
_LHDspawnpoint = [getposasl _LHDspawn select 0, getposasl _LHDspawn select 1, 0];
_playersetpoint = [getposasl _LHDspawn select 0,((getposasl _LHDspawn select 1)-7), 10];
_parts =
[
"Land_LHD_house_1",
"Land_LHD_house_2",
"Land_LHD_elev_R",
"Land_LHD_1",
"Land_LHD_2",
"Land_LHD_3",
"Land_LHD_4",
"Land_LHD_5",
"Land_LHD_6"
];
{
_dummy = _x createvehicle _LHDspawnpoint;
_dummy setdir _LHDdir;
_dummy setpos _LHDspawnpoint;
} foreach _parts;
;};
I have if (isServer) commented out for now while I develop the mission in the editor. and the _playersetpoint was a local variable I was playing with to set a player on the carrier. but I'm not using it.
Anyhow I don't really understand the error, and it's repetitive, as though the game were in a loop, I end up with 35MB arma2.RPT files after just a few moments.
Any opinions would be appreciated.
*EDIT: I think it had something to do with my filesystem, cause I replaced the script again with the one in the archive posted above and arma 2 stopped complaining. Probably some special character in the text.
Model 299
Jul 29 2010, 10:02
What do you put in the init of a unit that starts on the carrier deck?
Im trying to use the carrier deck as a starting point for an Airborne insertion team that either on a UH Y or ready to board it. Please help with instructions a newbie can use.
What you have to do is setpos the units at the carrier. The problem is, that the carrier deck is technically 20 meters in the air and not at sealevel where the object is.
So, you have to getpos something at the same position as the carrier. So in the new version of the script it deletes the helipad you used so you'll have to comment that out.
deletevehicle _LHDspawn
turns to
;deletevehicle LHDspawn
it's easier not to delete the helipad because you want the position of objects that were created at it's position, and this is easier than exporting the position of the objects that were created. (cause the script uses a foreach)
now that you have that you need to modify the position and set that for your units.
so, your unit should have in it
this setpos [(getpos LHD_Center select 0),(getpos LHD_Center select 1),10]
where this is your unit, and LHD_Center is the name of the helipad you used to spawn the LHD. What it does is it uses getpos to get the numbers out of the position of the helipad. Positions are always an array of three numbers. like this [pos x east west, pos y north south, height above ground z] So you just grab the x and y coordinates out of the helipad and then set the altitude at 10 (which should put you inside the carrier, 20 will drop things on the deck) you have to play with the numbers to get things where you want them. Additionally it's possible to add or subtract meters from the coordinates.
this setpos [((getpos LHD_Center select 0) + 2),(getpos LHD_Center select 1),18.50]
this will put this two meters east of the LHD_Center position and 18.5 meters in the air. you can put -2 for two meters west, or do the same math on the other coordinate for north and south.
So basically that's it you just have to rebuild the position array with the values that you want, which are relative to the location of any object. Careful dropping helicopters on the deck, if they start out too high they'll take damage, and if they're dropped inside the carrier they're hard to fly. I doubt if AI units will stay on the deck, so you'll have to order units into an empty chopper.
I have tried both LHD scripts above and Im having a problem when I put it on a dedicated server.
The first time I start the mission on the server everything is fine. After the first time being run, my LHD spawns to slow and everything drops in the water. This happens with both the LHD scripts above.
For somereason when the server runs the mission for the first time its all good. After that its broken :-(
anyone know how I can get the boat to despawn after someone is out for 5 seconds and respawn back in the lift or add a new boat once one is let down from the life? I am trying to finish my Beach Assault MP and I am having issues trying to figure that out.
---------- Post added at 08:46 PM ---------- Previous post was at 08:44 PM ----------
veh = [this, 3600, 3600] execVM "_SunderScripts\vehicle.sqf"
that is what I usually use on the int of the vehicle on the map.
Clawhammer
Jul 7 2012, 09:14
I have tried both LHD scripts above and Im having a problem when I put it on a dedicated server.
The first time I start the mission on the server everything is fine. After the first time being run, my LHD spawns to slow and everything drops in the water. This happens with both the LHD scripts above.
For somereason when the server runs the mission for the first time its all good. After that its broken :-(
I have this problem every time i start the mission. All are spawning under the ship, not on the deck, what can i do please help!
I have the feeling that the ship spawn to late :-(
clydefrog
Jul 8 2012, 15:26
I've got a problem where some people who connect see another copy of the lights of the LHD over the water in different directions. I'm using the server compatible script so there shouldn't be any other copies of the ship or anything and I've not seen one, but this lights thing has happened a few times. Has anybody else had this happen.
Alptraum
Aug 5 2012, 07:46
I have this problem every time i start the mission. All are spawning under the ship, not on the deck, what can i do please help!
I have the feeling that the ship spawn to late :-(
http://www.armaholic.com/forums.php?m=posts&q=7119
---------- Post added at 07:46 ---------- Previous post was at 07:45 ----------
How/where do I install this?
VRCRaptor
Aug 5 2012, 18:57
http://www.armaholic.com/forums.php?m=posts&q=7119
---------- Post added at 07:46 ---------- Previous post was at 07:45 ----------
How/where do I install this?
I use the spawn LHD for my dedicated games and have no issues with it so far... on a not above with the duplicate lights thing, this script needs to be at the top of the init.sqf and cannot be loaded someplace else as this has to be the first items spawned when it hits the init.sqf. second, as for server issues and maybe duplicate lights, make sure that it is spawning once and by the server... here is what I use to spawn mine and I have used this on every map that I need it for and my team I play with report no issues with spawning on the water or under the LHD. I hope this helps, I would be glad to provide a sample script of my working version if would help... here is what I have at the top of my init.sqf
// Spawn of the LHD Carrier
if (isServer) then {
_LHDspawnpoint = [getPosASL LHD_Center select 0, getPosASL LHD_Center select 1, -0.9];
{
_dummy = createVehicle [_x, _LHDspawnpoint, [], 0, "NONE"];
_dummy setdir 228.178;
_dummy setPos _LHDspawnpoint;
} foreach ["Land_LHD_house_1","Land_LHD_house_2","Land_LHD_elev_R","Land_LHD_1","Land_LHD_2","Land_LHD_3","Land_LHD_4","Land_LHD_5","Land_LHD_6"];
};
the isserver lines are important to make sure that it only spawns on the server one time... not multiple times when each user loaded the init.sqf.
"LHD_Center" is a hidden "H" pad so the above script can reference a center point to make the LHD... :)
-VRCRaptor
clydefrog
Aug 5 2012, 19:37
Hmmm, I've been running the script from it's own file and executing it from the init line of the invisible H, not from the init.sqf. This is what I have in the invisible H called LHD_Center as told to do from this thread:
this setPosASL [getposASL this select 0, getposASL this select 1, 0]; res=[this]execVM"CreateLHD.sqf"
So you just put that code at the top of your init.sqf and then you create the invisible H with nothing in the init?
Well just tried taking that code out and adding yours to my init.sqf, changing a couple of values so it now reads
// Spawn of the LHD Carrier
if (isServer) then {
_LHDspawnpoint = [getposasl LHD_Center select 0, getposasl LHD_Center select 1, 0];
{
_dummy = createVehicle [_x, _LHDspawnpoint, [], 0, "NONE"];
_dummy setdir 270;
_dummy setPos _LHDspawnpoint;
} foreach ["Land_LHD_house_1","Land_LHD_house_2","Land_LHD_elev_R","Land_LHD_1","Land_LHD_2","Land_LHD_3","Land_LHD_4","Land_LHD_5","Land_LHD_6"];
};
Everything is there in the right place on the carrier etc so it seems fine so far, will have to test the mission again to see if it's fixed the duplicate lights problem.
This is my previous script btw also from this thread:
if (isServer) then {
_LHDspawn = _this select 0;
_LHDdir = 270;
_LHDspawnpoint = [getposasl LHD_Center select 0, getposasl LHD_Center select 1, 0];
_parts =
[
"Land_LHD_house_1",
"Land_LHD_house_2",
"Land_LHD_elev_R",
"Land_LHD_1",
"Land_LHD_2",
"Land_LHD_3",
"Land_LHD_4",
"Land_LHD_5",
"Land_LHD_6"
];
{
_dummy = _x createvehicle _LHDspawnpoint;
_dummy setdir _LHDdir;
_dummy setpos _LHDspawnpoint;
} foreach _parts;
};
VRCRaptor
Aug 5 2012, 23:18
hmmm... the dup lights thing sound like it makes more than one LHD and there have been many people with the same issue... I have not had any of those running the script I posted... its very stable and everyone I play with on the LHD seems to not have any issues outside the normal BIS stuff. Yes, the invisiable H should not have anything in its init... just post this in the top section of the init.sqf and yopu should be golden... :)
glad its working thus far...
-VRCRaptor
clydefrog
Aug 7 2012, 15:37
hmmm... the dup lights thing sound like it makes more than one LHD and there have been many people with the same issue... I have not had any of those running the script I posted... its very stable and everyone I play with on the LHD seems to not have any issues outside the normal BIS stuff. Yes, the invisiable H should not have anything in its init... just post this in the top section of the init.sqf and yopu should be golden... :)
glad its working thus far...
-VRCRaptor
Tested my mission now a few times with a few people with your version of the LHD script in my init.sqf, seems to work great, everybody spawns on the carrier and nothing weird has happened, thanks.
and nothing weird has happened
That's impossible, are you sure you're still playing ArmA? :)
clydefrog
Aug 7 2012, 18:24
That's impossible, are you sure you're still playing ArmA? :)
lol, that's a good point, if everything that could possibly be going wrong isn't going wrong, it probably isn't ArmA.
VRCRaptor
Aug 8 2012, 03:48
Tested my mission now a few times with a few people with your version of the LHD script in my init.sqf, seems to work great, everybody spawns on the carrier and nothing weird has happened, thanks.
AWESOME!!! great to hear.
-VRCRaptor
EightEx
Jan 29 2013, 06:33
I was on a server last night and they hacked in a flying LHD, just wondering how they could have done that? I'd like to make one for my own mission, thinking Avengers style...
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.