Jump to content

Charles Darwin

Member
  • Content Count

    133
  • Joined

  • Last visited

  • Medals

Posts posted by Charles Darwin


  1. thanks for the info on control

    second bit I am aware of and am in the process of changing..I have the server running a script to monitor two variables (LHD_Elev and LHD_Elev_W) determines which one is larger and then moves the elev object based on that. I am now going to work on a simple dialog to add to the control object(hence forth elev_control) that will activate the elevator and have several buttons so that the player can chose which level he wants the elev to go to.


  2. 	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"];
    
    sleep .01;	
    elev = createvehicle ["Land_LHD_elev_r", _LHDspawnpoint, [], 0, "NONE"];
    publicvariable "elev";
    elev setdir (getdir LHD_center);
    elev setPos _LHDspawnpoint;
    
    sleep .1;
    control = createvehicle ["powergenerator",  _lhdspawnpoint, [], 0, "NONE"];
    publicvariable "control";
    control enablesimulation false;
    control setdir (getdir LHD_center);
    control attachto [LHD_center,[18.5547,-81.7495,14.7995]];
    sleep .1;
    
    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);
    };
    sleep 1;
    act = control addAction ["Lower Elevator", "LHD\elevdown.sqf",elev,7,TRUE];
    

    latest init it's still not dedicated compatible as far the actions go this solves the problem of the control object opbject creation, the init was running too fast and basically getting ahead of itself.


  3. ok did a bunch of testing and it's something in the init(there are other dedicated issues but this is where I am stuck right now)

    on a dedicated server

    	elev = createvehicle ["Land_LHD_elev_r", _LHDspawnpoint, [], 0, "NONE"];
    elev setdir (getdir LHD_center);
    elev setPos _LHDspawnpoint;
    

    Works spawns the elevator all good!

    control = createvehicle ["Powergenerator",  _lhdspawnpoint, [], 0, "NONE"];
    control setdir (getdir LHD_center);
    control attachto [LHD_center,[18.5547,-81.7495,14.7249]];
    

    does not work, spawns but is not labeled as control so that it can be referenced by the items right below it

    there the same code minus the attach command :confused: curse you ArmA mulitplayer scripting:mad:! lol


  4. NP :)

    As I said I am working on making it more self contained, IE the script will spawn eveything it needs based off the location and position of the LHD_center logic.

    in that effort I am trying to add the actions to a spawned power generator. then attach the generator the LHD_Center at the appropriate offset, unfortunately I have hit a bit of a head scratcher.

    If the control object is in mission(ie placed in editor) it works fine..if i have the script spawn it, the action isn't added:

    //	control = createvehicle ["POWERgenerator", getmarkerpos "test" , [], 0, "NONE"];
    control setdir (getdir LHD_center);
    act = control addAction ["Lower Elevator", "elevdown.sqf",elev,7,TRUE];
    control attachto [LHD_center,[18.5547,-81.7495,14.7249]];
    control enablesimulation false;

    any ideas?

    EDIT__________________

    Ok it DOES add the action but only after about 10 seconds:confused:


  5. Woohooo! I'm honored I have found a lot of really cool scripts on armaholic and I am glad I can contribute too :D

    Also not to be a nag, especially since it's due to my not being very clear in my last posts, but the issue with the vehicles not moving with out AI or player in them has been fixed, but you'll need to add a trigger over the LHD elevator area and name it elev_trig. I would suggest adding a limitation describing that there is an invisible floor on the flight deck that will interfere with vehicle's when they go down or come up as shown in video

    Sorry there hasn't been any improvements I work week on week off so in a few days there should be some improvements. My next goal is to automate trigger and control creation basing their positions off the LHD_center object.

    Againa very honored to be frontpaged! :D


  6. Is there any way that we can modify how far down the elevator goes? For example, I'd like to spawn some helicopters or harriers at the height of the hangar bay and then have the elevator raise back to deck level to allow for moving the helicopter/harrier to a take-off section.

    absolutely, its a really easy task to set the height just change the -17.1 in red to what ever height you like. In my mission -.345 is the default "up" height ASL of the elevator and that number is in the same location but in the elevup.sqf, though from testing it seems that the set/getposASL is not functioning correctly so you may have to fiddle with the exact height to get it right. I my testing the hangar bay was around -10 i beleive.

    //****************************** Define Stuff*******************//;
    
    // This is the controlling object that will have the action attached to it;
    _object = _this select 0;
    _obx = (getposasl _object select 0);
    _oby = (getposasl _object select 1);
    
    // This is the Unit Activating the Action;
    _caller = _this select 1;
    
    //ID of the action so we can remove it;
    _id = _this select 2;
    
    //Name of the elevator object defined in the init;
    _elev = _this select 3;
    
    // Trigger that checks for vehichles so we can give them a nudge down.;
    _trig = list elev_trig;
    
    
    // ***************************Actual Script Stuff here*******************//;
    
    // Check if server;
    if (isServer) then 
    {
    // Remove the Action that was called;
    _object removeaction _id;
    // Check Initial height of the elevator;
    _height = (getposASL _elev select 2);
    //Hint for testing Purposes;
    hint format ["%1 %2", (list elev_trig select 0),(list elev_trig select 1)];
    //Nudge any vehicles down so they don't get stuck in mid air
    {_x setposASL [getposASL _x select 0, getposASL _x select 1,((getposASL _x select 2)-.015)];
     			} foreach _trig;	
    // Move the Elevator;
    [color="#FF0000"]while {_height > -17.1}[/color]
    	do {
     _elev setposASL [getposasl _elev select 0, getposASL _elev select 1, ((getposasl _elev select 2) -.015)];
    // Activate the line below this if you want your control object to move down with the elevator;
    //	 _object setposASL [_obx, _oby, ((getposasl _object select 2) -.015)];
    
    //Checks the height of the elevator again so the script knows when to stop.;
     _height = (getposASL _elev select 2);
     sleep .01;
    };
    // Add the Action to raise the elevator.;
    act = _object addAction ["Raise Elevator", "elevup.sqf",elev,7,TRUE];


  7. my guess is that is was planned for the LHD to have an open flight deck and LCAC bay but time/money constraints got the upper hand.there is a modeled LCAC bay but the rear doors don't open and there is no way down to the bay from inside the ship. The only reason this is possible is because the elevator is modeled as a separate piece from the rest of the flight deck so I can move w/o moving the other unfortunately it's not possible with out making a new model, to add this to the lcac bay doors


  8. 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

    Video is processing so if it says it is unavailable at first just wait a few minutes and try again.

    In the video first you'll see that it works with vehicles both with AI OR Player in them as well as with no AI or player. Then I show how there is an invisible floor that extends over the elevator on the carrier deck model that will interfere with vehicles both going down and coming up, but so far it appears more a cosmetic annoyance than a real problem, just don't put too many vehicles on the elevator it may push some of them off the back side as it goes up, and be careful with how you park vehicles when going down. The floor extends to where the carrier deck would be if the elevator was not there.

    Gnat what did it used to do?


  9. In real life no the elevator doesnt go to the water only to the hangar deck..however in real life vehicles can get to the water line via the LCAC bay which is not in arma unfortunately, I'd much rather have an LCAC and an LCAC bay but such is life..or such is arma anyway lol

    ---------- Post added at 05:57 AM ---------- Previous post was at 04:52 AM ----------

    elevdown.sqf

    //****************************** Define Stuff*******************//;
    
    // This is the controlling object that will have the action attached to it;
    _object = _this select 0;
    _obx = (getposasl _object select 0);
    _oby = (getposasl _object select 1);
    
    // This is the Unit Activating the Action;
    _caller = _this select 1;
    
    //ID of the action so we can remove it;
    _id = _this select 2;
    
    //Name of the elevator object defined in the init;
    _elev = _this select 3;
    
    // Trigger that checks for vehichles so we can give them a nudge down.;
    _trig = list elev_trig;
    
    
    // ***************************Actual Script Stuff here*******************//;
    
    // Check if server;
    if (isServer) then 
    {
    // Remove the Action that was called;
    _object removeaction _id;
    // Check Initial height of the elevator;
    _height = (getposASL _elev select 2);
    //Hint for testing Purposes;
    hint format ["%1 %2", (list elev_trig select 0),(list elev_trig select 1)];
    //Nudge any vehicles down so they don't get stuck in mid air
    {_x setposASL [getposASL _x select 0, getposASL _x select 1,((getposASL _x select 2)-.015)];
     			} foreach _trig;	
    // Move the Elevator;
    while {_height > -17.1}
    	do {
     _elev setposASL [getposasl _elev select 0, getposASL _elev select 1, ((getposasl _elev select 2) -.015)];
    // Activate the line below this if you want your control object to move down with the elevator;
    //	 _object setposASL [_obx, _oby, ((getposasl _object select 2) -.015)];
    
    //Checks the height of the elevator again so the script knows when to stop.;
     _height = (getposASL _elev select 2);
     sleep .01;
    };
    // Add the Action to raise the elevator.;
    act = _object addAction ["Raise Elevator", "elevup.sqf",elev,7,TRUE];
    };

    Added something to nudge vehicles as they go down since before they would hang in mid air when the elevator started to go down. recorded a new video showing both this new feature as well as some of the limitations of the system inherent from the model BIS made. The video is incoming uploading to youtube now(need to record in something other than AVI i guess lol)


  10. This is a great script, you can do so much with it, I'm surprised BI didn't add this feature with the game!

    Oh, and can you post the new code? I would love to make this work without dying :D

    Thanks for the kind words guys :D

    the code in the first post is actually correct all I did was disable to control object being moved down with the elevator. In the movie I used a power generator (empty -> Objects -> Power generator) with these coordinates:

    position[]={15017.712,14.180637,-54.900513};

    and in it's init

    [getposASL this select 0, getposASL this select 1, 14]; this enableSimulation false;

    I am still working on it to improve it. Right now there must be a unit in the vehicle or else it doesnt move with the elevator. Possible remedy is to check if vehicle is empty and if it is create a unit and then delete it when the elevator stops but still working on it so we'llsee :)

    ---------- Post added at 03:10 AM ---------- Previous post was at 01:46 AM ----------

    Hmm.just realized for some reason moving the LHD a new position messes up the setposasl/getposasl? It seems to be related to the elevation of the sea floor under the LHD marker but shouldn't it measure from the Sea Level?:confused:

×