insert_tag doesn't work inside filter_location ?

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
SlowThinker
Posts: 876
Joined: November 28th, 2008, 6:18 pm

insert_tag doesn't work inside filter_location ?

Post by SlowThinker »

The [and] tag inserted by [insert_tag] is apparently ignored here:
Spoiler:
I had to apply [insert_tag] in the parent tag [set_menu_item]:
Spoiler:
... and it worked

(I had to use 'spoiler' because 'section' doesn't work)
Last edited by SlowThinker on January 27th, 2011, 5:43 pm, edited 2 times in total.
I work on Conquest Minus • I use DFoolWide, Retro Terrain Package and the add-on 'High Contrast Water'
I moved to Nosebane's corner (Doc Paterson's signature); I am spending my time there, so PM me if I don't answer your post in forums
User avatar
bigkahuna
Posts: 657
Joined: September 11th, 2010, 6:24 pm
Location: In your mind.

Re: [insert_tag] doesn't work inside [filter_location] ?

Post by bigkahuna »

SlowThinker wrote:The [and] tag inserted by [insert_tag] is apparently ignored here:
That's because [insert_tag] is an action tag and can only be placed in [event] and special cases such as [message] (on occassion). [filter_location] is NOT an action tag so it can't take [insert_tag]. I'm surprised it worked in [set_menu_item] - I'll have to keep that in mind.
Check out my campaign Sweet Revenge!
Join the new R2D forum!
silene
Posts: 1109
Joined: August 28th, 2004, 10:02 pm

Re: [insert_tag] doesn't work inside [filter_location] ?

Post by silene »

SlowThinker wrote:The [and] tag inserted by [insert_tag] is apparently ignored here:
How do you know it is ignored? What is the content of the "and_tag" container?
bigkahuna wrote:That's because [insert_tag] is an action tag.
No it isn't. It can be used in any place where variable substitution (e.g. $something) would work. In fact, it is just variable substitution for containers instead of values.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: [insert_tag] doesn't work inside [filter_location] ?

Post by zookeeper »

SlowThinker wrote:The [and] tag inserted by [insert_tag] is apparently ignored here:
Spoiler:
I tried it and it works just fine for me.
SlowThinker
Posts: 876
Joined: November 28th, 2008, 6:18 pm

Re: [insert_tag] doesn't work inside [filter_location] ?

Post by SlowThinker »

Thank you for the help and sorry for the dumb question :roll:

My mistake was I cleared add_tag:

Code: Select all

# first and_tag is created 
[set_menu_item]
	id=10_recruit
	description="Recruit Unit"
	[filter_location]
		# and_tag is accessed
	[/filter_location]
	[command] 
	[/command] 
[/set_menu_item]
{CLEAR_VARIABLE add_tag}
I work on Conquest Minus • I use DFoolWide, Retro Terrain Package and the add-on 'High Contrast Water'
I moved to Nosebane's corner (Doc Paterson's signature); I am spending my time there, so PM me if I don't answer your post in forums
User avatar
bigkahuna
Posts: 657
Joined: September 11th, 2010, 6:24 pm
Location: In your mind.

Re: [solved] insert_tag doesn't work inside filter_location

Post by bigkahuna »

silene wrote:It can be used in any place where variable substitution (e.g. $something) would work. In fact, it is just variable substitution for containers instead of values.
Well that's really cool. How do you know where variable substitution works? Is there a list or some criteria that it would have to fulfill?
Check out my campaign Sweet Revenge!
Join the new R2D forum!
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: [solved] insert_tag doesn't work inside filter_location

Post by Sapient »

[insert_tag] may be used everywhere inside [event], with the exception of [set_variables][literal]

(and there may be a few other places where it works)
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: [solved] insert_tag doesn't work inside filter_location

Post by Anonymissimus »

Sapient wrote:(and there may be a few other places where it works)
Does variable substitution work somewhere outside [event]s ?
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: [solved] insert_tag doesn't work inside filter_location

Post by Sapient »

Anonymissimus wrote:
Sapient wrote:(and there may be a few other places where it works)
Does variable substitution work somewhere outside [event]s ?

It works inside subtags of [menu_item], and some [story] parts. In the future hopefully the entire contents of [scenario] will support tag insertion. Unfortunately the relevant code is spread out over a lot of places.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Post Reply