Jump to content

Elevator Script for Players and Vehicles [WIP/Prototype]


Axe Cop

Recommended Posts

Did try to install it but i do believe it's placed the wrong place in my init file.

if (!isDedicated) then {
        //Conduct map operations
        0 fadeSound 0;
        waitUntil {!isNil "dayz_loadScreenMsg"};
        dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
		_nil = [] execVM "Custom\remote_messages.sqf";
       
	//Run the player monitor
	_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
	_playerMonitor = 	[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";	
	_void = [] execVM "R3F_Realism\R3F_Realism_Init.sqf";
	["elevator"] execVM "elevator\elevator_init.sqf";
};
 
Link to comment
Share on other sites

No that seems about right, do you get any errors or what is the issue.

 

Yea my, bad my ftp client had crashed, and one file where not uploaded. Only problem now i need to get sorted is the StopClass = "MetalFloor_Preview_DZ" Looks my host don't want me to get access to the needed file for adding that. 

Link to comment
Share on other sites

The file should be in your Client code on your own computer. In your Arma II folder, @DayZ_Epoch, addons folder.

Yeah, I get those questions alot these days, is there no FAQ or something for this or "why is my base disappearing" stuff :P

Btw I am working on a small fix to create the elevator local to the player who triggered it, so it will at least be smooth for that player. (e.g. one player built the elevator and another calls it, the elevator object will then be tranfered to the computer who called the elevator so it is local for him (stupid locallity in the ArmA engine!).. at leats until I find a better solution but seem the DayZ/ArmA community can't help me much with that..)

Link to comment
Share on other sites

Something that I would consider is moving to code that moves the object to the server, it might help making it smooth or at least making it so the position is better sync'ed between clients.

 

Otherwise looks good pal  :D

Thanks I might try that! Would be nice if you could do the animation just local, but I didnt't find any way to do that.. :/

 

For now I fixed it a little so the player who activates the elevator will always be local to the platform. This is important when you use the elevator with more players or you die and come back to it, so the locality gets transfered to the user who actually uses it not who build or first activated the elevator. :)

Also some small additions: the next/previous stop menu will now only be displayed when the elevator can travel there, not always like before.

Link to comment
Share on other sites

hey buddy having trouble with this.. the upgrage metal floor comes up but  then it says no upgrade available.

 

in my inventory i have

 

crowbar

toolbox

metal floor

4 metal poles..

jerry can

engine

and generator.

 

the only thing i am not able to get into my inventory is the MEtal Floor preview...  so when spwnd from tools unable to debuild to place in my inventory..

then tried setting it ontop of the currnet metal floor. still nothing 

since i couldnt find a way to put the metal floor preview in my inventory ..

i changed your Elev. Init.. to use the same dayz. metal floor but still nothing happens.. any help is greatly appreciated..

 

 

 

 

SKYPE:: Deadlokd

 

Email. [email protected]

 

 

Btw.. i REALLY LOVE YOur scripts. just tryin to make it work.. thanks again.

 

 

 

 

 

here is my INIT

::::::::::::::::::::::::::::::::::::::::

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

 

 

 

elevator folder is located in root folder

thanks again

 

 

 

UPDATE::::

even removed this from the elevator INi..

 

// global variables
if (isNil "ELE_PlatformClass") then { ELE_PlatformClass = "MetalFloor_DZ" };
if (isNil "ELE_StopClass") then { ELE_StopClass = "MetalFloor_DZ" };
if (isNil "ELE_MaxRange") then { ELE_MaxRange = 25 }; // m
if (isNil "ELE_Size") then { ELE_Size = 4 }; // m
if (isNil "ELE_Speed") then { ELE_Speed = 2 }; // m/s
if (isNil "ELE_StopWaitTime") then { ELE_StopWaitTime = 5 }; // s
if (isNil "ELE_UpdatesPerSecond") then { ELE_UpdatesPerSecond = 60 }; // animation updates per second
if (isNil "ELE_RequiredBuildTools") then { ELE_RequiredBuildTools = ["ItemToolbox", "ItemCrowbar"] }; // required tools for building an elevator and elevator stop
 
                  //if (isNil "ELE_RequiredBuildItems") then { ELE_RequiredBuildItems = [["PartGeneric",4], "PartEngine", "ItemGenerator", "ItemJerrycan"] }; // required items to build an elevator
               //if (isNil "ELE_RequiredBuildStopItems") then { ELE_RequiredBuildStopItems = [["PartGeneric",4]] }; // required items to build an elevator stop
if (isNil "ELE_Debug") then { ELE_Debug = false }; // debug flag
 
 these 2 lines i commented out. to see if i could bypass the tools and items needed
but still same thing.. NO UPGRADE available.. its says upgrade floor, but then i click it i get the no upgrade msg..
 
what am i doing wrong. this script is pretty simple...
 
 
 
ELE_elevator = nil;
Link to comment
Share on other sites

hey buddy having trouble with this.. the upgrage metal floor comes up but  then it says no upgrade available.

 

in my inventory i have

 

crowbar

toolbox

metal floor

4 metal poles..

jerry can

engine

and generator.

 

the only thing i am not able to get into my inventory is the MEtal Floor preview...  so when spwnd from tools unable to debuild to place in my inventory..

then tried setting it ontop of the currnet metal floor. still nothing 

 

 

since i couldnt find a way to put the metal floor preview in my inventory ..

i changed your Elev. Init.. to use the same dayz. metal floor but still nothing happens.. any help is greatly appreciated..

 

SKYPE:: Deadlokd

 

Email. [email protected]

 

 

Btw.. i REALLY LOVE YOur scripts. just tryin to make it work.. thanks again.

Hey there, first you don't need to have metal floors in your inventory, you build them like you always do and if you look at it you should get a white option to upgrade it to an elevator next to the default upgrade option you know. Take a look at my first video I build an elevator from scratch.

second please don't use the same object class for the elevator platform and stop point, that will be buggy since the script can't differentiate between those if they are of the same type and it makes no sense to use a metal floor as a stop point, because you will die (it will crush you, at least if you go up to the next level lol). If you want change it to seomething other maybe a small objekt like a lockbox (LockboxStorageLocked) that should work because it is small, but may look weird. :P

And the menu will always appear no matter if you have the tools and items or not, it will just display a message AFTER you activate the upgrade options with what is missing.

 

The process should be always like this:

  • build an object ob type ELE_PlatformClass (default a metal floor) where you want the elevator to be
  • upgrade it to an elevator (need the tools and items for that, but menu should be always visible if you look at the metal floor)
  • build another objects of type ELE_PlatformClass where the stop point(s) should be
  • upgrade it to an elevator stop (elevator must be selected first, if you have just built one before it will already be selected, also need the same tools but here the upgrade items), this will swap the metal panel with the ELE_StopClass (so default the transparent preview metal panel, you don't need to do that, the script does that for you)
Link to comment
Share on other sites

Yeah sorry it's 2 am here I got to go soon :/

I still don't know what your problem is, don't you know how to build metal floors or what? everything else will be displayed in game if you installed the script correctly.

PartGeneric is scrap metal!! it is just the item ame but ingame you will see the display name (scrap metal not PartGeneric). But as I've said at least 3 times it will show you the missing parts in game, like with any othe upgrade in the default epoch! The config is only needed if you want to change the required parts on your server, you can leave it as the default or set it to "[]" so you won't need any items to test it.

 

Edit: oh yeah I see your error, please read the first post how to install my script you have provided the wrong parameter count (well nothing haha, THAT will log an error to your report file in case you take a look at that it will say "Error: elevator_init.sqf called with wrong parameter count (the only parameter should be the folder of the script relative to the mission folder)"), anyway here the fix, as in the first post start it like this:

["elevator"] execVM "elevator\elevator_init.sqf";

If you really want to put all my scripts in the root mission folder (but why)? then you can use "" indead of "elevator", but I would not do that..

 

Anyway you produced some more errors, you can't just uncomments the variable sin my init file that is a script error, please if you donÄt knwo what you are doing don't change my files and use the global variables as i have said in the first post.. sorry but it seems you don#t understand what I mean or cant read my first post since I have to repeat it 10x times :D

Link to comment
Share on other sites

yes.. i do know how to build.. thats what im saying , in your video u have the option UPgrade to elevator.. my menu only shows upgrade metal floor.. no other submenus.. .. im gonna put yours back in like you put it..  could it be where im putting the INit line you said to add.. does it go here?

 

here is my INIT

::::::::::::::::::::::::::::::::::::::::

if (!isDedicated) then {[] execVM "Scripts\kh_actions.sqf";
//Conduct map operations
0 fadeSound 0;
waitUntil {!isNil "dayz_loadScreenMsg"};
dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
[] execVM "scripts\repairactions.sqf";
[] execVM "scripts\kh_door.sqf";
[] execVM "elevator\elevator_init.sqf";
//Run the player monitor
_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
_playerMonitor =  [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
_void = [] execVM "R3F_Realism\R3F_Realism_Init.sqf";
Link to comment
Share on other sites

well im redoing your script from begining again. we shall see.. thanks again.. 

Yeah sorry for the confusion, if you install it wrong you won't get the upgrade options of course :D

 

Here some help, don't change my files but do it this way if you don't want to use any tools or items to test it:

ELE_StopClass = "LockboxStorageLocked"; // will use the lockbox as stop object to call the elevator and set the positions, onyl if you don't want to us ethe trasnparent metal floors...
ELE_RequiredBuildTools = [];
ELE_RequiredBuildItems = [];
ELE_RequiredBuildStopItems = [];
["elevator"] execVM "elevator\elevator_init.sqf";

That will do it, no need to change any other files than the init.sqf, my script files should be in the "elevator" folder for that to work.

Link to comment
Share on other sites

ok will try that.. thanks again.. i know what your going thru im usually up till 5 scripting and helping others.. thanks again. and good luck.. 

 

It Worked. Sort of..

 

i build both floors, i didnt change your item names. 

only removed the tools and other stuff required to build , just for testing purposes..

 

i can now build.. and select

 

Elevator Start..

and Elevator stop. 

 

BUT>>>>>>>>

 

after that i Only get the Menu  Select Elevator.. and when clicked it says Elevator 1,, 

 

there is no menu to activate the elevator to go up

.. 

Link to comment
Share on other sites

awesome script, added it to my server and players love it .it adds a whole new dimension to base building .

tnx 

could you give me some help with mine mate ? when i upgrade to lift stop the floor vanishes and nothing is their so lift wont work. if i change it to lockbox it works :-S

Link to comment
Share on other sites

By the sounds of it you haven't followed the instructions properly.

Just one more thing, as 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. 
To do that the class needs to be added to the file "dayz_code\init\variables.sqf", at line 466 there is a list "dayz_allowedObjects", just add "MetalFloor_Preview_DZ" to that list and copy the file to your mission folder as usual (the file is referenced in the init.sqf). if you don't want to do that just replace the stop class with this config variable:

ELE_StopClass = "MetalFloor_Preview_DZ";
Link to comment
Share on other sites

I just got home, sorry guys :D

 

@renegade2k6 thanks for the answer, some people should read the first post maybe ^^

 

i can now build.. and select

 

Elevator Start..

and Elevator stop. 

 

BUT>>>>>>>>

 

after that i Only get the Menu  Select Elevator.. and when clicked it says Elevator 1,, 

 

there is no menu to activate the elevator to go up

.. 

That's weird if there is no option to go to the next or previous stop the script can' find any in range!

Are you sure you have upgraded to a stop point, can you call the elevator from that point? (there should be a menu "Call Elevator" and it will move to the stop point)

Link to comment
Share on other sites

super thanks mate have it working now :-) a little glitchy but it works .. but when i put a second stop down i get a error message saying - elevator stop already exists msg (sorted had to waity for hive to update :-p

No you don't have to wait, that message means there is already a stop :p

You have to move the elevator to the last stop to add another, e.g. if you want to add a 2nd stop move the elevator to the 1st and then you can build another..

it has many reasons I did it that way, you have control where to put another stop (in case you remove an old one, players can't remove building parts yet but admins may do that :p) and it is easier to do the internal algorithms like that. :D

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