How to make a new ability
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.
-
- Posts: 4
- Joined: December 25th, 2011, 8:31 am
How to make a new ability
Hello,
i want to make a new ability that interacts with a units xp.
I looked at the file abilities.cfg but i figured it is no help. i need to get to where the abilities are actually programmed, as far as i know.
could anyone please tell me where i could find the code or give another suggestion?
any help will be appreciated.
i want to make a new ability that interacts with a units xp.
I looked at the file abilities.cfg but i figured it is no help. i need to get to where the abilities are actually programmed, as far as i know.
could anyone please tell me where i could find the code or give another suggestion?
any help will be appreciated.
-
- Posts: 32
- Joined: January 14th, 2012, 10:40 pm
Re: How to make a new ability
AFAIK, this would have to be done with an
[event]
inside [unit_type]
. You could then just make a dummy ability to display the name in the unit's information.Re: How to make a new ability
Those abilities are defined in scenario, unit, and any other files. So those are exactly what abilities are.nitaybenshahar wrote:I looked at the file abilities.cfg but i figured it is no help.
Anywhere on your CFG file in your campaign folder.nitaybenshahar wrote:i need to get to where the abilities are actually programmed
For example, on the default abilities.cfg, there is:
Code: Select all
#define ABILITY_HEALS
# Canned definition of the heal+4 ability to be included in an [abilities] clause.
[heals]
value=4
id=healing
affect_allies=yes
name= _ "heals +4"
female_name= _ "female^heals +4"
description= _ "Heals +4:
Allows the unit to heal adjacent allied units at the beginning of our turn.
A unit cared for by this healer may heal up to 4 HP per turn, or stop poison from taking effect for that turn.
A poisoned unit cannot be cured of its poison by a healer, and must seek the care of a village or a unit that can cure."
affect_self=no
poison=slowed
[affect_adjacent]
adjacent=n,ne,se,s,sw,nw
[/affect_adjacent]
[/heals]
#enddef
As an example (the case of unit files)
Elvish Shaman:
Spoiler:
Spoiler:
Fate of a Princess/feedback thread: "What is in own heart that is the most important, not who you are."
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
-
- Posts: 4
- Joined: December 25th, 2011, 8:31 am
Re: How to make a new ability
I wanted to create an ability of my own: kind of like healing but instead it is 'teaching' units around (adding to their xp)
thanks for the help
thanks for the help
-
- Posts: 32
- Joined: January 14th, 2012, 10:40 pm
Re: How to make a new ability
[heals]
can only affect units' hit points. Like I said earlier, you'll probably need to script a side turn
event for this, probably with a {FOREACH}
to find each relevant healer and apply the experience bonus to its adjacent allies.If you want this to display in unit descriptions, you'll also need to create a dummy ability in each relevant
[unit_type]
or [unit]
:
Code: Select all
[unit_type]
# Blah, blah, blah.
[abilities]
[custom]
id=teacher
name= _"teacher"
description= _"Teacher: this unit increases its allies' experience points at the beginning of its turn."
[/custom]
[/abilities]
# Etc. etc. ad nauseum
[/unit_type]
ability=teacher
) to find all the "teacher" units on a given side at the beginning of each side turn.I don't have enough time to debug an event right now, so I'll see if I can write something functional for this tomorrow, if you still need help and nobody comes along with a better idea.
-
- Posts: 462
- Joined: June 8th, 2006, 3:25 am
Re: How to make a new ability
An ability that does this, named Battle Tutor, was implemented for the Free Saurian faction in the Era of Strife; you could start by looking to see how they did it.