no paragraphs in note (Solved)
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.
no paragraphs in note (Solved)
First problem solved, see a post below for curred...
I used the Shop-macro from the UsefulWMLFragments and modified it a bit. I made an option sub macro which adds a
image.But after you leave the shop there is an empty message as in the attachment. The message is centered. when I click the message disappears(as every message in game) and the $exit_message is shown. here is the Shop Code:How can I remove this empty message? [/size]
I used the Shop-macro from the UsefulWMLFragments and modified it a bit. I made an option sub macro which adds a
image.
Code: Select all
#define ARENA_OPTION_IMG_TXT TXT TXT_EXIT GOLD IMG OBJECT
[option]
message=_ {MENU_IMG_TXT {IMG} {TXT}}
[command]
[if]
[variable]
name=gold
greater_than={GOLD}
[/variable]
[then]
[gold]
amount=-{GOLD}
side=$side_number
[/gold]
[object]
{OBJECT}
[/object]
[set_variable]
name=exit_message
value={TXT_EXIT}
[/set_variable]
[/then]
[/if]
[/command]
[/option]
#enddef
Code: Select all
#define SHOP FILTER
[event]
name=moveto
first_time_only=no
[filter]
{FILTER}
[/filter]
[store_gold]
side=$side_number
variable=gold
[/store_gold]
[message]
speaker=narrator
message=_ "What items would you like to purchase?"
image=wesnoth-icon.png
{ARENA_OPTION_IMG_TXT "140 GP: Sharpen Melee Weapon, damage:+2" "Your weapon is now sharpen." 140 attacks/glaive.png(
[effect]
apply_to=attack
range=melee
increase_damage=2
[/effect]
)}
{ARENA_OPTION_IMG_TXT "150 GP: Enchance Ranged Weapon, damage +2" "Your weapon is now enchanced." 150 attacks/bow.png(
[effect]
apply_to=attack
range=ranged
increase_damage=2
[/effect]
)}
{ARENA_OPTION_IMG_TXT "150 GP: Crystal Orb, damage +2 on magical attack" "Your magical weapons are now Stronger." 150 attacks/magic-missile.png(
[effect]
apply_to=attack
special=magical
increase_damage=2
[/effect]
)}
[/message] # !!! Here the empty message appears :(
[message]
speaker=narrator
message=$exit_message
side_for=$side_number
[/message]
[/event]
#enddef
- Attachments
-
- the empty message
- empty.jpg (8.3 KiB) Viewed 2972 times
Last edited by Lizard on March 29th, 2008, 3:28 pm, edited 8 times in total.
~ I'll heal you by 4 hp if you post next to me ~
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
- Aethaeryn
- Translator
- Posts: 1554
- Joined: September 15th, 2007, 10:21 pm
- Location: Baltimore, Maryland, USA
Re: empty message after shop
Did you try removing all of this?
Code: Select all
[message]
speaker=narrator
message=$exit_message
side_for=$side_number
[/message]
Aethaeryn (User Page)
Wiki Moderator (wiki)
Latin Translator [wiki=Latin Translation](wiki)[/wiki]
Maintainer of Thunderstone Era (wiki) and Aethaeryn's Maps [wiki=Aethaeryn's Maps](wiki)[/wiki]
Wiki Moderator (wiki)
Latin Translator [wiki=Latin Translation](wiki)[/wiki]
Maintainer of Thunderstone Era (wiki) and Aethaeryn's Maps [wiki=Aethaeryn's Maps](wiki)[/wiki]
Re: empty message after shop
No, but I added it as a try to remove the empty message...Aethaeryn wrote:Did you try removing all of this?
Code: Select all
[message] speaker=narrator message=$exit_message side_for=$side_number [/message]
~ I'll heal you by 4 hp if you post next to me ~
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Re: empty message after shop
silent=yes in your [object] tags.
Need further help, search for "silent" in this page: http://www.wesnoth.org/wiki/DirectActionsWML
Need further help, search for "silent" in this page: http://www.wesnoth.org/wiki/DirectActionsWML
Re: empty message after shop
It works, thanks Blueblaze.
~ I'll heal you by 4 hp if you post next to me ~
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Re: empty message after shop (Solved)
I want to sell a Goblin, but that did not work.shop takes money, but no goblin is made.This is the macro call. I changed it a bit from the last version, but the other items work. Here is the macro definition:[/size]
The Arena Option Macroand the Shop makro now don't use a filter but 2 coordinates:What is the problem? How can I correct it?[/size]
Code: Select all
{ARENA_OPTION_IMG_TXT "10 GP: Goblin Spearman" "Get a sidekick" "I'll fight on your side!" 10 attacks/spear-orcish.png (
[set_variable]
name=gob_x_pos
value={FILTER_X}
[/set_variable]
{VARIABLE_OP gob_x_pos add -1}
[unit]
x=$gob_x_pos
y={Filter_Y}
type=Goblin Spearman
description=Gobi
user_description= _ "Gobi"
side=1
[/unit]
)}
The Arena Option Macro
Code: Select all
#define ARENA_OPTION_IMG_TXT TXT TXT_2 TXT_EXIT GOLD IMG EFFECT
[option]
message=_ "&"+{IMG}+"=~"+{TXT}+"
`"+{TXT_2} # " # comment for correct syntax highlighting.
[command]
[if]
[variable]
name=gold
greater_than={GOLD}
[/variable]
[or]
[variable]
name=gold
equals={GOLD}
[/variable]
[/or]
[then]
[gold]
amount=-{GOLD}
side=$side_number
[/gold]
{EFFECT}
[set_variable]
name=exit_message
value={TXT_EXIT}
[/set_variable]
[set_variable]
name=exit_image
value={IMG}
[/set_variable]
[/then]
[/if]
[/command]
[/option]
#enddef
Code: Select all
#define SHOP FILTER_X FILTER_Y
.
.
.
Last edited by Lizard on March 24th, 2008, 12:50 pm, edited 1 time in total.
~ I'll heal you by 4 hp if you post next to me ~
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Re: Shop don't create Goblin
case-sensitivity: {FILTER_Y} is different from {Filter_Y}
Don't let windows teach you the wrong way, case *does* matter, in code, in filenames, in everything.
Don't let windows teach you the wrong way, case *does* matter, in code, in filenames, in everything.
Re: Shop don't create Goblin
Thanks AI it works
we definitely need a "bangs head violently against keyboard" smiley. How could this happen?
we definitely need a "bangs head violently against keyboard" smiley. How could this happen?
Delphi teaches me...AI wrote:Don't let windows teach you the wrong way, case *does* matter, in code, in filenames, in everything.
~ I'll heal you by 4 hp if you post next to me ~
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Re: Shop don't create Goblin (Solved)
Here is the next problem I summoned:
you can buy 2 attacks, but only on of them has the given Image. While the Club is correct, the crossbow isn't. What is wrong this time [/size]
you can buy 2 attacks, but only on of them has the given Image. While the Club is correct, the crossbow isn't.
Code: Select all
{ARENA_OPTION_IMG_TXT "25 GP: Buy Crossbow" "gain a 5-3 ranged pierce attack" "feel free to test it out" 25 attacks/crossbow-human.png (
[object]
silent=yes
[effect]
apply_to=new_attack
name=Crossbow
image=attacks/crossbow-human.png
type=pierce
range=ranged
damage=5
number=3
[/effect]
[/object]
)}
{ARENA_OPTION_IMG_TXT "25 GP: Buy Club" "gain a 7-2 melee impact attack" "feel free to test it out" 25 attacks/club-small.png (
[object]
silent=yes
[effect]
apply_to=new_attack
name=Club
image=attacks/club-small.png
type=impact
range=melee
damage=7
number=2
[/effect]
[/object]
)}
Last edited by Lizard on March 29th, 2008, 3:05 pm, edited 1 time in total.
~ I'll heal you by 4 hp if you post next to me ~
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Re: Shop don't create Goblin (Solved)
The fact that you invented an image= key which actually does nothing.Lizard wrote:What is wrong this time
Re: missing new_attack image
the correct key is named 'icon'
The club works because the default icon is "attacks/$name|.png", though it probably shows the wrong club. (and only on windows, due to the capitalized 'C')
The club works because the default icon is "attacks/$name|.png", though it probably shows the wrong club. (and only on windows, due to the capitalized 'C')
Re: missing new_attack image (Solved)
Thanks, it works
Next error will come, it won't take long.
Next error will come, it won't take long.
~ I'll heal you by 4 hp if you post next to me ~
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Re: missing new_attack image (Solved)
Problem No. 4:
the empty lines in my note don't appear, there are newlines, but no lines between. I want the to look like several <p>s, but they actually look like <br />s
This is how it looks like:
You can only recruit in the first Turn
The Villages don't give money, you can
take them to reduce upkeep and for healing.
You can only get money for killing units.
If your leader dies, you get a new one.
there are several shops on the Map, each
shop offers the same services for the same prices.
Version 0.-1.1, more things will be added.
the empty lines in my note don't appear, there are newlines, but no lines between. I want the to look like several <p>s, but they actually look like <br />s
Code: Select all
[objectives]
side=1
[objective]
description= _ "Your team kills all enemy units"
condition=win
[/objective]
[objective]
description= _ "The other team kills all of your units"
condition=lose
[/objective]
note= _ "
You can only recruit in the first Turn
The Villages don't give money, you can
take them to reduce upkeep and for healing.
You can only get money for killing units.
If your leader dies, you get a new one.
there are several shops on the Map, each
shop offers the same services for the same prices.
Version 0.-1.1, more things will be added."
[/objectives]
You can only recruit in the first Turn
The Villages don't give money, you can
take them to reduce upkeep and for healing.
You can only get money for killing units.
If your leader dies, you get a new one.
there are several shops on the Map, each
shop offers the same services for the same prices.
Version 0.-1.1, more things will be added.
~ I'll heal you by 4 hp if you post next to me ~
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Re: no paragraphs in note
IIRC the trick is to put some spaces on the 'empty' lines.
/tsr
/tsr
Re: no paragraphs in note
Thanks, it works.
~ I'll heal you by 4 hp if you post next to me ~
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa