Jump to content

Elevator Script for Players and Vehicles [WIP/Prototype]


Axe Cop

Recommended Posts

Hi Axe Cop

Firstly incredible script. Thanks!

I would be interested in an elevator with locks too.

Do you think that this would be easy to make?

or could you implement the key funktion?

Would appreciate some help, because this would give the option to actually protect your base :)

Thanks

Exo

well it should be possible to use the Epoch keys to access the elevator, but I didn't look further into that.. maybe someday who knows :D

 

 

Hey Axe Cop, thanks for this fantastic Script! ;)

I had made an video "how tu use" (Youtube KLICK) with a link to this thread.

 

One question: Is it possible to use more than one basic item to use as "Elevator Start"? I think about Wood Half / Quarter for the ATC (for example), the Metal Floor ist to big for the lift shaft but is good to use for Elevators outside. So it would be good to have a selection / choice...

hey nice video, I think I've said it a few times before it is possible to build a more complex elevator but since the script animations are somewhat limited in ArmA I would not do that, of course you can replace the elevator with another platform and don't use the metal floor (that be simply done in the config of my script).

anyway you can use the elevator with more people, but again with the sluggish animations and desync in Arma it it will only look good for the person who activates the elevator but other should survive the ride haha :D

Link to comment
Share on other sites

  • 2 weeks later...

Any updates soon?

Bugs

Elevators pickup base building objects 

Elevator is really slow with a debug

Well the last real update was like 6 month ago, so I don't think so. But the scripts are open source so everyone can continue working on it might that's not some easy code :D

Still I don't know what bugs do you mean? I don't get your other things, too. what does that mean elevator is slow with debug that makes no sense to me!? hmm

Link to comment
Share on other sites

Well the last real update was like 6 month ago, so I don't think so. But the scripts are open source so everyone can continue working on it might that's not some easy code :D

Still I don't know what bugs do you mean? I don't get your other things, too. what does that mean elevator is slow with debug that makes no sense to me!? hmm

 

I hink he means:

If your server (or client) has bad fps(10-17), the elevator is quite slow.

But I think there is nothing you could do.

 

Tryed to add a key or code to the elevator but it won´t work......

Somone got an idea?

Cheers 

Exo

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.

Link to comment
Share on other sites

Well the elevator itself is essentially just a metal floor, so it can be removed like any other metal floor in Epoch!?

the elevator stop point depends on the object class, the default transparent metal floor can only be removed with admin tools or something like that, unless you have a custom script or anything that allows players to remove it themselves.. I din't include it in this version, so you have to do that yourself or let admins remove it.

Link to comment
Share on other sites

  • 2 weeks later...

ok, when I put the script in,Its in the root mission pbo, And add the line to the init, We can build the elevator, but nothing else. Sry, we can also select it, 1,2,3...ect.

 

if (!isDedicated) then {
    //Conduct map operations
    0 fadeSound 0;
    waitUntil {!isNil "dayz_loadScreenMsg"};
    dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
    
    //Run the player monitor
    _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
    _playerMonitor =     [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
    ["elevator"] execVM "elevator\elevator_init.sqf";    
  

 

this is how it looks in the init . sqf.

Oh, And when it did build ingame, there was no preview, the metal floor simply disapeared.

Now when i changed the Dayz_code\init\variables.sqf to add the "MetalFloor_Preview_DZ", We get booted from the server. every time. so plz, a little help for us N00bs....lol

Link to comment
Share on other sites

are you using any custom anti hacks or something that might interfere with custom scripts?

I don't know what you mean by "We get booted from the server." do you get kicked by BattlEye or what? if so look in the BE logs to see why.

Link to comment
Share on other sites

OK, exact  wording. "You were kicked from the server" This comes up as soon as we try to log in. is  it possible that the Epoch variables cant be altered in the dayz code? I ask because it comes up on the screen in a brown box like window. Not unlike Arma 2 error messages and the server does use custom anti hack, but we looked into it, that's not the issue. So i'm at a loss...lol Im going to look into battle-eye now.

Link to comment
Share on other sites

yeah "You were kicked from the server" is not helping much, you need to look into the Arma2OAserver.RPT if you can't see the reason in-game. in the RPT file should be a reference to the battleEye filter, than you need to find the filter file, e.g. BattleEye\scripts.log and look for the exact kick reason in there (the exact reason can only be found in the BE log, the Arma2OAserver.RPT onbyl logs the file and restriction line no, so if you get kicked because "script restriction #5" you need to look for scripts.log and the reason is in scripts.txt line #5 u usually, the numbers is sometimes not correct though haha)! I know not that easy but that's how to do it with Arma :D

 

and I don't know what you did but you can NEVER change the actual client files, that no wonder you are getting kicked :D

if you want to change the files e.g. the variables.sqf you have to copy it to your mission folder and change the reference to that file from the client path to mission path, it is always like that so that is basic knowledge of Arma scripting that is why it is not explained in every topic in the forums all over again. :)

Link to comment
Share on other sites

OK i understand now, so i change the line in my init, (call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";) To reflect the new location of my Variables.sqf file, which i can put in my mission folder. i get it now, ty, i never claimed to be smart.....lol

 

OK, got it fixed, its glichy, but it works fine now. You aer the best. Ty for the awsome help and keep up the good work!.

Link to comment
Share on other sites

Hey Guys,

 

The Elevator is a awesome idea,

 

I did everything to instal the Scripts and that is working fine

 

But you said that is must go to "dayz_code\init\variables.sgf" I only found the line in my init.sqf @ my mission.pbo like you said.

 

But my big question is where can i find it? to add "MetalFloor_Preview_DZ" to line 466. Is there like a program to open it? because i can find the dayz_code\init\variables.sqf into my mission folder or is there an other option.

 

Srry for this question, but I am new in the scripts world.

 

I'm using btw Dayz.st and PBO manager.

 

Kind Regards.

 

Redeyes1987

www.thegoodfellows.net

Link to comment
Share on other sites

hey Axe Cop,

im a fan of your scripts, but can I make it only useable for me?

I mean like, that nobody else can build it.

Because I want to make it not as a Bug-Use script.

Because u can go with the elevator through Cinder-Walls as I tested on my Server.

Thanks for the help

I mean is it able to lock it into my playerid or something like this..

Link to comment
Share on other sites

Hey Guys,

 

The Elevator is a awesome idea,

 

I did everything to instal the Scripts and that is working fine

 

But you said that is must go to "dayz_code\init\variables.sgf" I only found the line in my init.sqf @ my mission.pbo like you said.

 

But my big question is where can i find it? to add "MetalFloor_Preview_DZ" to line 466. Is there like a program to open it? because i can find the dayz_code\init\variables.sqf into my mission folder or is there an other option.

 

Srry for this question, but I am new in the scripts world.

 

I'm using btw Dayz.st and PBO manager.

 

Kind Regards.

 

Redeyes1987

www.thegoodfellows.net

Hi, "dayz_code" is a reference to "Arma 2 Operation Arrowhead\@DayZ_Epoch\addons\dayz_code.pbo" in your client installation of Epoch,

you need to extract that using your PBO manager and copy the file "init\variables.sqf" to your mission file and than change the path in your init.sqf like always, I hope that is understandable now? :)

Link to comment
Share on other sites

hey Axe Cop,

im a fan of your scripts, but can I make it only useable for me?

I mean like, that nobody else can build it.

Because I want to make it not as a Bug-Use script.

Because u can go with the elevator through Cinder-Walls as I tested on my Server.

Thanks for the help

I mean is it able to lock it into my playerid or something like this..

sure you can do that, I am pretty sure I have explained that a few time already :D

You just have to start the script for admins or yourself only, and not all players.

like a simple "if" around the script in the init.sqf should do the trick

if (getPlayerUID player == "12345678") then {
  ["elevator"] execVM "elevator\elevator_init.sqf";
};

that is all, so only the player with the UID 12346789 can use the elevator.

Link to comment
Share on other sites

sure you can do that, I am pretty sure I have explained that a few time already :D

You just have to start the script for admins or yourself only, and not all players.

like a simple "if" around the script in the init.sqf should do the trick

if (getPlayerUID player == "12345678") then {
  ["elevator"] execVM "elevator\elevator_init.sqf";
};

that is all, so only the player with the UID 12346789 can use the elevator.

i had done this before the day, but at me the server started lagging a bit.

At me i edited the popup at the metal floor to get the menu only for me.

 

Hopefully i did it right^^

 

else {
if ((getPlayerUID player) in ["####"]) 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 ((getPlayerUID player) in ["####"]) then {
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];
};
}
};
 
