EarthCake's problems
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.
EarthCake's problems
Hello!
I have problem:
I made a 'moveto' event:
and I need to prevent this event from happening before ie. turn 14. Otherwise, it ends scenario everytime I stand with "xxxxx" unit on that place. How can I do that?
I have problem:
I made a 'moveto' event:
Code: Select all
[event]
name=moveto
[filter]
id=xxxxx
[filter_location]
x={X}
y={Y}
[/filter_location]
[/filter]
[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 40}
[/endlevel]
[/event]
Last edited by EarthCake on September 9th, 2019, 2:48 pm, edited 2 times in total.
Re: EarthCake's problems
Another problem:
I put two leaders into scenario, and I want that first one I kill doesn't say anything, and second says something like "Argh!".
For now I needed to make one says "Argh", and another one nothing, even if I kill one who says "Argh" first.
How can I do that?
I put two leaders into scenario, and I want that first one I kill doesn't say anything, and second says something like "Argh!".
For now I needed to make one says "Argh", and another one nothing, even if I kill one who says "Argh" first.
How can I do that?
Last edited by EarthCake on June 1st, 2019, 3:25 pm, edited 1 time in total.
Re: EarthCake's problems
[filter_condition] and check current turn number.
You can check if there are other heroes left before showing message.
You can check if there are other heroes left before showing message.
Re: EarthCake's problems
There are many ways to do it. You can add an event during an event, for example a
For the two bosses, I suggest a "last breath" with
name="turn 14"
event could add the moveto.For the two bosses, I suggest a "last breath" with
first_time_only=no
and then count the units:Code: Select all
[event]
name="last breath"
first_time_only=no
[filter]
type="Spearman"
[/filter]
[if]
[have_unit]
type="Spearman"
count=1
[/have_unit]
[then]
[message]
speaker=$unit.id
message= _ "Argh, I was the last of us!"
[/message]
[/then]
[else]
[message]
speaker=$unit.id
message= _ "My friends will avenge me!"
[/message]
[/else]
[/if]
[/event]
Re: EarthCake's problems
Difference between [if] and [filter_condition] comes mainly from whether you want event or action executed multiple times.
Re: EarthCake's problems
Can this work?
Code: Select all
[event]
name=moveto
[filter]
id=xxxxx
[filter_location]
x=6
y=46
[/filter_location]
[/filter]
[filter]
greater_than_equal_to=turn 14
[/filter]
[/event]
Re: EarthCake's problems
Second [filter] will never match any unit.
Re: EarthCake's problems
So I need to put it into one filter tag? Like this maybe:
Code: Select all
[event]
name=moveto
[filter]
id=xxxxx
[filter_location]
x=6
y=46
[/filter_location]
greater_than_equal_to=turn 14
[/filter]
[/event]
Re: EarthCake's problems
Still "greater_than_equal_to=turn 14" results in filter matching no units. greater_than_equal_to is not recognized unit attribute.
You might want [filter_condition][variable]name=turn_number greater_than_equal_to=14 [/variable][/filter_condition]
You might want [filter_condition][variable]name=turn_number greater_than_equal_to=14 [/variable][/filter_condition]
Re: EarthCake's problems
So should it look like this:
I know you are probably annoyed due to my stupidity in WML coding, but I can't help it. (only if this isn't right code)
Code: Select all
[event]
name=moveto
[filter]
id=xxxxx
[filter_location]
x=6
y=46
[/filter_location]
[filter_condition]
[variable]
name=turn_number
greater_than_equal_to=14
[/variable]
[/filter_condition]
[/filter]
[/event]
Re: EarthCake's problems
Almost.
Code: Select all
[event]
name=moveto
[filter]
id=xxxxx
[filter_location]
x=6
y=46
[/filter_location]
[/filter]
[filter_condition]
[variable]
name=turn_number
greater_than_equal_to=14
[/variable]
[/filter_condition]
[/event]
Re: EarthCake's problems
Thanks, it works.
Re: EarthCake's problems
How should I instruct AI? I mean, how I should make player able to access that menu?
Re: EarthCake's problems
Do you mean the "instruct ally" option on the right-click menu of some scenarios, and the "ask Grüü to move here" in SotBE S03? In 1.14 that's done with AI_CONTROLLER, but the actions don't work as players expect, and so it's been removed in 1.15. #3668, #3066.
The Wiki documents how to configure Micro AIs, so the way forward is probably to configure some tailored to your scenario, and then add a right-cilck menu with
The Wiki documents how to configure Micro AIs, so the way forward is probably to configure some tailored to your scenario, and then add a right-cilck menu with
[set_menu_item]
.Re: EarthCake's problems
Is there any way to give player two choices, and if he chooses one, he dies, and if he chooses second one everything is okay?