How are advance and post advance events fired in 1.11.1+ ?
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.
How are advance and post advance events fired in 1.11.1+ ?
I was able to learn this in 1.10 and 1.11.0, but in 1.11.1 it was changed and I cannot understand it. The only way for me to work on it is to try and see.
This is how it should behave:
1. A unit kills an opponent, earning enough experience to advance.
2. Last breath and die events are fired.
3. Advance event is fired.
4. The GUI asking what should it advance to appears, and the change chosen is performed.
5. Post advance event is fired.
If it advances via unstore_unit, nothing is fired.
However, on 1.11.1+, I am experiencing strange behaviour, like advancing before the advance event, difference between AMLA advancement and normal advancement in matters of firing events and even unit not stored into $unit, $x1, $y1 in post advance event.
Can somebody tell me how does it actually work?
This is how it should behave:
1. A unit kills an opponent, earning enough experience to advance.
2. Last breath and die events are fired.
3. Advance event is fired.
4. The GUI asking what should it advance to appears, and the change chosen is performed.
5. Post advance event is fired.
If it advances via unstore_unit, nothing is fired.
However, on 1.11.1+, I am experiencing strange behaviour, like advancing before the advance event, difference between AMLA advancement and normal advancement in matters of firing events and even unit not stored into $unit, $x1, $y1 in post advance event.
Can somebody tell me how does it actually work?
Re: How are advance and post advance events fired in 1.11.1+
I think it's never been like that, it was more like:
1. A unit kills an opponent, earning enough experience to advance.
2. Last breath and die events are fired.
3. The GUI asking what should it advance to appears
4. Advance event is fired.
5 and the change chosen is performed, but it is aborted if certain things happend (for exaple changed type) in the advance event.
6. Post advance event is fired.
1. A unit kills an opponent, earning enough experience to advance.
2. Last breath and die events are fired.
3. The GUI asking what should it advance to appears
4. Advance event is fired.
5 and the change chosen is performed, but it is aborted if certain things happend (for exaple changed type) in the advance event.
6. Post advance event is fired.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Re: How are advance and post advance events fired in 1.11.1+
It appears that you might be right, but what would be the point of showing the advancement GUI if the unit might not advance due to the advance event?
Wait... the wiki says that it asks, then the advance event is fired, then the changes are performed and then the post advance event is fired. I wonder what is the point of the separation of advance and post advance events then, except for storing the unit (that can be done without it anyway). Transformations of the unit can be done in post advance as well. If the unit's advancement is stopped in the advance event, the GUI shows up uselessly. Hm...
Wait... the wiki says that it asks, then the advance event is fired, then the changes are performed and then the post advance event is fired. I wonder what is the point of the separation of advance and post advance events then, except for storing the unit (that can be done without it anyway). Transformations of the unit can be done in post advance as well. If the unit's advancement is stopped in the advance event, the GUI shows up uselessly. Hm...
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: How are advance and post advance events fired in 1.11.1+
[unstore_unit] contains a fire_event= key controlling this.
I agree that it should make more sense to show the query after the advance event, so that the advance event can decide whether to show it at all.
The advance event could cancel the advancement, for instance, or change the type the unit advances to.Dugi wrote: I wonder what is the point of the separation of advance and post advance events then, except for storing the unit (that can be done without it anyway).
I agree that it should make more sense to show the query after the advance event, so that the advance event can decide whether to show it at all.
I've seen this happen with sighted events only so far and would be a pretty severe bug. As usual, you should provide a minimized test case...Dugi wrote:and even unit not stored into $unit, $x1, $y1 in post advance event.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: How are advance and post advance events fired in 1.11.1+
Please do it. If you want to do some changes on the unit before it advances, the GUI should reflect them, otherwise it is almost useless.Anonymissimus wrote:I agree that it should make more sense to show the query after the advance event, so that the advance event can decide whether to show it at all.
I placed this into A simple campaign's only scenario. $x1 and $y1 were stored (to my surprise, I had to set these variables myself in my campaign to get things working before), but the message was shown three times (or the number of times it shows is random, I think it appeared twice before).
Code: Select all
[event]
name=post advance
[message]
speaker=narrator
message="$x1 $y1 $unit.name"
[/message]
[/event]
Re: How are advance and post advance events fired in 1.11.1+
i just tested
with a simple scenario.
and it worked as wanted with amla and levelup, with first_time_only and without.
(version 11.2 win7 64bit)
Code: Select all
[event]
name=post advance
[message]
speaker=narrator
message="$x1 $y1 $unit.name"
[/message]
[/event]
and it worked as wanted with amla and levelup, with first_time_only and without.
(version 11.2 win7 64bit)
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.