scenario_end event
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.
scenario_end event
Hi,
I'm looking at Sceptre_of_Fire: 1_A_Bargain_is_Struck.cfg and there is an event called scenario_end.
I was unable to find any documentation about it in the wiki (EventWML,ScenarioWML).
Could you please add if this is a synced event or not on the EventWML page. I'm guessing it's not.
I'm looking at Sceptre_of_Fire: 1_A_Bargain_is_Struck.cfg and there is an event called scenario_end.
I was unable to find any documentation about it in the wiki (EventWML,ScenarioWML).
Could you please add if this is a synced event or not on the EventWML page. I'm guessing it's not.
Re: scenario_end event
Thanks for pointing that out, the wiki is also missing
local_victory
and local_defeat
.scenario_end
fires immediately after victory
or defeat
, and its synchronisation is the same. However, EventWML#Multiplayer_safety suggests that, since 1.13.10, all of those events are synced and the documentation on that page for victory
and defeat
is wrong.Re: scenario_end event
Yes it is synced afterall. One of the issues that I've been having is not knowing where is the best place to remove_object and remove_unit_overlay from units.
I recently had an issue with the replays when I did that in the victory event: "error replay: found dependent command in replay while is_synced=false"
I think I could have used scenario_end for doing those?
and thank you both
I recently had an issue with the replays when I did that in the victory event: "error replay: found dependent command in replay while is_synced=false"
I think I could have used scenario_end for doing those?
and thank you both
Re: scenario_end event
I seem to have misunderstood you, is it synced or like victory and defeat not synced?octalot wrote: ↑December 18th, 2019, 6:29 pm Thanks for pointing that out, the wiki is also missinglocal_victory
andlocal_defeat
.
scenario_end
fires immediately aftervictory
ordefeat
, and its synchronisation is the same. However, EventWML#Multiplayer_safety suggests that, since 1.13.10, all of those events are synced and the documentation on that page forvictory
anddefeat
is wrong.
over here it says that it is https://github.com/wesnoth/wesnoth/comm ... 2b2ba8df7c
sorry english is not my first language.
Re: scenario_end event
Are you working on 1.12? The behavior changed between 1.12 and 1.14. The important commit seems to be 084dfc9887c96b3bc1f238123a97356af1659751, which the Wiki hasn't been updated for (but I now know enough to update it).I recently had an issue with the replays when I did that in the victory event: "error replay: found dependent command in replay while is_synced=false"
The current version of playsingle_controller.cpp seems to have all of scenario_end, victory and defeat synced:
https://github.com/wesnoth/wesnoth/blob ... #L302-L307
Re: scenario_end event
Thank you for clearing it up.
The error happened on 1.14.5 debian. I had a lot of things going in my victory event; remove object and overlay, clear variables and a "Horray we won" message by side 1 leader. I didn't narrow down which one of those things was giving the error exactly, I expected it to be the overlay one, but I could be wrong, many sources are pointing a finger at [message], I don't know.
I solved the problem by removing all name=victory and name=defeat events from my code and firing a custom cleanup event right before I call an [endlevel] block from either enemies defeated or time over events. The [message] was moved over to there as well.
The error happened on 1.14.5 debian. I had a lot of things going in my victory event; remove object and overlay, clear variables and a "Horray we won" message by side 1 leader. I didn't narrow down which one of those things was giving the error exactly, I expected it to be the overlay one, but I could be wrong, many sources are pointing a finger at [message], I don't know.
I solved the problem by removing all name=victory and name=defeat events from my code and firing a custom cleanup event right before I call an [endlevel] block from either enemies defeated or time over events. The [message] was moved over to there as well.
- Celtic_Minstrel
- Developer
- Posts: 2222
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: scenario_end event
Why do you need to
[remove_object]
at scenario end? Wouldn't it be sufficient to just add duration=scenario
to the [object]
?Re: scenario_end event
Hi,
They were added incidentally and just stayed.
It started with me trying to remove the effect of overlay from the units that used an object.
duration=scenario didn't remove the image, my units that drank potions still had the icon in the recall list in the next scenario.
I read somewhere (either forum or wiki) that a remove object would take care of removing the image. I added that and that didn't work either as promised.
In the end I dropped apply to overlay effect, called regular unit_overlay and remove_unit_overlay and kept the code for remove_object. I didn't expect it to do any harm.
Edit:
I'm revisiting that part of my code and see that I'm doing something wrong. I didn't include id={ID} to the [object], so the remove_object calls are worthless. I'm going to test it and get back to you.
Edit:
Even with the correct id, remove_object removed the effect but didn't remove the unit.overlay. Since I clearly had it wrong in the first place and they weren't doing anything, i commented out remove_object but kept remove_unit_overlay
They were added incidentally and just stayed.
It started with me trying to remove the effect of overlay from the units that used an object.
Code: Select all
[effect]
apply_to=overlay
add="misc/holy-water-overlay.png"
[/effect]
I read somewhere (either forum or wiki) that a remove object would take care of removing the image. I added that and that didn't work either as promised.
In the end I dropped apply to overlay effect, called regular unit_overlay and remove_unit_overlay and kept the code for remove_object. I didn't expect it to do any harm.
Edit:
I'm revisiting that part of my code and see that I'm doing something wrong. I didn't include id={ID} to the [object], so the remove_object calls are worthless. I'm going to test it and get back to you.
Edit:
Even with the correct id, remove_object removed the effect but didn't remove the unit.overlay. Since I clearly had it wrong in the first place and they weren't doing anything, i commented out remove_object but kept remove_unit_overlay
Re: scenario_end event
There are known problems with removing objects that add images in 1.14, those were fixed in wesnoth 1.15 though.
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: scenario_end event
gfgtdf, please could you clarify whether
victory
is synced in 1.14? I think it is, but the error message reported earlier suggests that it isn't.Re: scenario_end event
I'm quite sure that victory is synced, it was iirc unsynced in wesnoth 1.12 and earlier though
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: scenario_end event
Hi,
I uploaded the replays if you would like to have a look. They are all on 1.14.5 and playing the campaign 'Vaelia Random Adventures'
VRA-error_OOS_victory-15.gz will say on turn 15 'error replay: found dependent command in replay while is_synced=false'
The following is after I removed all name=victory events. There are no replay errors on these two.
VRA-enemies_defeated-19.gz enemies_defeated event on turn 19
VRA-time_over-21.gz time_over event on turn 21 out of 20. time_over is a victory in VRA.
On the error replay, right after my unit says Die villain and the Ogre says his line, my leader was supposed to say something, but it never got to that.
Thanks
I uploaded the replays if you would like to have a look. They are all on 1.14.5 and playing the campaign 'Vaelia Random Adventures'
VRA-error_OOS_victory-15.gz will say on turn 15 'error replay: found dependent command in replay while is_synced=false'
The following is after I removed all name=victory events. There are no replay errors on these two.
VRA-enemies_defeated-19.gz enemies_defeated event on turn 19
VRA-time_over-21.gz time_over event on turn 21 out of 20. time_over is a victory in VRA.
On the error replay, right after my unit says Die villain and the Ogre says his line, my leader was supposed to say something, but it never got to that.
Thanks
- Attachments
-
- VRA-enemies_defeated-19.gz
- (53.22 KiB) Downloaded 381 times
-
- VRA-time_over-21.gz
- (42.19 KiB) Downloaded 383 times
-
- VRA-error_OOS_victory-15.gz
- (54.04 KiB) Downloaded 377 times
Re: scenario_end event
did you play this game on the official mp server?
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: scenario_end event
ok was able to reproduce this and made a report https://github.com/wesnoth/wesnoth/issues/4667 . This seems to be an engine bug, i'd reccomend that you just ignore it.
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.