This is for use in custom text, you call that exact text to do this action. The name of the Action is what will be displayed in the Editor when selecting an action, and if the function name is based off the action name, it will be the same as the name without any spaces. This will input the parameter then walah, you action will look nice and pretty when you select it in the trigger editor. You set this by setting the Grammar Text field to whatever text you want without the parameters put in, include a space for each parameter, then go back and select it with the drop down menu on the bottom. Where ( All Players) and Debug are the default parameters, the green field is what they have already set, and any red paramaters are ones that must be set before the trigger containing the action can be activated, you can create these with paramaters that have the option no default value checked just above the default value when they are selected. As an example this should look like this: This is the field at the bottom of the trigger editor when you create a new action.
![exporting triggers in starcraft 2 editor exporting triggers in starcraft 2 editor](https://s2editor-guides.readthedocs.io/Classic_Tutorials/02_Trigger_Module/017-defeat-newactionwindow.jpg)
![exporting triggers in starcraft 2 editor exporting triggers in starcraft 2 editor](https://media.forgecdn.net/attachments/187/236/Tutorial3-1.png)
The next field we will look at is the Grammar Text. There are many types ranging from variable data types to presets (operators like !=, It is similar to a local variable because it is attached only to a specific action. It is a field custom to that specific instance of this action. A parameter is essentially one of the red or green options on actions and functions that you fill in. Returns and parameters: In custom actions you will not use returns, they are only for functions, but parameters are important to make your custom actions as versatile and fluid as possible. *Traceline is only the name of the function being made, it has nothing to do with what is actually in the function.Įach of these does different things but i will explain the most important parts first. You should get a picture that looks like this on the right: When you first create one (via right clicking the left hand box for triggers, highlighting new, and selecting New Action Definition.
![exporting triggers in starcraft 2 editor exporting triggers in starcraft 2 editor](https://i.ytimg.com/vi/_byYid0ultc/maxresdefault.jpg)
These are very usefull because you can make it much faster to do more routine actions or create functions that get complex values with mathematics or even run off variables. In this tutorial we will be going over 2 things, custom actions and functions.