Jump to content

Elevator Script for Players and Vehicles [WIP/Prototype]


Axe Cop

Recommended Posts

Although just testing it on our test server has shown up something interesting. If the server is restarted when it's in transit it gets stuck permanently there in between and can't be called, when you call it it says it's already in transit. 

Link to comment
Share on other sites

Are you sure? The script should not move the original metal floor at all. Actuelly what happens if you trigger the elevator it will copy the metal floor and hide the original one, but not remove the original object from the Database, so it will be back after the restart!? That is at least how I programmed it :D

Link to comment
Share on other sites

Hey Axe, so I deleted it and created a new one, the new one travels between the original three stops, but will not go to the new one (where the new one was created). Also there's no way to remove the stops or the lift once created short of an admin deleting them. Feel free to jump on my test server and have a look if you like, 211.30.42.168, I'll PM you the PW.

Link to comment
Share on other sites

Hey sorry I don't have Epoch installed on my machine, I am not playing Epoch anymore since last year.. just doing some support here for my scripts but the elevator script was just a prototype as you can see in the title. But for what I used it on my server back then it always worked, but animations are not that nice if you use the elevator with multiple players, that is a limitation of the Arma modding interface so not much I can do about it :/

I don't have the time to look into that atm, Epoch development takes a lot of time to write and test the script because you have to restart the server most of the time if you change a little thing..

Link to comment
Share on other sites

Ahh ok, no worries, thanks for you time man. If you decide you want to spend some time testing it, perfecting it and restarting the server I can give you remote desktop access to my VM so you can test away to perfect it.

Link to comment
Share on other sites

Ehm, i made it now,

 

else {
if ((getPlayerUID player) in ["1231231"]) then {
if (s_player_elevator_upgrade < 0) then {
s_player_elevator_upgrade = player addAction ["<t color=""#ffffff"">Upgrade to Elevator</t>", _folder+"elevator_build.sqf", ["build",_ct], 0, false];
};
 
if (s_player_elevator_upgrade_stop < 0) then {
s_player_elevator_upgrade_stop = player addAction ["<t color=""#ffffff"">Upgrade to Elevator Stop</t>", _folder+"elevator_build.sqf", ["build_stop",_ct], 0, false];
};
};
};
 
But when I press upgrade to Elevator nothing happens and im getting stuck into "Upgrade already in process"
Link to comment
Share on other sites

Hello Axe Cop thanks so much for your awesome script, it works perfect. But i have a question. Can be possible, limit elevators for only, plot pole owner or tag as friendly by plot pole owner?

Hey, well that should be possible to do yes, but I don't have time to help you with that, maybe you know some scripter who can do that? good luck

Link to comment
Share on other sites

Axe, I just have to say you are divine! I script, and write a lot of my own as well, but I have to say this is a treasure. I just put it together tonight, and I am so excited to show it

to my users. You are an inspiration to this community sir, and you have my deepest gratitude!! Brilliant!!

Link to comment
Share on other sites

Love the script, great work! It has added some really neat bases on my server. My only concern/problem with this script as been that some...."inventive" players have noticed that the build portion of the script doesn't look for a plot pole before allowing them to upgrade a metal floor (or roof in this case) to an elevator, then upgrade an adjoining metal floor (roof) to an elevator stop....since the elevator stop is the transparent version of the metal floor, it is passable and it allows them access into otherwise secure bases...I changed the elevator_build.sqf with some code from player_build.sqf in the epoch code to look for plot poles before allowing a player to build an elevator. I figured I would share it here...so far it works as intended on my server....it allows plot owners and friendlies to build elevators where plot poles exist, and denies it to those who aren't normally allowed to build on someone's plot.

 

Here's what I changed it to:

 

elevator_build.sqf:

 

after this:

player removeAction s_player_elevator_upgrade;
s_player_elevator_upgrade = 1;
player removeAction s_player_elevator_upgrade_stop;
s_player_elevator_upgrade_stop = 1;
 
I added:
// check for near plot
_canBuildOnPlot = false;
_distance = DZE_PlotPole select 0;
_needText = localize "str_epoch_player_246";
_findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], _distance];
_findNearestPole = [];


{
if (alive _x) then {
_findNearestPole set [(count _findNearestPole),_x];
};
} foreach _findNearestPoles;


_IsNearPlot = count (_findNearestPole);


if(_IsNearPlot == 0) then {
_canBuildOnPlot = true;
} else {
// Since there are plots nearby we check for ownership and then for friend status 
// check nearby plots ownership and then for friend status
_nearestPole = _findNearestPole select 0;
// Find owner 
_ownerID = _nearestPole getVariable["CharacterID","0"];
// diag_log format["DEBUG BUILDING: %1 = %2", dayz_characterID, _ownerID];
// check if friendly to owner
if(dayz_characterID == _ownerID) then {  //Keep ownership
// owner can build anything within his plot except other plots
_canBuildOnPlot = true; 
} else {
_friendlies = player getVariable ["friendlyTo",[]];
// check if friendly to owner
if(_ownerID in _friendlies) then {
_canBuildOnPlot = true;
};
};
};
if(!_canBuildOnPlot) exitWith {  DZE_ActionInProgress = false; cutText [format[(localize "STR_EPOCH_PLAYER_135"),_needText,_distance] , "PLAIN DOWN"]; };

 

