Tarcils WML Questions
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.
Re: First scenario created
Thank you, this actually worked!
Creator of "In Defense of Kharos" viewtopic.php?t=56628
- beetlenaut
- Developer
- Posts: 2832
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: First scenario created
You seem surprised. Do you understand why? It's because your second map doesn't have any hex at 19,3, so your hero gets removed when you replace the map. However, if you [teleport] him first, his hex doesn't disappear. (You should use
map_file=
in [replace_map]. Using map=
still works, but I think it is not supposed to. It could get removed at any time.)Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: First scenario created
Thank you for the explanation, I understand it now. Sounds logically. ^^beetlenaut wrote: ↑February 6th, 2023, 8:56 amYou seem surprised. Do you understand why? It's because your second map doesn't have any hex at 19,3, so your hero gets removed when you replace the map. However, if you [teleport] him first, his hex doesn't disappear. (You should usemap_file=
in [replace_map]. Usingmap=
still works, but I think it is not supposed to. It could get removed at any time.)
Creator of "In Defense of Kharos" viewtopic.php?t=56628
Re: First scenario created
I want the allied leader to appear only on turn 4 (with his keep). How do I get him spawned only then? I tried to hide and store him, but he still flew around. DO I need to use a Variable and if yes, how?
Creator of "In Defense of Kharos" viewtopic.php?t=56628
Re: First scenario created
Hello!
There is probably many methods to do this but some are dependant on your knowledge of the unit
You can for example hide the unit
If the unit comes from a previous scenario you should store it at the end of the level
The simplest solution is to create him at turn X with
Regardles of what you do you will need A turn X event.
There is probably many methods to do this but some are dependant on your knowledge of the unit
You can for example hide the unit
hide_unit
and then modify his moves and max_moves to 0 with modify_unit
. But this is only good if you know the unit type. Otherwise you won't know how many moves to restore when the unit appears without extra unecessary logic.If the unit comes from a previous scenario you should store it at the end of the level
store_unit
and then unstore_unit
when you need it. This is probably the most elegant solution.The simplest solution is to create him at turn X with
unit
, it doesn't need to be inside the side tag to work because unit has a side subtag you can use, side=3
. If the side has no other leaders you might want no_leader=yes
inside the side tag. There might be reasons for you to have him predefined, but if not: consider this solution.Regardles of what you do you will need A turn X event.
Practice makes perfect, why don't we practice helping others?
Tarcils WML Questions
How do I get a picture being displayed behind the story parts? dont seem to work...
Code: Select all
background
Creator of "In Defense of Kharos" viewtopic.php?t=56628
- beetlenaut
- Developer
- Posts: 2832
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Tarcils WML Questions
It's not
background
that's the problem. Make sure that you put it inside a [part] and that your path and [binary_path] are correct. Those are just guesses. If you show us all the [story] code, we would probably be able to tell you the issue. (If you are using a custom image, you can verify that your code is mostly right by trying a mainline image instead.)Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: Tarcils WML Questions
Code: Select all
[scenario]
[story]
[part]
story= The people of Kharos were a peacful and pious folk who worshipped the sun and the light it gave to them ruled by a theocracy who resides in the main temple of the sun in the mighty city of Kharos.
show_title=yes
title= Darkness arrives
background=~add-ons/To_Lands_Unknown_Resources_2/images/map/map-element-land-kharos.png
[/part]
[part]
story= A time of peace had set in since a few decades after the last remnants of tribal quarries were overcome by the hard, but just fist of the Sun Guardians of Kharos. Since those times, Kharos enjoyed time of peace and tranquility.
show_title=yes
title= Darkness arrives
[/part]
[part]
story= But alas, every time comes to an end and nothing lasts for eternity apart of the sun itself. And so Kharos soon finds itself in a fight for their survival amidst blood and smoke.
show_title=yes
title= Darkness arrives
[/part]
[part]
story= It all began on a sunny day at the eastern border town of Solveig, nestled on the banks of the sunflower river, which marks the border of the kharosian lands. East of the river soon lays a barren wasteland, where only outlaws and monsters dwell.
show_title=yes
title= Darkness arrives
[/part]
[part]
story= _ "Or so the Kharosians believed..."
show_title=yes
title= Darkness arrives
[/part]
[/story]
Creator of "In Defense of Kharos" viewtopic.php?t=56628
- beetlenaut
- Developer
- Posts: 2832
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Tarcils WML Questions
When you use an image file in WML, you need to leave off the path up through the "images" folder because it is being automatically added. Your path should be only be the
map/map-element-land-kharos.png
part. However, since the ~add-ons/To_Lands_Unknown_Resources_2/images/
part is not from the BfW core data, you need to add a [binary_path] for that. The [binary_path] tells the game where to look besides its core images folder.Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: Tarcils WML Questions
beetlenaut wrote: ↑February 24th, 2023, 5:22 pm When you use an image file in WML, you need to leave off the path up through the "images" folder because it is being automatically added. Your path should be only be themap/map-element-land-kharos.png
part. However, since the~add-ons/To_Lands_Unknown_Resources_2/images/
part is not from the BfW core data, you need to add a [binary_path] for that. The [binary_path] tells the game where to look besides its core images folder.
Where do I have to add the [binary_path]? Directly below or anywhere else?
Creator of "In Defense of Kharos" viewtopic.php?t=56628
- beetlenaut
- Developer
- Posts: 2832
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Tarcils WML Questions
Put it in _main.cfg inside the campaign's #ifdef. Look at any mainline campaign to see how it should look.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: Tarcils WML Questions
Thank you, it worked!
Creator of "In Defense of Kharos" viewtopic.php?t=56628
Re: Tarcils WML Questions
I want the player to win after he killed all enemy units, but somehow the player immedieately wins after the start event:
Code: Select all
[event]
name=die
first_time_only=no
[filter]
side=3
[/filter]
[if]
[have_unit]
side=3
[/have_unit]
[then]
[/then]
[else]
[message]
speaker=Soroc
message= _ "They are finally dead!"
[/message]
.............
[sound]
name=ambient/ship.ogg
[/sound]
[move_unit_fake]
type=Galleon
side=2
x=39,50
y=33, 55
[/move_unit_fake]
[message]
speaker= Soroc
message= _ "There he goes to search for a long forgotten tribe. May the sun have mercy upon him in this desert..."
[/message]
[endlevel]
result=victory
bonus=no
{NEW_GOLD_CARRYOVER 40}
carryover_report=yes
[/endlevel]
[/else]
[/if]
[/event]
Creator of "In Defense of Kharos" viewtopic.php?t=56628
Re: Tarcils WML Questions
What you posted is not related to your question.
Re: Tarcils WML Questions
Ok, I thought that this would work and trigger when the last unit of side 3 has died. Should I post the start [event]?
edit: Have found the issue: Had to set victory when enemies defeated to no
Creator of "In Defense of Kharos" viewtopic.php?t=56628