MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "Setting_up_Vents",
        "continue": "gapcontinue||"
    },
    "warnings": {
        "main": {
            "*": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."
        },
        "revisions": {
            "*": "Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."
        }
    },
    "query": {
        "pages": {
            "20": {
                "pageid": 20,
                "ns": 0,
                "title": "Scheduler Lua API",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "<!-- This file is auto generated, please don't edit manually! -->\n= Scheduler =\n== Description ==\nThe Scheduler api allows users to Schedule callback events based on specific time values\n== Functions ==\n=== CallInSecsReal ===\n<syntaxhighlight source lang=\"lua\">Scheduler.CallInSecsReal(func, timeInSecs)</syntaxhighlight>\n'''Expected parameter types'''\n{| class=\"wikitable\"\n|-\n! Name !! Type\n|-\n| func || Lua Type\n|-\n| timeInSecs || number\n|}\n'''Description''': Schedule a lua function to be called after timeInSecs in real time (counting time even if the game is paused, in a menu, or in conversation etc)\n\n'''Returns''': The id of the scheduled event\n\n=== CallInSecs ===\n<syntaxhighlight source lang=\"lua\">Scheduler.CallInSecs(func, timeInSecs)</syntaxhighlight>\n'''Expected parameter types'''\n{| class=\"wikitable\"\n|-\n! Name !! Type\n|-\n| func || Lua Type\n|-\n| timeInSecs || number\n|}\n'''Description''': Schedule a lua function to be called after timeInSecs in game time (time doens't count when the game is paused)\n\n'''Returns''': The id of the scheduled event\n\n=== CallAtTime ===\n<syntaxhighlight source lang=\"lua\">Scheduler.CallAtTime(func, dateTimeString)</syntaxhighlight>\n'''Expected parameter types'''\n{| class=\"wikitable\"\n|-\n! Name !! Type\n|-\n| func || Lua Type\n|-\n| dateTimeString || string\n|}\n'''Description''': Schedule a lua function to be called at specific time (defined by a date/time string formatted as dd/MM/yyyy/HH:mm)\n\n'''Returns''': The id of the scheduled event\n\n\n\nThis file is auto generated, please don't edit manually!\n\n'''Docs last hacked together on''': 29/08/2023 16:24\n[[Category:Modding]][[Category:LuaAPI]]"
                    }
                ]
            },
            "63": {
                "pageid": 63,
                "ns": 0,
                "title": "Setting up Doors",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "\n== Adding the door into your scene ==\n\nFirstly you need to add the door prefab to your level and position it as you'd like it to appear in-game. To do this in your Project Folder you need to navigate to the Doors folder (see below) and choose the prefab which you prefer by dragging it into your Scene. For this tutorial we'll use a Swinging Door with Scanners so that once set up properly, it will require a correct ID Card to open. Once you have placed and positioned the door in a doorway you will be able to see it in-game and it should open if you used a door prefab - you will know if you have used the correct prefab because when in the Inspector view if you click on your door, it should already have an Animator and Door Script component.\n\n[[File:DoorPrefabFolder.png|400px|thumb|none|The folder that contains the door prefabs]]\n\n== Getting access to a locked door by using hackable objects ==\n\nIf you wanted your door to be locked when you begin playing your level, click on your door and in the Inspector view under Door (Script) tick the box next to IsLocked. Now when you load into your level your player will not be able to open the door unless they have key access to the Zone Default.\n\nNext you will want to set the Zone of the door to something unique, for now we'll call it \"admin\". \n\n[[File:DoorState.png|400px|thumb|none|Here you can change the Zone of the door, and whether it is locked or open upon starting your level in-game]]\n\nNow we will want to create a hackable object (link?) in both our scene and our mission script. Once you have set up and connected the hackable object to a network, as well as [[Mission Scripting#Adding in Networks|connecting the door to the network]] we can now edit the hackable object's script to give us access to a specific Zone that a door is using.\n\nIn this guide, 'adminkey' will be the key that is related to the Zone 'admin' to make sure this has been set up check your mission script has this line of code: <code>Doors.SetZoneKeys(\"admin\", {\"adminkey\"})</code>. By default the player will not have access the key \"adminkey\" unless we give it to the player straight away in SetupMission(). However we don't want the key to be given to the player, we want the player to gain access to the key by having to hack into a device. \n\nWe will use the same variable and file names as the [[Mission Scripting]] tutorial. This will include the following:\n\n<syntaxhighlight source lang=\"lua\" line start=66>\n\tdevices = {\n\t\tlaptop = {\n\t\t\tinternalName = \"laptop\",\n\t\t\tscript = \"Scripts/Devices/laptop.lua\",\n\t\t},\n\t},\n</syntaxhighlight>\n\nOur device will be in the table <code>laptop</code>, and the script for the device will be found in <code>laptop.lua</code>. It will be assumed that the hackable device has been added to SetupMission(), check the [[Mission Scripting]] tutorial if you need help on this.\n\nIn the <code>laptop.lua</code> file we will have the following code.\n\n<syntaxhighlight source lang=\"lua\" line start=1>\n\tdevice = {\n\t\tcanAccess = function()\n\t\t return true\n\t\tend,\n\t\tgui = {\n\t\t\ttype = \"ncurses\",\n\t\t\tupdateEveryFrame = false,\n\t\t\theader = [[Office door system]],\n\t\t\tbackgroundColour = {0.0, 0.0196, 0.7765},\n\t\t\thighlightColour = {0.8863, 0.0, 0.0627},\n\t\t\tbuttons = {\n\t\t\t\t\t{\n\t\t\t\t\tname = \"user\",\n\t\t\t\t\tsubButtons = {\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname = \"admin\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname = \"internship at security department.doc\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname = \"access_data\",\n\t\t\t\t\tsubButtons = {\n\t\t\t  {\n\t\t\t\t\t\t\tname = \"admin_door_access.pgp\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\t}\n</syntaxhighlight>\n\nAt this point the device will be hackable though the player will not be able to actually trigger anything from hacking into the device. To do this you will want to add this below a sub-button, we'll put it below the <code>\"admin_door_access.pgp\"</code> sub-button.\n\n<syntaxhighlight source lang=\"lua\" line start=12>\n\t{\n\t\tname = \"access_data\",\n\t\tsubButtons = {\n\t\t\t{\n\t\t\t\tname = \"admin_door_access.pgp\",\n\t\t\t\tonClick = function()\n\t\t\t\t\tprint(\"clicked\")\n\t\t\t\tend,\n\t\t\t},\n\t\t},\n\t},\n</syntaxhighlight>\n\nFinally we want it so that when the <code>\"admin_door_access.pgp\"</code> is clicked, the player gets access to the key \"adminkey\", which has been set up to open doors of the Zone \"admin\" - essentially meaning that the player will be then be able to open and close the door we have created. To do this we just add a small line of code inside the function as shown below.\n\n<syntaxhighlight source lang=\"lua\" line start=12>\n\t{\n\t\tname = \"access_data\",\n\t\tsubButtons = {\n\t\t\t{\n\t\t\t\tname = \"admin_door_access.pgp\",\n\t\t\t\tonClick = function()\n\t\t\t\t\tRunMissionCommand([[Doors.AssignKeyToCharacter(\"adminkey\", mission.characters.joe)]])\n\t\t\t\tend,\n\t\t\t},\n\t\t},\n\t},\n</syntaxhighlight>\n\nThis is assigning the key <code>\"adminkey\"</code> to the character <code>joe</code> which if you remember is the player: you! So now if you try and interact with your door which is of the Zone \"admin\", it will unlock and open like in the GIF below!\n\n[[File:KeycardDoorOpen.gif|400px|thumb|none|(Click to see) The door opening as seen in-game]]\n\n== Changing the opening animation direction ==\n\nIf for example you are in a narrow corridor and you want to open a door, it would be convenient for the door to open outwards away from you, otherwise the door will push towards and into you, disrupting your movement and potentially your vision ahead.\n\nTo change the direction of which the door opens is quite simple, though the procedure slightly differs between doors with and without keycard scanners.\n\n=== For doors without keycard scanners ===\nFirstly you need to click on the handle of your door - make sure you are selecting the handle which is the one that the player will be interacting with to open the door. Then under the 'Mission Object (Script)' click on the tickbox underneath the 'On Interaction Start' (see below), it may or may not be ticked already, either way reversing its current status will reverse the opening direction. If the player might interact with the door again, you should ideally do the exact same to the handle on the other side of the door. \n\n[[File:DoorHandleOpen.png|400px|thumb|none|The red circle shows the tickbox that you should click to reverse the opening direction of the door when interacting with that handle]]\n\n=== For doors with keycard scanners ===\n\nLikewise to doors without keycard scanners, it is just a matter of ticking or unticking a tickbox, however this time we are selecting the actual keycard scanner and not the handle. If the door currently opens inwards towards the player, select the keycard scanner which the player is interacting with and you should see components in the Inspector view similar to the ones seen in the picture below. All you do now is click on the tickbox for 'Is Front' (circled in red below), so if the tickbox was ticked, you just need to untick it, and vice versa for if it was unticked.\n\n[[File:ScannerOpen.png|400px|thumb|none|The red circle shows the tickbox that you should click to reverse the opening direction of the door when interacting with that keycard scanner]]"
                    }
                ]
            }
        }
    }
}