Works

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
Andrzej127
Posts: 23
Joined: July 26th, 2019, 4:10 pm

Works

Post by Andrzej127 »

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?
Andrzej127
Posts: 23
Joined: July 26th, 2019, 4:10 pm

Re: Works

Post by Andrzej127 »

I changed:

Code: Select all

[filter]
	#your filter here... for example type=Peasant
[/filter]
to:

Code: Select all

[filter]
	type=my_unit_id
[/filter]
Maybe this is the problem?
User avatar
Ravana
Forum Moderator
Posts: 3000
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Works

Post by Ravana »

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.
Andrzej127
Posts: 23
Joined: July 26th, 2019, 4:10 pm

Re: Works

Post by Andrzej127 »

I did:

Code: Select all

[filter]
	ability=peasant_works
[/filter]
It's still not working.

I also used [dummy] instead of [leadership]. Did I do this correct?
User avatar
Ravana
Forum Moderator
Posts: 3000
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Works

Post by Ravana »

Yes. Then use the common debug ways, such as checking that inspect includes the event, debug messages, temporarily disabled filters and so on.
Andrzej127
Posts: 23
Joined: July 26th, 2019, 4:10 pm

Re: Works

Post by Andrzej127 »

I put second piece of code (event) into:

Code: Select all

#define WORKS_EVENT
#enddef
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?
User avatar
Ravana
Forum Moderator
Posts: 3000
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Works

Post by Ravana »

Specify side to whom you want to give gold.
Andrzej127
Posts: 23
Joined: July 26th, 2019, 4:10 pm

Re: Works

Post by Andrzej127 »

I did:

Code: Select all

[filter]
	side=$side_number
	ability=peasant_works
[/filter]
It works perfectly now. Thanks for help.
Post Reply