An ability in the macros that doesn't seem to be recognized.

The place to post your WML questions and answers.

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.
Post Reply
Fosprey
Posts: 254
Joined: January 25th, 2008, 8:13 am

An ability in the macros that doesn't seem to be recognized.

Post by Fosprey »

I have in my userdata\data\campaigns the file Competitive_Era.cfg that look like this

[binary_path]
path=data/campaigns/Competitive_Era
[/binary_path]


{@campaigns/Competitive_Era/}
[+units]
{@campaigns/Competitive_Era/units/Empire}
[/units]
userdata\data\campaigns

i have macros.cfg that looks like this

[chance_to_hit]
id=spell
name= _ "Spell"
description= _ "Spell:
This attack does 100% damage on all terrains"
value=100
cumulative=no
[/chance_to_hit]
My unit, that works perfect beside this, have the following attack tag
[attack]
name=lightstrike
description=_"lightstrike"
type=arcane
range=ranged
[specials]
{WEAPON_SPECIAL_SPELL}
[/specials]
damage=20
number=1
[/attack]
But when i have the unit in the map, the unit have no special at all in it's attack.
Anything i can be missing?
AI
Developer
Posts: 2394
Joined: January 31st, 2008, 8:38 pm

Re: An ability in the macros that doesn't seem to be recognized.

Post by AI »

move macros.cfg from userdata/data/campaigns to userdata/data/campaigns/Competitive_Era

Also, macros.cfg should look like this:

Code: Select all

#define WEAPON_SPECIAL_SPELL
[chance_to_hit]
id=spell
name= _ "Spell"
description= _ "Spell:
This attack does 100% damage on all terrains"
value=100
cumulative=no
[/chance_to_hit]
#enddef
Fosprey
Posts: 254
Joined: January 25th, 2008, 8:13 am

Re: An ability in the macros that doesn't seem to be recognized.

Post by Fosprey »

Thanks for the help, but I moved the file and changed the macros file, nothing.
If i set the special to (WEAPON_SPECIAL_MAGICAL) it works no problem, but when i change it to (WEAPON_SPECIAL_SPELL) it just doesn't show anything.
and nothing special happen when the unit attack.

What i don't get is that i looked at other eras and they do exactly this, and it works for them, i'm really lost.
If i replyace the (Weapon_special_spell) with the whole macro written in the unit.cfg it works wonder.
It's clear that for some reason it doesn't look into the macros.cfg file, but don't know why.
megane
Art Contributor
Posts: 410
Joined: October 30th, 2006, 4:55 am
Location: The Big Ö (a.k.a. Austria)

Re: An ability in the macros that doesn't seem to be recognized.

Post by megane »

Fosprey wrote:[+units]
{@campaigns/Competitive_Era/units/Empire}
[/units]
>

Code: Select all

[+units]
{@campaigns/Competitive_Era/macros.cfg}
{@campaigns/Competitive_Era/units/Empire}
[/units]
You have to make sure the macros get loaded first (and in this case, you didn't have them loading at all).
that little girl's parents were attacked by ninjas - generic npc
hee hee! - little girl
Post Reply