so well i knew how to do the if 's but i wasnt totally sure, because firstly i made it in the building.sqf
 
So everybody had the upgrade Menu, but only I could use it.
But when i changed it to the elevator_init.sqf,
I couldn't do it myself too.
I do programm in school too, (c++)
but i never did ";" after if's thats why i wonder.
Link to comment
Share on other sites

but i never did ";" after if's thats why i wonder.

yeah don't ask me about it, that is like the weird part of the Arma scripting language :p

and you are not alone, I forgot to put the ; after {} blocks all the time, because no other programming language does that and since you have to use  { } anyway I don't know why... :D

 

but if you know c++ Arma script should be fairly easy to learn, there just some minor differences but the basic concepts are the same in most imperative programming languages.

Link to comment
Share on other sites

yeah don't ask me about it, that is like the weird part of the Arma scripting language :P

and you are not alone, I forgot to put the ; after {} blocks all the time, because no other programming language does that and since you have to use  { } anyway I don't know why... :D

 

but if you know c++ Arma script should be fairly easy to learn, there just some minor differences but the basic concepts are the same in most imperative programming languages.

but do you see atleast an error at it? because its not working on my server when i made the "build" only availible for me? Is it because of the ";" because i dont see a fail at this for not working right.

(I get the menu ingame) but when i press nothing happens and i do get a "Upgrade is action" or so

Link to comment
Share on other sites

but do you see atleast an error at it? because its not working on my server when i made the "build" only availible for me? Is it because of the ";" because i dont see a fail at this for not working right.

(I get the menu ingame) but when i press nothing happens and i do get a "Upgrade is action" or so

I thought it was clear you are missing a ";" after two "if" expressions!? :P

Also I am pretty sure if you miss a ";" you will get a syntax error, so you should check your error report file (not the server report file, the client report file, I don't know how many times I've said that, at least 10+ times alone in my threads here in the forums haha)

 

Anyway I thought you know some c++, so what is the point of doing the exact same if condition two times after each other? that makes no sense, just use one!? :D

Link to comment
Share on other sites

HI Axe Cop, this script looks awesome, I haven't quite got it to work yet, I've got it so I get the scroll wheel options come up, I can upgrade a metal floor to be an elevator if I have the right components but when I upgraded a metal floor to be a stop it'd just disappear, I then added the metal floor preview to the allowed objects in the variables.sqf, now when I place any metal floor it just vanishes all together. Any ideas what i'm doing wrong?

Link to comment
Share on other sites

HI Axe Cop, this script looks awesome, I haven't quite got it to work yet, I've got it so I get the scroll wheel options come up, I can upgrade a metal floor to be an elevator if I have the right components but when I upgraded a metal floor to be a stop it'd just disappear, I then added the metal floor preview to the allowed objects in the variables.sqf, now when I place any metal floor it just vanishes all together. Any ideas what i'm doing wrong?

HI, if every objects vanishes I think you have an error in the allowed objects list, can you show me what you changed in the variables.sqf?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...