[SCRIPT] TELevator - implementing ELEVATORS through TELEPORTING

  • Another attempt at a script; it is still a very BETA version and bugs may lurk after any corner; however I hope it will be useful: tests, suggestions, comments and criticisms are welcome. Several parts of the code have been adapted from the Portals script by @yahgiggle and RichieS for the Rising Cities server.


    Version 0.1 - Features


    *) Implements the concept of elevator, which just a name and an id to which levels will belong.


    *) Implements the concept of level, which is a physical cube in the world: it has a size and a position, belongs to an elevator and has a specific order within that elevator. The player has to be in one of this cubes for the elevator to work. From this level he can be teleported to any other level of the elevator with the command /floor n (where n is the destination level), but not to a level of another elevator, of course!


    *) In addition to creating and deleting elevators and levels, it is possible to visually show and hide them and to have a list.


    Commands


    /elev new <name>creates a new, empty elevator, named <name>. E.g.: /elev new house
    /elev selectlevelstart the process to select a 3D area which will become a level (much like defining the span of a new blueprint)
    /elev newlevel <elev.ID> <level number>created the <level number>-th level for the <elev.ID>-th elevator, using the 3D area just selected. The elevator has to be created in advance. E.g.: /elev newlevel 1 5
    /elev delete <elev.ID>deletes the elevator and all its levels. E.g.: /elev delete 1
    /elev deletelevel <elev.ID> <level number>deletes the given level of the given elevator. E.g.: /elev deletelevel 1 5
    /elev listlists the elevator and their levels
    /elev showvisually shows the elevators
    /elev hidehides the elevators
    /floor <level number>teleport the player to that floor, if (s)he is in an elevator and that floor exists


    *) All the /elev ... commands can be reserved to admins only by setting adminsOnly=true in the file config.properties or left open to all players with adminsOnly=false.


    *) Elevator IDs are generated automatically and are not necessarily supposed to be in sequence. The /elev list command also lists the elevator IDs.


    *) Level numbers also do not need to be in sequence, but it is usually clearer to do so. Level do not even need to be one above the other in a column like in reality; if you like to be creative, the levels of an elevator can be in any position!


    *) Level numbers start from 1. I apologise to the cultures which number the ground floor differently (including my own), but sticking to numbers make things much easier.


    Installation


    Extract the files in the ZIP placing the whole TELevator folder into the scripts folder of RW.
    Edit the config.properties file, if you want to leave all the commands available to all players, rather than to admins only (the default).


    Open points and known issues


    *) The script has only been alpha-tested! There might be bugs of any kind! Please test it, if you are interested, and report issues in a way which allows me to reproduce them and be patient. Thank you!


    *) The message displayed when starting the area selection for a new elevator level says: Select the area, stand on the platform and use "/elev createlevel" to save it. This refers to an older version of the script. Use the /elev newlevel command instead!.


    *) The script uses a database relative to the script itself not to the world; this makes it less suited to single-player multi-world contexts, as the names, positions and numbers of elevators and levels will be common to all worlds. However, I am reluctant to pollute the world database with extraneous data.


    *) When the player first appears in the world, it may takes a few seconds and/or the player has to move at least a little bit before the script recognises the player position. This depends on how data are filled by RW and there is little I can do about


    Enjoy! M.

  • Whats changed besides the names oO ? what does this script do that our portal script did not it sounds interesting

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png

    Edited once, last by yahgiggle ().

  • *) It adds the concept of a group (= elevator) of teleporting points (= levels) and groups are mutually exclusive.


    *) Of course, it adds the management of these groups (creation, deletion, list).


    *) Tele points are both sources to all other points and destinations from all other points within the same elevator at player's choice and command and not automatically point-to-point.


    *) It adapts the UI to these concepts.


    These are points I can think of on the spot. Sure, the point of departure has been the Portals script, which I acknowledged both in the source and in the post above. If your license model requires more conditions to fulfil, please describe them and I'll try to comply.

  • i like that you took our script or parts of it and changed it for your needs as long as users don't just copy and stick there names on it we are happy as :-D

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • i like that you took our script or parts of it and changed it for your needs as long as users don't just copy and stick there names on it we are happy as :-D


    Thanks, @yahgiggle. I usually try to comply with license models and, at least, I try to acknowledge all the debts I know of. But occasionally I may oversight some important details or meet someone who is particularly picky. And, really, if you prefer I add more details about the original source -- for instance a persistent URL where to obtain your script from -- or anything else, simply tell me.


    duuuuuuuuuuuude better idea then what i was doing for vorvator. i happily concede the race to make a elevator script :D


    It was not a race (hmmm... well... maybe a little bit, but only a little bit ;) ). And anyway we still have to see if it works only 'in the lab' or also 'in the field'!


    I also thought of 'recycling' the [1] to [5] keys to select the destination floor, much like the 'real' buttons of an elevator at least for the first 5 floors, hooking into the PlayerQuickslotChange event (in the source there is some code commented out).


    But there seem to be problems with that event and I could not understand if it is me or an issue with the API framework. If anybody want to waste time in this... :rolleyes:

  • After you do step 2 it asks you to create level but i cannot get the code correct i tried /elev createlevel 1 1 and different variations of this but cannot get to work. Can you give me directions for creating the first level?

  • i built an elevator "box" i done step 1 /elev new<name> got my ID # then did step 2 /elev selectlevel had me highlight the area and said i needed to stand on platform and createlevel the create level is the command i can not get right it keeps showing unknown command no matter how i type it in and highlight still stays on area i have tried typing /elev createlevel, /elev create level, /createlevel, /create level, /elev createlevel 1<ID#>, /elev create level 1, /create level 1, /createlevel 1, /elev createlevel 1 1<floor level>, /elev create level 1 1 i have tried every variation i could think of to create level but keeps saying unknown command. how should the create level command be written?

  • @jackripper: I see, as described in the list of commands a the beginning of the thread and in the help sub-command, the command to create a new level is:


    /elev newlevel <elevalor_id> <level_number>


    Assuming you are dealing with the first elevator created -- which has an ID of 1 -- and with the floor number 2 of this elevator, the command will be:


    /elev newlevel 1 2


    With a different elevator, the first number (1 in the example) will be different and for a different level (or floor) the second number (2 in the example) will be different.


    You are right that the message displayed on the screen when starting the area selection process, tells about a "createlevel" sub-command; which was a previous version. I apologise for the inconsistency and I am surprised nobody noticed it so far. As it is unlikely that the LUA script will be updated (I am rather porting it to Java), I'll add a note to the description at the start of the thread.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!