Back to Blog
Midnight protocol vault5/6/2023 ![]() Obviously, the new value can in itself be a complex statement. These are valid variable declarations: declare(string, $popupMessage, "Good job!")Īfter declaring the variable, you can assign it a new value with the set command, which takes two comma-separated arguments: 1) the variable name, 2) the new value. Declaring a variable is done with the declare command, which takes three comma-separated arguments: 1) the type, 2) the variable name, 3) an optional starting value. SetConnectionActive($connectionFrom, $connectionTo, $connectionActive)īefore you can reference a variable, it has to be declared to assign it a name and type. Variables can be used in the place of in-line values, but must similarly match the expected type. $hasDownloadedData, $playerScore, $secondLeft, $searchTerm. Variable name always begin with the dollar sign character ( $ ) and must consist of alphanumeric (upper or lower case) characters only, e.g. Pinion supports variables, bits of memory with a meaningful name in which you can store a value and retrieve it for later use. You are unlikely to hit these limits in typical scenarios. For the sake of brevity, such finer details have been omitted. minimum/maximum values, accuracy) for most of these. Note: there are technical limitations (e.g. Always has to be surrounded by "quotation marks". A string of characters, AKA a bit of text. ![]() Can always be styled with an 'f' at the end to distinguish it from an int in the case of round numbers. The point '.' is the only accepted decimal separator. Simply put, a negative or positive number that allows decimal values. a negative or positive integer number.įloating point number. True or false, yes or no, correct or incorrect. Pinion supports four types: Typeīoolean value. Trying to perform an action on the wrong type will create a compilation error and your script will not be able to run. Any bit of data is of a particular type and cannot be interpreted as some other type unless you explicitly convert it first. In Pinion all information you handle is typed. Comments can cover multiple lines too!Ĭomments can also follow an expression, like so: if (GetCredits() > 50) // Let's see if the player has enough money This popup will only show if the player has more than 50 credits. The entire line will be ignored by the script compiler. To make a comment, put two forward slashes ( // ) at the beginning of a line. They are handy to leave notes for yourself or others. ShowPopup("Finally, we'll see this popup, but only if the player has more than 50 credits.")Ĭomments are bits of text in the script that are not part of the actual code. ) is completely ignored.įor the sake of legibility, you might want to indent certain blocks of code (as is common in most programming languages), but this is otherwise syntactically meaningless. Other than line breaks, whitespace (spaces, tabs, empty lines. Ideally, you restrict yourself to one instruction per line, though this is not strictly required. Pinion scripts are executed line-per-line, top to bottom. Once triggered, a script runs to completion instantly before the rest of the game continues, unless you specifically design it to behave otherwise. Triggers when all credits have been drained. Triggers when the vault is opened.įinancial node only. By default, the system node is disabled after this. Triggers when the player selects the third dialog option. Triggers when the player selects the second dialog option. Triggers when the player selects the first dialog option. Triggers when the data node's contents have finished downloading. Triggers each time the player enters this node.ĭata node only. ![]() Useful for setting up some things, adding objectives, or showing some kind of intro. If this event comes to pass, the associated script will be run. Scripting hooksĪll scripts on a network are attached to particular events. Read on for a basic overview of the scripting language, along with an overview of all game functionality you can interact with. If you have so much as a passing familiarity with programming in things like Python, Java, Go, or pretty much anything, it should not present you with much of a challenge. Midnight Protocol makes use of Pinion, a custom scripting language designed to strike a balance between easy-to-read syntax and flexibility. You can also go a step further and give your network unique, custom behaviour by scripting various nodes or the overall mission controller. In Midnight Protocol's user content tools, you can easily create networks that feature the standard gameplay with nodes, connections, ICE and programs, and so forth.
0 Comments
Read More
Leave a Reply. |