Flamesword,1.2,[event]
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.
Flamesword,1.2,[event]
3 questions.
1. How do you get it so that there is something like the flamesword from Heir to the Throne but isn't it into a campaign?
2. Will a campaign made for 1.1.2 work on wesnoth 1.2?
3. In my campaign, there is an event [move_unit_fake] that makes an ai unit move to a spot on the map. Then there is a message, a red flash, and some units appear on the map. So far, so good. But I want the unit that moved onto the spot to still be there, but with some damage done to the unit. How do I do that?
1. How do you get it so that there is something like the flamesword from Heir to the Throne but isn't it into a campaign?
2. Will a campaign made for 1.1.2 work on wesnoth 1.2?
3. In my campaign, there is an event [move_unit_fake] that makes an ai unit move to a spot on the map. Then there is a message, a red flash, and some units appear on the map. So far, so good. But I want the unit that moved onto the spot to still be there, but with some damage done to the unit. How do I do that?
Re: Flamesword,1.2,[event]
Actually, I think that there's a good chance of the campaign itself working (expect to have to make some small changes). But if your campaign includes custom units, then those might need to be changed more.troodon wrote:2. Will a campaign made for 1.1.2 work on wesnoth 1.2?
Re: Flamesword,1.2,[event]
Just take a look at how the event was put together. The WML that creates the flaming sword is right here:troodon wrote:3 questions.
1. How do you get it so that there is something like the flamesword from Heir to the Throne but isn't it into a campaign?
Code: Select all
#define OBJ_SWORD_FIRE X Y ID
{PLACE_IMAGE items/flame-sword.png ({X}) ({Y})}
{VARIABLE sword_taken 0}
[event]
name=moveto
first_time_only=no
[filter]
side=1
x={X}
y={Y}
[/filter]
[if]
[variable]
name=sword_taken
numerical_equals=0
[/variable]
[then]
[message]
speaker=narrator
image="wesnoth-icon.png"
message= _ "Do you want this unit to pick up the sword?"
[option]
message= _ "Yes"
[command]
[object]
id={ID}
name= _ "Flaming Sword"
image=attacks/sword-flaming.png
duration=forever
description= _ "This massive blade was created centuries ago by long-forgotten elvish forgemasters, who managed to imbue the bluish steel with an inner magical fire. Tongues of flame dance on the surface, giving the bluish steel a flawless mirrored finish."
cannot_use_message= _ "Only the leader of an army can wield this sword!"
[filter]
type=Fighter,Commander,Lord,Princess,Battle Princess,Elvish Captain,Elvish Hero,Elvish Marshal,Elvish Champion,Paladin
x,y={X},{Y}
[/filter]
[then]
[removeitem]
x,y={X},{Y}
[/removeitem]
[message]
speaker=narrator
image="wesnoth-icon.png"
message= _ "As you place your hand around the glittering leather hilt, the sword roars to life! Strangely, you feel no heat once you pick it up, yet the grass at your feet bursts into flame as you test the heft of this mighty weapon."
[/message]
{VARIABLE sword_taken 1}
[/then]
[effect]
apply_to=new_attack
name= _ "flaming sword"
icon=attacks/sword-flaming.png
type=fire
range=melee
special=magical
damage=15
number=4
[sound]
time=-200
sound=fire.wav
[/sound]
[/effect]
[/object]
[/command]
[/option]
[option]
message= _ "No"
[/option]
[/message]
[/then]
[/if]
[/event]
#enddef
There are other items you can look up in items.cfg in the game data directory.
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.