No edit summary
No edit summary
Line 5: Line 5:
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:
To start off, create a folder named '''nightstalker''', and inside of it the following folder and file structure:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">

Revision as of 04:48, 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 a folder named nightstalker, and inside of it the following folder and file structure:

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