No edit summary
No edit summary
Line 4: Line 4:
==Setup==
==Setup==
In this tutorial, you will learn how to create a custom Infantry Unit with  double the movement range of normal Infantry and 6000g cost, with the ability to hide, which we will call 'Night Stalker'. The Night Stalker unit can only be attacked by other [[Infantry Units]] while hidden.
In this tutorial, you will learn how to create a custom Infantry Unit with  double the movement range of normal Infantry and 6000g cost, with the ability to hide, which we will call 'Night Stalker'. The Night Stalker unit can only be attacked by other [[Infantry Units]] while hidden.
To start off, create the following folder structure:
<syntaxhighlight lang="bash">
.
├── mod.txt
└── scripts
    ├── battleanimations
    │   └── BATTLEANIMATION_NIGHT_STALKER.js
    ├── building
    │   └── factory.js
    ├── units
    │   └── night_stalker.js
    └── weapons
</syntaxhighlight>

Revision as of 04:44, 12 September 2023

Notice: Modding tutorials assume you know at least the basics of coding or scripting. Commander Wars uses Javascript as the Scripting Language. In case you want to learn more about Javascript, you can check the tutorial here: Derek Banas' Javascript tutorial , purchase O'Reilly's excellent book on the subject JavaScript: The Definitive Guide, or check out W3 Schools Interactive Tutorials

Setup

In this tutorial, you will learn how to create a custom Infantry Unit with double the movement range of normal Infantry and 6000g cost, with the ability to hide, which we will call 'Night Stalker'. The Night Stalker unit can only be attacked by other Infantry Units while hidden.

To start off, create the following folder structure:

.
├── mod.txt
└── scripts
    ├── battleanimations
    │   └── BATTLEANIMATION_NIGHT_STALKER.js
    ├── building
    │   └── factory.js
    ├── units
    │   └── night_stalker.js
    └── weapons