Need help with abilities...
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Need help with abilities...
K, I am sort of a newbie to WML.. I can make units and the like, but I need to know how to make abilities.
well, I can probably learn that, but the main thing I want to know:
Where can I put in the ability? Do i make a cfg named abilities or whatever and save it somewhere? Do I put it in a campaign/scenario/units cfg?
Here's an example of an ability I am trying to make. Don't code it for me, just tell me if it'll be complicated.
The unit is called 'bat'
Swarm
When a bat unit is next to another friendly bat unit, and attacks an enemy, it gains +2 attacks.
Please don't flame me for not reading other threads, I tried, but it's too complicated for me
...
well, I can probably learn that, but the main thing I want to know:
Where can I put in the ability? Do i make a cfg named abilities or whatever and save it somewhere? Do I put it in a campaign/scenario/units cfg?
Here's an example of an ability I am trying to make. Don't code it for me, just tell me if it'll be complicated.
The unit is called 'bat'
Swarm
When a bat unit is next to another friendly bat unit, and attacks an enemy, it gains +2 attacks.
Please don't flame me for not reading other threads, I tried, but it's too complicated for me

- Ken_Oh
- Moderator Emeritus
- Posts: 2178
- Joined: February 6th, 2006, 4:03 am
- Location: Baltimore, Maryland, USA
There are a couple ways to code an ability with WML. First would be to include it within a unit .cfg as an event while another is to include it in a unit .cfg as a macro. In the second way you'll have to have a separate file for abilities that your era of campaign references. If you don't know how to make a macro in WML, you'll need to start there first.
I suggest downloading the Imperial Era from the Add-Ons server and seeing how the Formation ability is done. Look in the Utils folder for the abilities.cfg file. Notice how the Imperial_Era.cfg file in the main Campains folder calls that abilities.cfg file. Then look in the Units folder and see how it is included with the unit.
The Formation ability, IIRC, has similar elements as the ability you're looking to code (but try to come up with a name other than Swarm).
If you wanr more info, look at the Abilities Era thread in this forum.
I suggest downloading the Imperial Era from the Add-Ons server and seeing how the Formation ability is done. Look in the Utils folder for the abilities.cfg file. Notice how the Imperial_Era.cfg file in the main Campains folder calls that abilities.cfg file. Then look in the Units folder and see how it is included with the unit.
The Formation ability, IIRC, has similar elements as the ability you're looking to code (but try to come up with a name other than Swarm).
If you wanr more info, look at the Abilities Era thread in this forum.