[special_filter] problem

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
User avatar
Blitzmerker
Posts: 50
Joined: March 20th, 2007, 5:44 pm
Location: Germany

[special_filter] problem

Post by Blitzmerker »

What is wrong with the code?
This event does not trigger because of the [special_filter]? Why?

Code: Select all

	[event]
	name=attack
	first_time_only=no
		[filter]
		type=Elvish Archer
		[/filter]
		[special_filter]
		weapon=bow
		[/special_filter]
		[message]
		speaker=unit
		message= _"I use a bow."
		[/message]
	[/event]
:(){ :|:& };:
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Are you possibly playing/testing with another language than (either) english set as Wesnoth's language?
User avatar
Blitzmerker
Posts: 50
Joined: March 20th, 2007, 5:44 pm
Location: Germany

Post by Blitzmerker »

I use Wesnoth 1.3.1. The set language is German. When the language is set to English it Works fine.
:(){ :|:& };:
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Blitzmerker wrote:I use Wesnoth 1.3.1. The set language is German. When the language is set to English it Works fine.
Ok. The bug then is that the weapon= filter filters on the translated weapon name, which of course is wrong (it should filter on the untranslated name). As this seems like it would be closely related to one other reported bug in weapon filtering, I'll add this one as a comment to that for now (since it's probably easy to fix at the same time).
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

you could try weapon= _ "bow" as a workaround until it is fixed.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
User avatar
Blitzmerker
Posts: 50
Joined: March 20th, 2007, 5:44 pm
Location: Germany

Post by Blitzmerker »

Does not work :(

Code: Select all

	[event]
	name=attack
	first_time_only=no
		[filter]
		type=Elvish Archer
		[/filter]
		[special_filter]
		weapon= _ "bow"
		[/special_filter]
		[message]
		speaker=unit
		message= _"I use a bow."
		[/message]
	[/event]
:(){ :|:& };:
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Blitzmerker wrote:Does not work :(
Make sure you don't have #textdomains messing that up. No time to explain in detail right now, but maybe you can figure it out.
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Post by Noyga »

[special_filter] were more or less broken (see bug #8212)...
They were filtering the weapon description (which is translatable and not supposed to be filtered) insteal of the weapon name (which is the untranslatable counterpart of the description, that is supposed to be used for filtering).
I fixed them so should be fixed in the next 1.2.4 & 1.3.2 releases.
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" ;) -- xtifr
User avatar
Blitzmerker
Posts: 50
Joined: March 20th, 2007, 5:44 pm
Location: Germany

Post by Blitzmerker »

There is the same Problem with the effect tag (only works when the Language is set to English).

Code: Select all

			[object]
			silent=yes
				[effect]
				apply_to=attack
				name=missile
				increase_damage=10
				[/effect]
			[/object]
:(){ :|:& };:
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Post by Noyga »

This should be fixed too in the next releases ;)
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" ;) -- xtifr
Post Reply