A small bit of WML begs to be used!
Moderator: Forum Moderators
A small bit of WML begs to be used!
I was in the thought of doing my own campaing, but now i noticed that i have lost all of my WML skills, and i`m not too fond of re-learning them. I had only done 3 scenarios so it`s not that much of a loss.
There is jut one thing. I spent hours and hours on a small piece of WML and like to see it getting used somewhere. I made WML for a wishing well, from where heroe(s) could get a one wish for a boosted trait.
This WML worked in wesnoth 9.0.1. If something has changed in WML since that, it might need some tuning.
Anyone can feel free to copy the WML to his own campaign! You just need to alter the X and Y coordinates and replace instances of heroa and herob with your main characters.
First define a variable for each hero (let`s call them heroa and herob) you want to be able to make a wish in a prestart event
Then a *large* moveto event, first have it check if the characters have already wished
Then put this in the same event. You must create samekind bit for each hero and alter the id`s. So in Herob`s bit the object ids could be A_Speed_Hack , A_Power_Hack and so on.
There is jut one thing. I spent hours and hours on a small piece of WML and like to see it getting used somewhere. I made WML for a wishing well, from where heroe(s) could get a one wish for a boosted trait.
This WML worked in wesnoth 9.0.1. If something has changed in WML since that, it might need some tuning.
Anyone can feel free to copy the WML to his own campaign! You just need to alter the X and Y coordinates and replace instances of heroa and herob with your main characters.
First define a variable for each hero (let`s call them heroa and herob) you want to be able to make a wish in a prestart event
Code: Select all
[set_variable]
name=heroawish
value=0
[/set_variable]
[set_variable]
name=herobwish
value=0
[/set_variable]
Code: Select all
[event]
name=moveto
first_time_only=no
[filter]
side=1
x=where you want the well to be
y=where you want the well to be
[/filter]
[if]
[variable]
name=heroawish
numerical_equals=1
[/variable]
[then]
[if]
[have_unit]
description=Heroa
x=wellcoordinate
y=wellcoordinate
[/have_unit]
[then]
[message]
description=HeroA
message=_ "I have already made my wish..."
[/message]
[/then]
[/if]
[/then]
[/if]
[if]
[variable]
name=herobwish
numerical_equals=1
[/variable]
[then]
[if]
[have_unit]
description=Herob
x=wellcoordinate
y=wellcoordinate
[/have_unit]
[then]
[message]
description=HeroB
message=_ "I have already made my wish..."
[/message]
[/then]
[/if]
[/then]
[/if]
Code: Select all
[if]
[variable]
name=heroawish
numerical_equals=0
[/variable]
[then]
[if]
[have_unit]
description=HeroA
x=Wellcoordinate
y=Wellcoordinate
[/have_unit]
[then]
[message]
id=Moun_WISHINGWELL1
speaker=narrator
message= _ "You have come across to a wishing well. What would you like to wish for?"
[option]
id=Moun_WISHINGWELL2a
message= _ "With this golden coin, i wish for speed to catch my enemies."
[command]
[gold]
amount=-1
[/gold]
[object]
x=Wellcoordinate
y=Wellcoordinate
id=G_Speed_Hack
duration=forever
description= "Your wish will be fulfilled.."
[effect]
apply_to=movement
increase=1
[/effect]
[/object]
[set_variable]
name=heroawish
value=1
[/set_variable]
[/command]
[/option]
[option]
id=Moun_WISHINGWELL2b
speaker=unit
message= _ "With this golden coin, I wish for strenght to defeat my enemies."
[command]
[gold]
amount=-1
[/gold]
[object]
x=Wellcoordinate
y=Wellcoordinate
id=G_Power_Hack
duration=forever
description= "Your wish will be fulfilled.."
[effect]
apply_to=attack
range=short
increase_damage=2
[/effect]
[/object]
[set_variable]
name=HeroAwish
value=1
[/set_variable]
[/command]
[/option]
[option]
id=Moun_WISHINGWELL3
speaker=unit
message= _ "With this golden coin, I wish for resilience to withstand blows from my enemies."
[command]
[gold]
amount=-1
[/gold]
[object]
x=Wellcoordinate
y=Wellcoordinate
id=H_Tough_Hack
duration=forever
description= "Your wish will be fulfilled.."
[effect]
apply_to=hitpoints
increase_total=10
heal_full=yes
[/effect]
[/object]
[set_variable]
name=heroawish
value=1
[/set_variable]
[/command]
[/option]
[option]
id=Moun_WISHINGWELL3b
speaker=unit
message= _ "With this golden coin, I wish for intelligence to see my potential."
[command]
[gold]
amount=-1
[/gold]
[object]
x=Wellcoordinate
y=Wellcoordinate
id=H_Intelligence_Hack
duration=forever
description= "Your wish will be fulfilled.."
[effect]
apply_to=max_experience
increase=-25%
[/effect]
[/object]
[set_variable]
name=heroawish
value=1
[/set_variable]
[/command]
[/option]
[/message]
[message]
description=HeroA
message=_ "It worked! Too bad it`s a one shot wonder."
[/message]
[/then]
[/if]
[/then]
[/if]
Read about the adventurers of my pen & paper RPG group
"How could drops of water know themselves to be a river? Yet the river flows on." - Guess who?
"How could drops of water know themselves to be a river? Yet the river flows on." - Guess who?
It`s a small thing, but then you wouldn`t be able to wish again if you choose "i don`t want to make a wish right now".ott wrote:Would it not be simpler to define two wish events with first_time_only=yes, one specific to each hero, instead of keeping track of a variable?
Read about the adventurers of my pen & paper RPG group
"How could drops of water know themselves to be a river? Yet the river flows on." - Guess who?
"How could drops of water know themselves to be a river? Yet the river flows on." - Guess who?
Re: A small bit of WML begs to be used!
Code like this should go here. I added it, and made several changes (it is much shorter now ). If you want to change something, it is a wiki...Burnsaber wrote:I spent hours and hours on a small piece of WML and like to see it getting used somewhere.
Re: A small bit of WML begs to be used!
Thank you very much! I`m no WML wizard, so thanks for shortening it up. I hope someone uses it, otherwise all my #!"&%!¤#`s said during the creating process would have gone to waste. It alwyas annoyed me how your heroes coulnd`t have traits.Dacyn wrote: I added it, and made several changes (it is much shorter now ). If you want to change something, it is a wiki...
Read about the adventurers of my pen & paper RPG group
"How could drops of water know themselves to be a river? Yet the river flows on." - Guess who?
"How could drops of water know themselves to be a river? Yet the river flows on." - Guess who?