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
Agree.
The easier way is to copy/paste the first objectives into a new event, and then change the lines you want changed.
Yikes. I have two rules regarding
delayed_variable_substitution
. 1) Try not to use it.
2) Try harder.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: First scenario created
You have two [objectives] tags, but you can never get the first because the second one overwrites it immediately.The wiki wrote:The [objectives] tag overwrites any previously set objectives
You could put the two [objectives] tags inside an [if] (rather than the ifs inside the objectives like you have it), or put the [objectives] code down where you have [show_objectives] like Ravana said.
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 all. Handling all those funny codes had clouded the obvious and easy way.
I got it now, but the enemy recruits custom units, instead of the EoMa ones I had assigned to him.
Code: Select all
[side]
side=3
controller=ai
team_name=3
user_team_name= _ "Kharosian deserters"
type=EoMa_Brown_Warrior
id=Veollyc
name= _ "Veollyc"
gender=male
canrecruit=yes
unrenamable=yes
leader=yes
recruit= EoMa_White_Warrior,EoMa_Cavalry_Archer
enemy=1
gold= -100
passive_leader=yes
shroud=no
{INCOME 1 1 1}
[/side]
Creator of "In Defense of Kharos" viewtopic.php?t=56628
Re: First scenario created
I often introduce bugs when tinkering with recruit lists, so I feel your pain. Oftentimes (in my case, at least) the problem with recruit lists arises from a misunderstanding of what the WML actually does and does not do. Celtic_Minstrel made a great post not long ago that helped clarify the WML. I suggest that you read his clarification and then make sure you had used WML correctly.
Also, check to see if you didn't use the wrongCeltic_Minstrel wrote: ↑December 30th, 2022, 3:35 pm Every side has a recruit list. An individual leader also has an optional recruit list. Each leader can recruit anything on either the side recruit list or their personal recruit list.
Modifying a leader'sextra_recruit
has no effect on the side recruit list. Modifying the side recruit list has no effect on any leader'sextra_recruit
list. They are two completely independent lists that are combined to get the final recruit list for a given leader.
id
or side
somewhere in the body of the code, where the events are happening. That's a simple mistake that can throw a wrench into the works.Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
Re: First scenario created
It mysteriously worked after restarting a few times without changing anything... WIth this bug solved, the next and fifth scenario is up!
Creator of "In Defense of Kharos" viewtopic.php?t=56628
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: First scenario created
It sounds like you either forgot to reload the cache or loaded the wrong save--only the start of scenario save will reload the WML. I have also forgotten to save the code in the editor before, which has the same effect. (Sorry if this is all too obvious, but I don't really know your experience level.)
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
I started with WML a week ago, so all of this could very well be possible xDDbeetlenaut wrote: ↑February 1st, 2023, 3:23 pmIt sounds like you either forgot to reload the cache or loaded the wrong save--only the start of scenario save will reload the WML. I have also forgotten to save the code in the editor before, which has the same effect. (Sorry if this is all too obvious, but I don't really know your experience level.)
Creator of "In Defense of Kharos" viewtopic.php?t=56628
Re: First scenario created
Ok. I got the same problem again. I restarted the whole campaign, BfW and the computer and even switched the starting scenarios in the .main.cfg but in the last scenario the ai simply recruits whatever it wants.beetlenaut wrote: ↑February 1st, 2023, 3:23 pmIt sounds like you either forgot to reload the cache or loaded the wrong save--only the start of scenario save will reload the WML. I have also forgotten to save the code in the editor before, which has the same effect. (Sorry if this is all too obvious, but I don't really know your experience level.)
What do I need to do?
Creator of "In Defense of Kharos" viewtopic.php?t=56628
Re: First scenario created
Hello!
Try
Code: Select all
faction=Custom
The reason sometimes it works is probably because since the faction is random sometimes it will select the correct one (or one with similar recruits, making it look like it worked)
Practice makes perfect, why don't we practice helping others?
Re: First scenario created
Thank you, very much!Skayland wrote: ↑February 2nd, 2023, 7:23 pmHello!
Tryinside the side tagCode: Select all
faction=Custom
The reason sometimes it works is probably because since the faction is random sometimes it will select the correct one (or one with similar recruits, making it look like it worked)
Creator of "In Defense of Kharos" viewtopic.php?t=56628
Re: First scenario created
I tried to switch the map with a blackscreen, but my hero don´t reapear after the blackscreen. WHat do I missing there?
Code: Select all
[event]
name=start
##story and dialogues to do
{MOVE_UNIT id=Soroc 19 3}
[message]
speaker=Guard_12
message=Halt! This is the entrance to the holy temple of the sun! What do you want here, soldier?
[/message]
##story and dialogues to do
{FADE_TO_BLACK}
[hide_unit]
[/hide_unit]
[replace_map]
map="{~add-ons/In_Defense_of_Kharos/maps/Kharos_2.map}"
expand=yes
shrink=yes
[/replace_map]
[teleport]
[filter]
id=Soroc
[/filter]
x,y=5,10
animate=no
[/teleport]
[unhide_unit]
id=Soroc
[/unhide_unit]
{FADE_IN}
[remove_shroud]
side=1
[/remove_shroud]
[message]
speaker=Soroc
message= _ "Test for now"
[/message]
##story continues
[/event]
Creator of "In Defense of Kharos" viewtopic.php?t=56628
Re: First scenario created
Hello!
I think your issue is here
try
I might be mistaken though.
Also in your example
you are missing filter id=soroc too. (If he is disappearing maybe you already fixed that though)
I think your issue is here
Code: Select all
[unhide_unit]
id=Soroc
[/unhide_unit]
Code: Select all
[unhide_unit]
[filter]
id=Soroc
[/filter]
[/unhide_unit]
Also in your example
Code: Select all
[hide_unit]
[/hide_unit]
Practice makes perfect, why don't we practice helping others?
Re: First scenario created
Hmm...didn´t work.
Creator of "In Defense of Kharos" viewtopic.php?t=56628
- Celtic_Minstrel
- Developer
- Posts: 2211
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: First scenario created
Actually, an empty
[hide_unit]
would mean "hide all units on the map".Re: First scenario created
Oh I see.Celtic_Minstrel wrote: ↑February 5th, 2023, 8:33 pm Actually, an empty [hide_unit] would mean "hide all units on the map".
Maybe the issue is here thenTarcil wrote: ↑February 5th, 2023, 8:01 pmCode: Select all
[replace_map] map="{~add-ons/In_Defense_of_Kharos/maps/Kharos_2.map}" expand=yes shrink=yes [/replace_map]
From https://wiki.wesnoth.org/DirectActionsW ... ace_map.5D
How big is Kharos_2.map?shrink: if 'yes', allows the map size to decrease. If the map size is reduced, any units that would no longer be on the map due to its coordinates no longer existing will be put into the recall list.
Try [teleport] before [replace_map] ??
Practice makes perfect, why don't we practice helping others?