No edit summary
No edit summary
Line 3: Line 3:


==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 Mech Unit with the movement range of 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''' inside the '''mods''' folder of the game, and inside of it the following folder and file structure:
To start off, create a folder named '''nightstalker''' inside the '''mods''' folder of the game, and inside of it the following folder and file structure:
Line 17: Line 17:
     └── units
     └── units
         └── night_stalker.js
         └── night_stalker.js
</syntaxhighlight>
This file structure is important as the game detects the folders to make changes to the game.
Inside the '''mod.txt''' add the following:
<syntaxhighlight lang="apacheconf">
name=Night Stalkers
description=Custom Mech Units, created for the wiki tutorial.
version=1.0.0
compatible_mods=
incompatible_mods=
required_mods=
cosmetic=false
</syntaxhighlight>
</syntaxhighlight>

Revision as of 05:04, 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 Mech Unit with the movement range of 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 inside the mods folder of the game, 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

This file structure is important as the game detects the folders to make changes to the game.

Inside the mod.txt add the following:

name=Night Stalkers
description=Custom Mech Units, created for the wiki tutorial.
version=1.0.0
compatible_mods=
incompatible_mods=
required_mods=
cosmetic=false