Jump to content
Sign in to follow this  
Charles Darwin

Working LHD Elevator

Recommended Posts

OOh I think I know why it's failing in dedicated..though now I am not sure why it worked dedicated before:confused: lol

I'll do some testing when I get home in a few hours

Share this post


Link to post
Share on other sites

I have tried it several ways, even just your scripts unchanged with the LHD on dedicated and it still does not work... works great on local server and testing with preview but not on my dedicated server where myself and my team operate.

There are days when you think you know what you are doing and then something like this pops up and it starts to eat your lunch... thats me in a nut shell. < that is not commented for you or remarked at you in anyway :), rather than it is a self reflection... dont want you to think I am being mean or something. :) > I will continue to plug away at it and see... let me know when you can on what you think is causing the issue as I would be willing to test it out. :)

-Raptor

Update -

Funny part is, when I do get it to work on dedicated... by taking the isServer out of the scripts... the LHD will lower the elevator but leave another version in place as well... so you will see one moving and then the other still in place... weird...

Edited by VRCRaptor

Share this post


Link to post
Share on other sites

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

Edited by Charles Darwin

Share this post


Link to post
Share on other sites

for the control issue try this...

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

this worked for me with getting the addaction to work with what you posted. I think something similar will have to be done with the elevator as I think once it gets to the dedicated server it loses its id somehow... what do you think?

Share this post


Link to post
Share on other sites

	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.

Edited by Charles Darwin

Share this post


Link to post
Share on other sites

First I would not use "control" as a var name. It is reserved, it is used in arma as a ui object , I am astonished it works at all like that.

Second you will be creating the elevator on the server, but it you have the controls to move the elevator in this: "LHD\elevdown.sqf" that will not work, you are calling that script locally from an addaction. That means that the vehicle(the elevator) is local to the server and the script you called is local to that player, there is no way for the script to interact with the elevator. Your addaction should call a function to send a command to the server to execute



"LHD\elevdown.sqf" on the server.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Use CBA for global actions:

Add an action to the object via say, init.sqf:

theObject addAction ["Do cool stuff!", "theScript.sqf"];

//theScript.sqf

_unit = _this select 0; //this is the object that has the action

_caller = _this select 1; //this is the unit that executes the action

(_this select 0) removeAction (_this select 2);

[-2,{veh = [] execVM "moveStuff.sqf";} ,_caller] call CBA_fnc_globalExecute;

sleep 30;

[-2, {_this addAction ["Do cool stuff", "theScript.sqf"];}, _unit = _this select 0;] call CBA_fnc_globalExecute;};

Edited by Pellejones

Share this post


Link to post
Share on other sites

CBA should be standard for everything these days. It is a 30 KB addon that makes life easy for the addon maker :) use it.

Share this post


Link to post
Share on other sites

Hey Charles just wondering if you're still supporting this script. It seems like a really great start adding more functionality to LHD's

Share this post


Link to post
Share on other sites

Zuff, my summer has been beyond crazy unfortunately, if you minus time spent sleeping and eating I have only a few days off in the last 3 months. So ATM no this is dead, but it is in(or is going to be in) an MCC update and is MP compat

Share this post


Link to post
Share on other sites

Hi there,

i still havent figured out how to use this on deidacted Servers.

I wanted to implement it into our Wasteland Mission File

ive also already downloaded the mcc update with the elevator in it but i cant figure out how it works.

little help please. thanks

waTTe

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  

×