Help with WML for a particular scenario
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: Help with WML for a particular scenario
I tested the code, and it works fine.
Please check the id of your leader.
Please check the id of your leader.
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
Re: Help with WML for a particular scenario
Yeah, I was wrong with the code. It is working fine now. Thanks!Adamant14 wrote:I tested the code, and it works fine.
Please check the id of your leader.
Current projects:
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Re: Help with WML for a particular scenario
Can anyone please address a small query?
If I want to keep a certain ai controlled side idle I can use the following code:
But if I want to activate the side at a certain time what will be the code needed?
Thanks in advance.
If I want to keep a certain ai controlled side idle I can use the following code:
Code: Select all
[ai]
ai_algorithm=idle_ai
[/ai]
Thanks in advance.
Current projects:
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Re: Help with WML for a particular scenario
Maybe you can do it this way:
Code: Select all
# you can use this event to make the side do nothing ...
[event]
name= # add the event-name you want here
[modify_side]
side= # add the side you want here
controller=null
[/modify_side]
[/event]
# ... and this event to activate the side again
[event]
name= # add the event-name you want here
[modify_side]
side= # add the side you want here
controller=ai
[/modify_side]
[/event]
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
Re: Help with WML for a particular scenario
Thanks a lot!
Current projects:
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Re: Help with WML for a particular scenario
I need help with a matter.
I want to give an ability named invisibility to certain units in two consequetive scenarios. I have created the ability using the following code:
If I want to give the ability to a certain unit can I use the following code:
Are the above codes appropriate?
Now what is the code that I have to use in order to remove the ability?
Thanks in advance.
I want to give an ability named invisibility to certain units in two consequetive scenarios. I have created the ability using the following code:
Code: Select all
#define ABILITY_INVISIBLE
# Canned definition of the Invisibility ability to be included in an
# [abilities] clause.
[hides]
id=invisible
name= _ "invisible"
female_name= _ "invisible"
description= _ "invisible:
Enemy units cannot see this unit, except in case they stand immediately beside it. Defense
is at 80 percent for every terrain except water, where it is 70 percent."
description_inactive= _ "invisible:
Enemy units cannot see this unit, except in case they stand immediately beside it. Defense
is at 80 percent for every terrain except water, where it is 70 percent."
name_inactive= _ "invisible"
female_name_inactive= _ "female^invisible"
affect_self=yes
[/hides]
[effect]
apply_to=defense
replace=true
[defense]
deep_water=30
shallow_water=30
reef=30
swamp_water=30
flat=20
sand=20
forest=20
hills=20
mountains=20
village=20
castle=20
cave=20
frozen=20
unwalkable=20
impassable=20
fungus=20
[/defense]
[/effect]
#enddef
Code: Select all
[modify_unit]
id=$unit.id
{ABILITY_INVISIBILITY}
[/modify_unit]
Now what is the code that I have to use in order to remove the ability?
Thanks in advance.
Current projects:
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Re: Help with WML for a particular scenario
Well, according to your own comment:chak_abhi wrote:Are the above codes appropriate?
Yet you did not use it in an [abilities] clause, so I am guessing it will not work.chak_abhi wrote: # Canned definition of the Invisibility ability to be included in an
# [abilities] clause.
Then again, it probably would not work even in an [abilities] clause because you would then be defining your [effect] inside [abilities], which does not work.
What it seems like you want is an [object] with two [effect]s -- the first with
apply_to=new_ability
to give the unit the "invisible" ability (minus the [effect] you had in that), and the second with apply_to=defense
. A duration
of "level" will make it last until the end of the current scenario. To get it to appear to continue in the next scenario, track the units in a variable and re-apply the object when the next scenario starts.Re: Help with WML for a particular scenario
I am facing another problem.
In a scenario I want a certain unit to have the ability of crushing petrified units which are located in adjacent hexes. The player has to use an option from the menu to utilise this. I use the following code.
I place the code in the concerned scenario.
But the option doesn't show up on the menu while playing. What is the error responsible for this?
Thanks in advance.
In a scenario I want a certain unit to have the ability of crushing petrified units which are located in adjacent hexes. The player has to use an option from the menu to utilise this. I use the following code.
Code: Select all
#define MENU_CRUSH_PETRIFIED_UNIT
[set_menu_item]
id=crush_petrified_unit_option
description= _ "Crush petrified unit"
[show_if]
[have_unit]
[filter_wml]
[status]
petrified=yes
[/status]
x,y=$x1,$y1
[/filter_wml]
[/have_unit]
[/show_if]
[filter_location]
[filter_adjacent_location]
[filter]
type=Dwarvish Witness, Dwarvish Annalist, Dwarvish Loremaster
[/filter]
[/filter_adjacent_location]
[/filter_location]
[command]
[kill]
x,y=$x1,$y1
animate=yes
fire_event=yes
[/kill]
[/command]
[/set_menu_item]
#enddef
Code: Select all
[event]
name=prestart
{MENU_CRUSH_PETRIFIED_UNIT}
[/event]
Thanks in advance.
Current projects:
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
- pyrophorus
- Posts: 533
- Joined: December 1st, 2010, 12:54 pm
Re: Help with WML for a particular scenario
There are several errors, try to replace your conditions by:
and delete the whole 'filter_locations' which is useless. It should work better.
Friendly,
Code: Select all
[show_if]
[have_unit]
x,y=$x1,$y1
[filter_wml]
[status]
petrified=yes
[/status]
[/filter_wml]
[filter_adjacent]
type=Dwarvish Witness, Dwarvish Annalist, Dwarvish Loremaster
[/filter_adjacent]
[/have_unit]
[/show_if]
Friendly,
HowTos: WML filtering, WML variables
Re: Help with WML for a particular scenario
Thanks once again, pyrophorus!
Current projects:
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Re: Help with WML for a particular scenario
There is another point where I notice a problem. If at the start of a scenario I set the controller for a particular side as "controller=null" then the side leader doesn't show up at all during game play. I want to use it because I need to change the controller to ai once a particular event occurs. Am I facing a bug? I use Bfw 1.11.0.
Current projects:
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Re: Help with WML for a particular scenario
Correct.chak_abhi wrote:If at the start of a scenario I set the controller for a particular side as "controller=null" then the side leader doesn't show up at all during game play.
I believe one work-around is to initially define the controller as "ai", then change it to "null" in a start or prestart event.SideWML wrote:null: the side doesn't get a turn to move and doesn't have a leader generated from the contents of the [side] tag.
Or you could take the more involved approach I've tried of defining an AI with no candidate actions for the side until such time as the side is supposed to act. (But I did that because I wanted to suppress some candidate actions anyway. Probably not such a good idea in general.)
Re: Help with WML for a particular scenario
Thanks, I will try these.
Current projects:
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Re: Help with WML for a particular scenario
I am facing a problem again for which I need help.
I have created a scenario from where the player can proceed to 3 different scenarios. After completing 2 of them he/she has to return to this scenario both times, which means that this scenario should be played thrice.
There are 8 enemy sides. I want to ensure that if the player manages to kill any of the leaders he/she would be relieved of facing that side when he/she faces the scenario for the next time. So I use the following code (it has been used separately for sides 2-9):
And in the prestart event I place the code (also used separately for sides 2-9):
But I face a problem if I load the scenario for the very first time. The side leaders for sides 2 & 3 do not show up at all. I am clueless about working a solution.
Can anyone please help? Thanks in advance.
I have created a scenario from where the player can proceed to 3 different scenarios. After completing 2 of them he/she has to return to this scenario both times, which means that this scenario should be played thrice.
There are 8 enemy sides. I want to ensure that if the player manages to kill any of the leaders he/she would be relieved of facing that side when he/she faces the scenario for the next time. So I use the following code (it has been used separately for sides 2-9):
Code: Select all
[event]
name=die
[filter]
side=2
canrecruit=yes
[/filter]
{VARIABLE no_side2 1}
[/event]
Code: Select all
[if]
[variable]
name=no_side2
numerical_equals=1
[/variable]
[then]
[kill]
side=2
[/kill]
[/then]
[/if]
Can anyone please help? Thanks in advance.
Current projects:
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty
Rebellion in the North,Legend of Far North,Birth of a Lich,
Doreldos: Fight to Liberty