Guest User

Mission Example - Hacknet Extensions

a guest
May 23rd, 2017
4,883
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 16.97 KB | None | 0 0
  1. <?xml version = "1.0" encoding = "UTF-8" ?>
  2. <!--
  3. Hacknet mission descriptor file
  4.  
  5. Note: This format is pretty hacked together, and is a lot clunkier than the computer loader one.
  6. Not changing this was part of my "No re-writes" policy for Hacknet, so some of the elements are
  7. very strict about their ordering and case sensitivity. Be careful, and test!
  8. -->
  9.  
  10. <!--
  11. id : the mission ID - this isn't used in-code but is sometimes useful in debugging and testing.
  12.  
  13. activeCheck : if this is set to true, when this mission is active, Hacknet will test for this mission being complete
  14.              every frame, instead of only when the player responds to an email. This is very useful for creating delays,
  15.              and for situations where the player is contacted from outside an existing chain.
  16.              
  17. shouldIgnoreSenderVerification : This prevents the check to ensure that the player responded to the right sender
  18.                                 when checking for mission completion.
  19. -->
  20. <mission id="testMission0" activeCheck="true" shouldIgnoreSenderVerification="false">
  21.   <goals>
  22.     <!-- All goals added to a mission have to be complete before the mission will complete-->
  23.    
  24.     <!-- Task to delete the file on node target, at path/file
  25.    This entry asks for deletion of home/asdf.txt on machine with ID "missionTestNode"-->
  26.     <goal type="filedeletion" target="advExamplePC" file="asdf.txt" path="home"/>
  27.  
  28.     <!-- Task to delete ALL files on node target, in the folder at path -->
  29.     <goal type="clearfolder" target="advExamplePC" path="home"/>
  30.  
  31.     <!-- Task to download the file at the path
  32.    This entry asks for the player to download (SCP) home/asdf.txt on machine with ID "missionTestNode"-->
  33.     <goal type="filedownload" target="advExamplePC" file="downloadFile.txt" path="home"/>
  34.  
  35.     <!-- Task to add the text specified by keyword to the specified file. This is usually achieved by the "replace" command.
  36.    It's possible to make the keyword a larger block and task the player to replace one file with another.
  37.    This entry asks for the player to add the test "extension" top the file home/asdf.txt on machine with ID "missionTestNode"-->
  38.     <goal type="filechange" target="advExamplePC" file="changeFile.txt" path="home" keyword="extension"/>
  39.  
  40.     <!-- Task to remove the text specified by keyword to the specified file. This is usually achieved by the "replace" command.
  41.    The extra attribute "removal" tasks the player with removing a block of text from a file. Combining this with another filechange
  42.    task can require a "replacement" of text (removing some, adding a different block).
  43.    This entry asks for the player to add the test "extension" top the file home/asdf.txt on machine with ID "missionTestNode"-->
  44.     <goal type="filechange" target="advExamplePC" file="changeFile.txt" path="home" keyword="data" removal="true" caseSensitive="true"/>
  45.    
  46.     <!-- Task to get admin on the target system.
  47.    NOTE: This will only be 'passed' if the player responds *while they are the admin of the system*
  48.    Servers that have an "admin" field that resets the password automatically will make this mission not complete if
  49.    it's reset in the time that the player takes to disconnect from the system and respond-->
  50.     <goal type="getadmin" target="advExamplePC"/>
  51.    
  52.     <!-- Task to require a string passed in via the "Additional Info" field in the reply email screen.
  53.    This task requires the player to reply with the string "password" added.-->
  54.     <goal type="getstring" target="password" />
  55.    
  56.     <!-- This task will not complete until [time] seconds after the first attempt to complete it has been made.
  57.    This is mostly only useful for use with the "activeCheck" flag on the mission set to true.
  58.    A mission with a delay goal, that is silenced and that's set to auto-check essentially acts as a delay timer buffer between responses for missions
  59.    This can add a human-feeling response time to missions.-->
  60.     <goal type="delay" time="10.0"/>
  61.    
  62.     <!-- This will only accept if the target flag has been set.
  63.    Mission end functions can use the function addFlags:[flagname],[flagname2],[etc] to set flags, then you can have a mission only complete if a flag is set.
  64.    Some daemons add flags when events happen. For example, a pacemaker server adds the flag "PATIENT_NAME:DEAD" when the patient dies.
  65.    -->
  66.     <goal type="hasflag" target="flagName"/>
  67.  
  68.     <!-- Task to upload the file on server bitMission00 at bin/target_filename.txt to server with ID "destComp" to folder bin
  69.    The folder name Dest/Uploads is the folder that files are uploaded to when using an Upload server daemon, so it's the most useful location normally-->
  70.     <goal type="fileupload" target="advExamplePC" file="asdf.txt" path="home" destTarget="introFactionHomeNode" destPath="Drop/Uploads"/>
  71.  
  72.     <!-- For upload tasks, adding the flag decrypt=true requires the player the decypher the file before uploading it. If that file is password protected, you must include the password
  73.    in the goal with decryptPass="password"
  74.    For uploading encrypted files - put the encrypted name here (ending with .dec usually). It doesn't matter what the filename of the decrypted one becomes
  75.    The code will check for the right content.-->
  76.     <goal type="fileupload" target="advExamplePC" file="asdf2.dec" path="home" destTarget="introFactionHomeNode" destPath="home" decrypt="true" decryptPass="password"/>
  77.  
  78.     <!-- Task to add the degree matching the degree name and uni and GPA details for the listed owner. This task *requires* an academic server to exist.
  79.    An owner is defined by name - to add a person to the simulation, define them in the People folder and refer to them by name here
  80.    The academic server must have the following properties:
  81.    1: ID must be "academic"
  82.    2: It must contain an Academic Database Daemon-->
  83.     <goal type="AddDegree" owner="John Stalvern" degree="Masters in Digital Security" uni="Manchester University" gpa="3.0"/>
  84.    
  85.     <!-- Task to remove all degrees from the academic server for a specified owner. Note that for this one, you *MUST* have the ID of your database be "academic" or it wont find it. -->
  86.     <goal type="wipedegrees" owner="John Stalvern"/>
  87.  
  88.     <!-- Task to have an email sent to a specified address with a defined subject. This one requires an email
  89.    be sent to mailuser123@jmail.com with the subject "Email Subject!". More specifically, it requires that file to exist in their inbox
  90.    folder on the server ID "jmail" that contains a mail server.
  91.    This is mostly useful for detecting sent medical records from a medical database.
  92.    Medical records have the subject line: "MedicalRecord - Lastname_Firstname"-->
  93.     <goal type="sendemail" mailServer="jmail" recipient="mailuser123" subject="Email Subject!"/>
  94.    
  95.     <!-- Death row missions not implemented for mods yet
  96.    goal type="removeDeathRowRecord" fname="Matt" lname="Trobbiani"/>
  97.    goal type="modifyDeathRowRecord" fname="Matt" lname="Trobbiani">Last Words Here</DeathRowMission>
  98.    -->
  99.    
  100.     <!-- DLC Goals -->
  101.     <goal type="getadminpasswordstring" target="advExamplePC"/>
  102.    
  103.   </goals>
  104.  
  105.   <!-- The following items all need to in-order, so be careful. -->
  106.  
  107.   <!-- missionStart (Optional - just remove it to not use it) allows you to define a function that gets run when a mission is Loaded in.
  108.  If suppress is set to true, it will only activate when the mission email is sent -
  109.  otherwise it will activate when it is loaded. This is very important to remember when
  110.  writing missions designed for use in a hub server - those missions are loaded when the save game is loaded
  111.  or a new game is started.
  112.  
  113.  val: This field lets you pass in integer data to the specified function
  114.  
  115.  The content field is the function name. Following are the available functions:
  116.  
  117.  setFaction:FACTION_ID
  118.  -Used like setFaction:entropy, sets the player's current faction to the faction with the given idName
  119.  
  120.  addRank
  121.  -This adds val in rank to the player's current active faction
  122.  
  123.  addRankFaction:[FACTION NAME]
  124.  -this adds the val to the specified faction. I.E: "addRankFaction:CSEC"
  125.  
  126.  addFlags:flagname1,flagname2,flagname3,etc
  127.  Adds the defined (1 or more) flags to the current session. Flags can unlock missions and do other tasks
  128.  
  129.  removeFlags:flagname1,flagname2,flagname3,etc
  130.  Removes the listed flags if they exist.
  131.  
  132.  changeSong
  133.  -changes to the song defined in val:
  134.  case 1:
  135.  default:
  136.      MusicManager.transitionToSong("Music\\Revolve");
  137.      break;
  138.  case 2:
  139.      MusicManager.transitionToSong("Music\\The_Quickening");
  140.      break;
  141.  case 3:
  142.      MusicManager.transitionToSong("Music\\TheAlgorithm");
  143.      break;
  144.  case 4:
  145.      MusicManager.transitionToSong("Music\\Ryan3");
  146.      break;
  147.  case 5:
  148.      MusicManager.transitionToSong("Music\\Bit(Ending)");
  149.      break;
  150.  case 6:
  151.      MusicManager.transitionToSong("Music\\Rico_Puestel-Roja_Drifts_By");
  152.      break;
  153.  case 7:
  154.      MusicManager.transitionToSong("Music\\out_run_the_wolves");
  155.      break;
  156.  case 8:
  157.      MusicManager.transitionToSong("Music\\Irritations");
  158.      break;
  159.  case 9:
  160.      MusicManager.transitionToSong("Music\\Broken_Boy");
  161.      break;
  162.  case 10:
  163.      MusicManager.transitionToSong("Music\\Ryan10");
  164.      break;
  165.  case 11:
  166.      MusicManager.transitionToSong("Music\\tetrameth");
  167.      break;
  168.      
  169.  loadConditionalActions:DLC/ActionScritps/HermeticAlchemistsActions.xml
  170.    
  171.    setHubServer:[SERVER ID]
  172.    - Sets the server with the given ID to be the new hub server visually on the netmap.
  173.    - this adds the little spinny things around it, like CSEC has in the base game.
  174.    
  175.    setAssetServer:[SERVER ID]
  176.    - Sets the server with the given ID to be the new asset server visually on the netmap.
  177.    - this adds the little star inside it
  178.    
  179.    
  180.    playCustomSong:[PATH_TO_SONG]
  181.    -Fades the music into the song file specified. Needs the whole path like: Music/Song.ogg
  182.    -Songs must be in Ogg Vorbis (.ogg) format
  183.    -Songs will not play on the XNA branch!
  184.    
  185.    playCustomSongImmediatley:[PATH_TO_SONG]
  186.    -Plays the specified song above without the fade in - instantly snaps to it.
  187.      
  188.      #####################################
  189.      ### FOR LABYRINTHS DLC USERS ONLY ###
  190.      #####################################
  191.      
  192.    changeSongDLC
  193.    with values:
  194.    case 1:
  195.    default:
  196.        MusicManager.transitionToSong("DLC\\Music\\Remi2");
  197.        break;
  198.    case 2:
  199.        MusicManager.transitionToSong("DLC\\Music\\snidelyWhiplash");
  200.        break;
  201.    case 3:
  202.        MusicManager.transitionToSong("DLC\\Music\\Slow_Motion");
  203.        break;
  204.    case 4:
  205.        MusicManager.transitionToSong("DLC\\Music\\World_Chase");
  206.        break;
  207.    case 5:
  208.        MusicManager.transitionToSong("DLC\\Music\\HOME_Resonance");
  209.        break;
  210.    case 6:
  211.        MusicManager.transitionToSong("DLC\\Music\\Remi_Finale");
  212.        break;
  213.    case 7:
  214.        MusicManager.transitionToSong("DLC\\Music\\RemiDrone");
  215.        break;
  216.    case 8:
  217.        MusicManager.transitionToSong("DLC\\Music\\DreamHead");
  218.        break;
  219.    case 9:
  220.        //USERSPACE
  221.        MusicManager.transitionToSong("DLC\\Music\\Userspacelike");
  222.        break;
  223.    case 10:
  224.        MusicManager.transitionToSong("DLC\\Music\\CrashTrack");
  225.        break;
  226.      
  227.  
  228.    
  229.      
  230.   The rest of the functions you'll see in the game's core missions are custom ones written to be triggered a single time, with custom code.
  231.   If you have any requests for additions functions to be added for use in your mods, send an email request to matt@hacknet-os.com and i'll
  232.   see what I can do.
  233.  -->
  234.   <missionStart val="7" suppress="true">changeSong</missionStart>
  235.  
  236.   <!-- Same as mission start (this is also optional), but this happens when the mission is completed.
  237.  Note that this will never trigger if the mission is abandoned or otherwise lost.-->
  238.   <missionEnd val="1">addRank</missionEnd>
  239.  
  240.   <!-- This defines the path to the next mission file. The mission file at this path will be loaded, and email sent when the current mission is completed.-->
  241.   <!-- The IsSilent flag is... admittedly in a terrible place here. It silenced THIS mission, not the next one. This means that if you set
  242.  IsSilent to be true here, this mission will not send and email when it is loaded.-->
  243.  
  244.   <!-- Important detail about mission completion: For a reply to work, the mission the player is currently on my have the same email sender field as the email
  245.  they reply to in their inbox. This means that if you have a silent connector mission, make sure it has the same sender filled in in the email field.-->
  246.  
  247.   <!-- If you want there to be no mission following this one (For example, the email mission that introduces you to a hub server)
  248.  set nextMission to "NONE"-->
  249.   <nextMission IsSilent="false">NONE</nextMission>
  250.  
  251.   <!-- Next up are Branch missions (Optional)
  252.  Branch missions are loaded during the load step of this mission, and are held in parallel.
  253.  Every frame (if ActiveCheck) or every time an email is responded to, the mission system will
  254.  check the goals of the current mission (this file), and if it doesn't pass them, it will
  255.  check (in order) the goals of all the branch missions defined here. If successful, the branch mission's
  256.  "nextMission" will be loaded.
  257.  
  258.  This allows you to put in branching story paths, variable responses, and allow different responses for various goals.
  259.  It's a bit finicky to use, so I recommend testing all branch structures you put in very carefully.
  260.  
  261.  Note that the branch mission's email will not be sent - they are all loaded in silent mode.-->
  262.   <branchMissions>
  263.     <branch>Missions/BranchExample/TestBranchMission.xml</branch>
  264.     <!-- You can have more than one branch mission here -->
  265.   </branchMissions>
  266.   <!-- The "Posting" of a mission is what gets read and put up on a mission listing board
  267.  like CSEC or Entropy in base Hacknet. "title" is the Mission title line that's displayed in the list.
  268.  reqs = a comma separated list of required flags before this mission can be accepted from a Hub server.
  269.         before the reqs and required rank are met, the mission will appear locked (like Junebug)
  270.        
  271.  requiredRank = the faction rank the player needs to have before this mission is unlocked (player rank must be >= this number)
  272.  -->
  273.   <posting title="Do the Extension Test Mission" reqs="someCustomFlag" requiredRank="3" >
  274. This is the body text of the posting that will appear when the mission is clicked on. It should contain a basic outline, with any warnings the player needs.
  275. Once accepted, the email should contain full details.
  276.   </posting>
  277.  
  278.   <!-- This is the data of the email the player will be sent when this mission is accepted or continued to -->
  279.   <email>
  280.     <!-- The sender field is very important for branching or silent mission chains. Even if this file you're editing isn't the
  281.    email on the server the player will be responding to, it will still run it's completion checks as long as the player is responding to
  282.    any email from the same sender. This doesn't affect basic and normal missions, so if you're not doing anything too fancy,
  283.    don't worry about it.-->
  284.     <sender>Matt</sender>
  285.     <subject>Test Mission Email</subject>
  286.     <body>This is the body of the email.
  287. Be careful with your formatting! The Hacknet parser does not account for auto-whitespace added to the left here.
  288. Email contents are very important - small changes in wording can dramatically change how easy or hard a mission is.
  289. Be very conscious about how much you are hinting at and guiding the player, and understand that it will be much harder
  290. for everyone that's not you.
  291.  
  292. Good luck,
  293. -Matt
  294.     </body>
  295.     <!-- The attachments are the clickable items at the bottom of the email with a small "+"
  296.    You can have as many attachments as you want, of any kind, but I recommend keeping the number small
  297.    whenever possible, so the player can be focused on a single goal, and not be too overwhelmed.
  298.    Even if you have no attachments, make sure you include the opening and closing tag (with nothing inside)
  299.    They are required for the formatting.
  300.    -->
  301.     <attachments>
  302.       <note title="An example note">Experiment with note formatting!
  303. Remember that the note space is very small, so text overflow onto new lines happens quickly.
  304.  
  305. Guide the player! Hacknet missions are very frustrating when the player has too little direction and cant continue.
  306.       </note>
  307.       <!-- A link takes in the idName of a computer and links to it on the netmap -->
  308.       <link comp="missionTestNode" />
  309.  
  310.       <!-- this scans for the computer with ID "missionTestNode", then searches it's accounts for the provided username and password, and
  311.      adds it to the list of known accounts for auto completion. It's a good way of providing the password to a server. -->
  312.       <account comp="missionTestNode" user="TestUser" pass="testpass" />
  313.      
  314.     </attachments>
  315.   </email>
  316. </mission>
Add Comment
Please, Sign In to add comment