Menu_Item through a campaign

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
Geos
Posts: 115
Joined: March 20th, 2008, 1:58 pm
Location: Italy

Menu_Item through a campaign

Post by Geos »

I have a menu item defined in scenario 2 that is supposed to show a map when the user clicks. Then, at the end of the scenario, as I found no tag to delete it I just changed showing a message to inform the user that no map was available.
In latter scenarios, no message would show up.
Arriving to another scenario, the 7th, I wanted to show the user a new map so

Code: Select all

[set_menu_item]
	    id=showmap
	    description= _ "Show Map"
	    [command]
		[message]
                     speaker=narrator
                     image="Maps/TheThan.png"
                [/message]
	    [/command]
	 [/set_menu_item]
in the prestart event. But doesn't work. I take a look at the save file and I find

Code: Select all

[menu_item]
	id="showmap"
	description="Show Map"
	needs_select="no"
	[command]
		[message]
#textdomain 
			message=_ "No map available"
			speaker="narrator"
		[/message]
	[/command]
[/menu_item]
This is located at top level. This would follow the instructions given at the end of the scenario 2. I find also this

Code: Select all

[menu_item]
		description=_ "Show Map"
		id="showmap"
		needs_select="no"
		[command]
			[message]
				image="Maps/TheThan.png"
				speaker="narrator"
			[/message]
		[/command]
	[/menu_item]
twice in the scenario tags.

What is going on? What do I have to make a correct substitution of a Menu Item?

thank you

PD: Something that maybe a bug. When displaying messages, for the whole campaign it worked fine with

Code: Select all

[message]
  description=theunit
  message= _ "blabla"
[/message]
But in my last scenario would show another unit's portrait and name. I changed from "description" to "speaker" and it worked. ??
That's ridiculous, dragons have no windows...
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: Menu_Item through a campaign

Post by Sapient »

hmm.. that's not supposed to be possible to have two menu_item's with the same ID. try zip up your campaign and post it into a bug report.


by the way, to make it invisible, all you have to do is set the [show_if] to always be false...

Code: Select all

 [show_if]
  [not]
# never show
  [/not]
 [/show_if]
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
Geos
Posts: 115
Joined: March 20th, 2008, 1:58 pm
Location: Italy

Re: Menu_Item through a campaign

Post by Geos »

My campaign is too big.
I attach the two scenarios and the latest save file
Attachments
LTD_Prodo's_keep-Auto-Save1.gz
(53.76 KiB) Downloaded 195 times
07_TheTan.cfg
(12.27 KiB) Downloaded 185 times
02_the_swamps.cfg
(10.5 KiB) Downloaded 186 times
That's ridiculous, dragons have no windows...
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Menu_Item through a campaign

Post by zookeeper »

If your campaign is too big for .zipping then obviously you can remove the big parts which are big images and music.
User avatar
Geos
Posts: 115
Joined: March 20th, 2008, 1:58 pm
Location: Italy

Re: Menu_Item through a campaign

Post by Geos »

Well, I guess this makes a difference.
Attachments
Love_To_Death.zip
(1.81 MiB) Downloaded 183 times
That's ridiculous, dragons have no windows...
Post Reply