Announcement

Collapse
No announcement yet.

LHD working Elevator

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • LHD working Elevator

    create a mission and place a game logic on the map named "LHD_Center" then place an object on the right elevator you want to control the up down motion I used a folding table..name this control

    in the init of control place this:

    Code:
    this setposASL [getposASL this select 0, getposASL this select 1, 15.3]; this enableSimulation False;
    then place these files into your mission folder

    init.sqf
    Creates the LHD and names the elevator as elev also adds action to the object that will control the elevator
    Code:
    if (isServer) then {
    	_LHDspawnpoint = [getPosASL LHD_Center select 0, getPosASL LHD_Center select 1, -.43];
    	{
    		_dummy = createVehicle [_x, _LHDspawnpoint, [], 0, "NONE"];
    		_dummy setdir (getdir LHD_center);
    		_dummy setPos _LHDspawnpoint;
    	} foreach ["Land_LHD_house_1","Land_LHD_house_2","Land_LHD_1","Land_LHD_2","Land_LHD_3","Land_LHD_4","Land_LHD_5","Land_LHD_6"];
    	elev = createvehicle ["Land_LHD_elev_R", _LHDspawnpoint, [], 0, "NONE"];
    	elev setdir (getdir LHD_center);
    	elev setPos _LHDspawnpoint;
    	};
    	
    act = control addAction ["Lower Elevator", "elevdown.sqf",elev,7,TRUE];
    sleep 5;
    elevdown.sqf
    sends the elevator down to 2 meters below waterline..this allows LAV to get onboard
    Code:
    _object = _this select 0;
    	_obx = (getposasl _object select 0);
    	_oby = (getposasl _object select 1);
    _caller = _this select 1;
    _id = _this select 2;
    _elev = _this select 3;
    
    if (isServer) then 
    {
    	_object removeaction _id;
    	_height = (getposASL _elev select 2);
    	while {_height > -17}
     	do {
    	 _elev setposASL [getposasl _elev select 0, getposASL _elev select 1, ((getposasl _elev select 2) -.015)];
    	 _object setposASL [_obx, _oby, ((getposasl _object select 2) -.015)];
    	 _height = (getposASL _elev select 2);
    	 sleep .01;
    	};
    	act = _object addAction ["Raise Elevator", "elevup.sqf",elev,7,TRUE];
    };
    elevup.sqf
    Code:
    _object = _this select 0;
    	_obx = (getposasl _object select 0);
    	_oby = (getposasl _object select 1);
    _caller = _this select 1;
    _id = _this select 2;
    _elev = _this select 3;
    
    if (isServer) then 
    {
    	
    	_object removeaction _id;
    	_height = (getposASL _elev select 2);
    	while {_height < -.3548}
     	do {
    	 _elev setposASL [getposasl _elev select 0, getposASL _elev select 1, ((getposasl _elev select 2) +.015)];
    	  _object setposASL [_obx, _oby, ((getposasl _object select 2) +.015)];
    	 _height = (getposASL _elev select 2);
    	 sleep .01;
    	};
    	act = control addAction ["Lower Elevator", "elevdown.sqf",elev,7,TRUE];
    };
    any questions just ask! :)

    EDIT: right now this only works when vehicles have a player in them..I will work on correcting this but for now just consider as a way to help encourage teamwork :)



    Fate whispers to the warrior "You will not survive the storm."
    The warrior whispers back, "I AM the storm."

  • #2
    Re: LHD working Elevator

    You're like the mad scientist of TG ArmA, Charles. This is awesome!
    |
    | |




    "Kirov is boss"
    CO49 Great Bear Part 1, 28APR2012.

    Comment


    • #3
      Re: LHD working Elevator

      lol thanks JB this was actually incredibly easy and im super surprised no one has done this before



      video incoming it shows a slightly revised version of the script where the control box which was a table in the example above is now a generator placed on the side of the ship and must be activated by a third party i did this because in order to get the lift low enough to let LAVs and AAVs on it had to be low enough that players swam instead of stand on the platform. this caused problems in that when the lift is activated anyone swimming on the platform is killed.

      Future updates will have several positions such as "Hangar Deck" "Water Line" "Below Water Line" and of course "Flight Deck" so that you can chose how low the lift will go..so for example you could have a boat pull up along side the lift at "Water Line" which would allow soldiers to ride the lift down and enter or exit the boat.



      Fate whispers to the warrior "You will not survive the storm."
      The warrior whispers back, "I AM the storm."

      Comment


      • #4
        Re: LHD working Elevator

        HOLY [email protected]#[email protected] Dude...that is simply amazing. You are the man....I must buy you beer, lots and lots of beer. Now the big question...will it work with MP and a dedicated server and all that jazz.

        [unit][squadl][command2]

        KnyghtMare ~You could always tell the person holding the gun to your head you would like to play on a different server...

        Comment


        • #5
          Re: LHD working Elevator

          Tested MP worked fine on a hosted server..Ill test on a dedicated server later tonight. But the motion of the lift itself is just moving a vehicle(the LHD elevator "vehicle") via script several times. so if there is an issue it should be a simple fix.



          Fate whispers to the warrior "You will not survive the storm."
          The warrior whispers back, "I AM the storm."

          Comment


          • #6
            Re: LHD working Elevator

            Didn't get a chance to test it on a dedicates server like I had hoped but discovered that the code posted above works fine when going up, but when going down vehicles even with people in them, get stuck in mid air.

            So to fix this I added a bit at the beginning of the action to set each vehicle down a small bit and that seems to fix the problem for both vehicles with people in them and for empty vehicles.

            EDIT:

            For some reason the youtube video editor put the end of the video at the beginning, so the first bit youll see should be at the end of the video lol

            Last edited by Charles Darwin; 02-02-2012, 11:06 AM.



            Fate whispers to the warrior "You will not survive the storm."
            The warrior whispers back, "I AM the storm."

            Comment


            • #7
              Re: LHD working Elevator

              Super cool...

              Comment


              • #8
                Re: LHD working Elevator

                Very nice!

                TGU Instructor TG Pathfinder

                Former TGU Dean Former ARMA Admin Former Irregulars Officer

                "Do not seek death. Death will find you. But seek the road which makes death a fulfillment." - Dag Hammarskjold

                Comment


                • #9
                  Re: LHD working Elevator

                  http://www.armaholic.com/index.php

                  Front Paged:D



                  Fate whispers to the warrior "You will not survive the storm."
                  The warrior whispers back, "I AM the storm."

                  Comment


                  • #10
                    Re: LHD working Elevator

                    Originally posted by Charles Darwin View Post
                    HELL YA!!! Good work man!






                    "TG was created to cater to a VERY specific type of gamer rather than trying to appeal to the greater gaming population....Tactical Gamer is not mainstream. We are not trying to attract mainstream gamers" ~ Apophis

                    Comment


                    • #11
                      Re: LHD working Elevator

                      High five!!! Bottle 'o rum coming your way!
                      |
                      | |




                      "Kirov is boss"
                      CO49 Great Bear Part 1, 28APR2012.

                      Comment


                      • #12
                        Re: LHD working Elevator

                        init

                        Code:
                        //////////////////////////////////////////////////////////////////
                        // Function file for Armed Assault "Land_LHD_elev_R",
                        // Created by: TODO: Author Name
                        //////////////////////////////////////////////////////////////////
                        
                        	if(isserver)then{
                        	_lhde = (getposASL LHD_center select 0);
                        	_lhds = (getposASL LHD_center select 1);
                        	_lhdz = (getposASL LHD_center select 2);
                        	_LHDspawnpoint = [_lhde, _lhds, -.43];
                        	
                        	
                        	{
                        		_dummy = createVehicle [_x, _LHDspawnpoint, [], 0, "NONE"];
                        		_dummy setdir (getdir LHD_center);
                        		_dummy setPos _LHDspawnpoint;
                        	} foreach ["Land_LHD_house_1","Land_LHD_house_2","Land_LHD_1","Land_LHD_2","Land_LHD_3","Land_LHD_4","Land_LHD_5","Land_LHD_6"];
                        	
                        
                        
                        	elev = createvehicle ["Land_LHD_elev_r", _LHDspawnpoint, [], 0, "NONE"];
                        	publicvariable "elev";
                        	elev setdir (getdir LHD_center);
                        	elev setPos _LHDspawnpoint;
                        	
                        	control = createvehicle ["Powergenerator",  getmarkerpos "gen", [], 0, "NONE"];
                        	publicvariable "control";
                        	control setdir (getdir LHD_center);
                        	control attachto [LHD_center,[18.5547,-81.7495,14.7249]];
                        	
                        	elev_trig = createTrigger["EmptyDetector",_lhdspawnpoint];
                        	publicvariable "elev_trig";
                        	elev_trig setTriggerArea[6.5,6.5,0,true];
                        	elev_trig setTriggerActivation["ANY","PRESENT",true];
                        	elev_trig setTriggerStatements["this", "", ""]; 
                        	elev_trig attachto [LHD_center,[22.5283,-92.0315,.339975]];
                        	
                        	_marker1 = createMarker ["test", _lhdspawnpoint];
                        	_marker1 setMarkerShape "RECTANGLE";
                        	"test" setMarkersize [22,127];
                        	"test" setmarkercolor "Colorblue";
                        	"test" setmarkerDir (getdir LHD_center);
                        };
                        act = control addAction ["Lower Elevator", "LHD\elevdown.sqf",elev,7,TRUE];



                        Fate whispers to the warrior "You will not survive the storm."
                        The warrior whispers back, "I AM the storm."

                        Comment

                        Connect

                        Collapse

                        TeamSpeak 3 Server

                        Collapse

                        Advertisement

                        Collapse

                        Twitter Feed

                        Collapse

                        Working...
                        X