This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cw4:scripting [2019/12/06 18:20] – Typo fixes bluebolt | cw4:scripting [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Scripting and Making Custom Maps ===== | + | {{page> |
- | Creeper World 4, in the same tradition as Creeper World 3 and Particle Fleet, has extensive scripting capabilities. It uses the same Reverse Polish Notation and associated " | + | ====== Scripting and Making Custom Maps ====== |
+ | Creeper World 4, in the same tradition as Creeper World 3 and Particle Fleet, has extensive scripting capabilities. It uses the same Reverse Polish Notation and associated " | ||
Breaking with tradition, there is now separate sections for the Core or Base language and the Game-specific APIs. The core language components are similar in all games and covers control flow, conditionals and basic math operations. The language-specific APIs interact with the game and game objects to provide extensive customization of custom maps and of custom units. | Breaking with tradition, there is now separate sections for the Core or Base language and the Game-specific APIs. The core language components are similar in all games and covers control flow, conditionals and basic math operations. The language-specific APIs interact with the game and game objects to provide extensive customization of custom maps and of custom units. | ||
===== Workflow ===== | ===== Workflow ===== | ||
- | ==== Overview ==== | ||
There are 3 components to a custom map | There are 3 components to a custom map | ||
* The map terrain | * The map terrain | ||
Line 11: | Line 11: | ||
* Scripts | * Scripts | ||
- | === Map Terrain === | + | ==== Map Terrain |
- | This includes | + | This includes |
- | === Custom units === | + | ==== Custom units ==== |
Pre-built custom units are placed on the map by the map maker and can either be friendly or enemies. Player-built units are included on the build menus and are built by the player during the game. Most units will have one or more scripts associated with them, unless they are purely of a decorative nature. | Pre-built custom units are placed on the map by the map maker and can either be friendly or enemies. Player-built units are included on the build menus and are built by the player during the game. Most units will have one or more scripts associated with them, unless they are purely of a decorative nature. | ||
- | Units are contained in custom packs (CPACKs). Each CPACK is a collection of meshes, textures, color specifications that together make up one or more models. Each model typically has scripted behavior to control its mode of operation. CPACKs can be exported from a map and shared with other map makers who can import the CPACK into a map they made. | + | Units are contained in custom packs (CPACKs). Each CPACK is a collection of meshes, textures, |
Each CPACK has a unique identifier (GUID) that is associated with the CPACK from creation onward. The only way to alter the GUID of a CPACK is to **branch** the CPACK in the game's custom module editor. | Each CPACK has a unique identifier (GUID) that is associated with the CPACK from creation onward. The only way to alter the GUID of a CPACK is to **branch** the CPACK in the game's custom module editor. | ||
- | === Scripts === | + | ==== Scripts |
- | 4RPL scripts control the behavior of units, as well as aspects of the map. As such, they can be associated with a unit, or with the **Global Control** embedded in the CPACK. Global | + | 4RPL scripts control the behavior of units, as well as select |
+ | |||
+ | {{global Control.png? | ||
+ | \\ | ||
+ | During each frame dispatch, there is a discrete component that dispatches all custom scripts. The first part of this will dispatch all the scripts specified as " | ||
+ | |||
+ | Individual order is determined by 1) the order the CPACK is specified | ||
Scripts are compiled into a map, and will execute when the map is played. | Scripts are compiled into a map, and will execute when the map is played. | ||
Line 34: | Line 40: | ||
* If you re-import a CPACK and pass the confirmation dialog | * If you re-import a CPACK and pass the confirmation dialog | ||
:!: Note: You must explicitly save the map if you want the recompiled scripts to be saved.** If you don't, and reload the map, the previous version of the scripts will be in effect until you recompile. | :!: Note: You must explicitly save the map if you want the recompiled scripts to be saved.** If you don't, and reload the map, the previous version of the scripts will be in effect until you recompile. | ||
+ | |||
+ | If you wish to examine the scripts on any map, you can do so by following a very simple set of steps outlined on the [[Examine CW4 Map Resources|Examine Map Resources page.]] | ||
+ | |||
+ | Random link to [[symbol aliasing]]. | ||
+ | |||
+ | ===== Tutorials and How-to ===== | ||
+ | |||
+ | [[cw4: | ||
+ | |||
+ | ===== Karsten' | ||
+ | |||
+ | [[Common Scripting Language]] | ||
+ | {{page> |