There might be a better way to do it, but this fixed it for me for now. 

 

Sorry about the formatting, It was being a pain, so meh.

 

Axe, i try that fix for glitchers who, swap , metal floor in metal floor preview to join in our base. I think we can use the same for limit, activate elevator to next stop and activate for prev stop. This code just, limit upgrade if you arnt plot pole owner, It can be done for my qestion right?.

Link to comment
Share on other sites

@Zombiegirl: thank you for your kind words, you are one of the few people who just thank me for my scripts and don't come here with weird problems or questions. :D

 

 

Axe, i try that fix for glitchers who, swap , metal floor in metal floor preview to join in our base. I think we can use the same for limit, activate elevator to next stop and activate for prev stop. This code just, limit upgrade if you arnt plot pole owner, It can be done for my qestion right?.

it should work, so only the owner or friends can build or use the elevator if you want that, just try it yourself and see if it works :)

Link to comment
Share on other sites

Thanks for this, a great piece of work but I have one small problem.

 

I can get the script to work no problem - only if I place the code before the action script menu I also have on my server. Basically if the action script is called on first, that will show on the server but not the elevator script options - but if the elevator script is called on first then the elevator options show but not the action script options.

 

Obviously there is some conflict between the two but I can't find where.

 

The action script is WPD Action menu

 

Any pointers appreciated.

Link to comment
Share on other sites

Hey Axe Cop, got it working on my server and the players love it, thanks so much for your work.

 

Only question I have is how hard is it to script in some way to remove it, so people get the parts back or even just remove it and it vanishes, at the moment if someone stuffs up and admin has to come along and delete it all.

Link to comment
Share on other sites

It should not be that hard, keep in mind I wrote this script before players could remove anything in Epoch. So it was no problem back then and just like any other buildable object from Epoch, but Epoch got some updates since then ^^

Link to comment
Share on other sites

thanks for sharing the video, very nice but he could have mentioned that you can build multiple stops for the same elevator and then also call the elevator from any stop. :)

small tip: if you build an elevator it is already selected for you, so you don't need to use the action "select elevator" the first time, only if you relog or whatever and try to build more stops.

Link to comment
Share on other sites

Thanks for this, a great piece of work but I have one small problem.

 

I can get the script to work no problem - only if I place the code before the action script menu I also have on my server. Basically if the action script is called on first, that will show on the server but not the elevator script options - but if the elevator script is called on first then the elevator options show but not the action script options.

 

Obviously there is some conflict between the two but I can't find where.

 

The action script is WPD Action menu

 

Any pointers appreciated.

 

Anyone?

Link to comment
Share on other sites

I don't think I can help you with that because I don't know the WPD Action menu...

Anyway it should be very unlikely that my elevator script interferes with other Arma scripts, because all the global variables I use start with "ELE_" (config variables and global actions).

So hard to say why you have have that bug with some digging and debugging... :/

Link to comment
Share on other sites

I don't think I can help you with that because I don't know the WPD Action menu...

Anyway it should be very unlikely that my elevator script interferes with other Arma scripts, because all the global variables I use start with "ELE_" (config variables and global actions).

So hard to say why you have have that bug with some digging and debugging... :/

 

OK, thanks anyway - Will try and find a solution.

Link to comment
Share on other sites

thanks for sharing the video, very nice but he could have mentioned that you can build multiple stops for the same elevator and then also call the elevator from any stop. :)

small tip: if you build an elevator it is already selected for you, so you don't need to use the action "select elevator" the first time, only if you relog or whatever and try to build more stops.

Sorry Axe, we didn't have time to put this one up. This is with multiple stops.

http://youtu.be/wmrvROB5MQUs

Link to comment
Share on other sites

Everything works fine (so far) except for upgrading the elevator stop. At that point, the metal floor is deleted and nothing replaces it. At this point, the script is useless. I've been trying to find out what's causing the issue, but have had no luck. Any ideas?

Link to comment
Share on other sites

Everything works fine (so far) except for upgrading the elevator stop. At that point, the metal floor is deleted and nothing replaces it. At this point, the script is useless. I've been trying to find out what's causing the issue, but have had no luck. Any ideas?

Maybe it would help to read the instructions in the first post?

It is clearly mentioned why this is happening... at least I think every Epoch admin should understand this:

 

 I use the "MetalFloor_Preview_DZ" for the elevator stop by default, if you want to keep it like that you have to add that class to your allowed objects in Epoch, otherwise Epoch will delete it right after you upgrade a metal floor to a stop point.

more and how to fix it in the first post. :)

 

@Zombiegirl the youtube link is not working, but thanks for the updated video (no need to be sorry, i wasn't sure your players know about those features so I mentioned it).

Link to comment
Share on other sites

Maybe it would help to read the instructions in the first post?

It is clearly mentioned why this is happening... at least I think every Epoch admin should understand this:

more and how to fix it in the first post. :)

 

@Zombiegirl the youtube link is not working, but thanks for the updated video (no need to be sorry, i wasn't sure your players know about those features so I mentioned it).

yeah sorry i'm a bit tired and skipped through the post. My bad. It's working now. 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...