So before, we were establishing the appropriate needed variables. Var bossCameraVal = (bossCamera).getValue() Var shotgunMagVal = (shotgunMag).getValue() Now that we've established our starter variables and switches, now we need to convert the data to be readable in JS. Appropriate value to be referenced - This is contextual based on the Function Name/Parameter combo in use.The API document for PGM displays all appropriate command usagesīuilding a Basic Script: Part 2 - Make the data readable.The API document for PGM displays all appropriate commands. Function Name & appropriate parameter - This is the name of the function you want to use along with the appropriate parameter.
All runtime commands will need to reference a specific object instance to execute/perform the desired command. Everything else will start with the appropriate object instance variable you create in the beginning of your script (Ex. Globally called parameters will start with "Agtk".
JS is case sensitive, so best practice is to name the variable in a way that makes it easy to code and remember its purpose. "var" Name - This is the name of the variable we'd track.This is similar to how variables work in game.
This is where your project data is stored and can help you figure out how to formulate your commands for specific runtime actions. If you have no Javascript (JS) knowledge or struggle with finding the correct syntax and functions to do what you need to do, look no further than W3Schools and their database on JS. It is recommended to grab this program to allow you to write scripts more efficiently. You'll need this document to reference commands. When building scripts, the following programs and assets are highly recommend to assist in creating scripts. If you're new to PGM, please come back to this later after you've mostly understood the engine. This guide is aimed at users familiar with PGM's interface and logic systems. However, the guide is written with the laymen in mind with appropriate resources to help bridge the gap. This guide will not be an exhaustive tutorial on how to program using JavaScript (JS) or CoffeeScript (CS). This guide is intended to be a starting point and will not be exhaustive of all of the facets of the provided API for PGM. This can help simplify your objects runtime commands and even make them more efficient than building loops of logic using the visual programming PGM provides. Scripting in Pixel Game Maker MV (PGM) can allow one to create custom logic and handling using the built in runtime action commands.
5 Building a Basic Script: Part 2 - Make the data readable.4 Building a Basic Script: Part 1 - Defining the Variables.3 Formatting and Limitations for Scripting.