Works
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: 23
- Joined: July 26th, 2019, 4:10 pm
Works
I tried Works ability from WML Abilities and it didn't work for me. I put first two pieces of code to my abilities.cfg and the last one to my unit file. I gave Works ability to my faction leader. Did I do something wrong or this code is obsolete and no longer works?
-
- Posts: 23
- Joined: July 26th, 2019, 4:10 pm
Re: Works
I changed:
to:
Maybe this is the problem?
Code: Select all
[filter]
#your filter here... for example type=Peasant
[/filter]
Code: Select all
[filter]
type=my_unit_id
[/filter]
Re: Works
Ability and event are not connected. Event should check units with peasant_works, not by type. Also, dont use [leadership] unless it is intentional to provide immunity to negative leaderships.
-
- Posts: 23
- Joined: July 26th, 2019, 4:10 pm
Re: Works
I did:
It's still not working.
I also used [dummy] instead of [leadership]. Did I do this correct?
Code: Select all
[filter]
ability=peasant_works
[/filter]
I also used [dummy] instead of [leadership]. Did I do this correct?
Re: Works
Yes. Then use the common debug ways, such as checking that inspect includes the event, debug messages, temporarily disabled filters and so on.
-
- Posts: 23
- Joined: July 26th, 2019, 4:10 pm
Re: Works
I put second piece of code (event) into:
I put {WORKS_EVENT} into my scenario code. The ability works now.
The problem is it's giving gold to every player on the map. How can I fix it?
Code: Select all
#define WORKS_EVENT
#enddef
The problem is it's giving gold to every player on the map. How can I fix it?
Re: Works
Specify side to whom you want to give gold.
-
- Posts: 23
- Joined: July 26th, 2019, 4:10 pm
Re: Works
I did:
It works perfectly now. Thanks for help.
Code: Select all
[filter]
side=$side_number
ability=peasant_works
[/filter]