GPC Developer Guides

Init Section

The initialization or init section of a GPC is identical to the main section other than it is not run in a loop. The init section is run once before the first iteration of the main section when a script is first loaded and can run any combo or call any function. You can even modify the value of variables within it, just as you would in the main section. The init section is used to set up your script.

For example, say you wished to use the same Rapid Fire script on a PlayStation 4 and Xbox One but your PlayStation 4 game uses the bumper to shoot whereas your Xbox One game uses the trigger, you could use the init section to automatically adjust your script on when it is loaded as shown in the following example;

GPC


The init section is very useful when you are using persistent variables as you do not want to constantly recall the values stored in them during run time. Information on Persistent Variables and how they can be recalled in the init section can be found in the Persistent Memory section