Out of Sync: How to solve?

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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.
Post Reply
AssassinT90
Posts: 39
Joined: December 20th, 2007, 9:47 am

Out of Sync: How to solve?

Post by AssassinT90 » August 15th, 2010, 9:54 am

Code: Select all

[event]
	name=prestart
	[message]
		side_for=1
		speaker=narrator
		message= _ "Enable fog?"
				[option]
			message= _ "No"
			[command]
			[/command]
		[/option]
		[option]
			message= _ "Yes"
			[command]
			[event]
				name=new turn
				first_time_only=yes
				[modify_side]
					side=1
					fog=yes
				[/modify_side]
				[modify_side]
					side=2
					fog=yes
				[/modify_side]
				[modify_side]
					side=3
					fog=yes
				[/modify_side]
				[modify_side]
					side=4
					fog=yes
				[/modify_side]
				[modify_side]
					side=5
					fog=yes
				[/modify_side]
				[modify_side]
					side=6
					fog=yes
				[/modify_side]
				[modify_side]
					side=7
					fog=yes
				[/modify_side]
				[modify_side]
					side=8
					fog=yes
				[/modify_side]
				[modify_side]
					side=9
					fog=yes
				[/modify_side]
			[/event]
			[message]
				speaker=narrator
				message= _ "Fog Added"
			[/message]
			[/command]
		[/option]
	[/message]
[/event]
Hello. I'm using that code to try to give players an option about enabling fog or not(in game). However, when I use it, the choice made by P1 isn't sent to the rest of the players, causing the first option to be always taken by the other players.

Question is: How to make the option chosen by P1 be sent to all network players?

Anonymissimus
Inactive Developer
Posts: 2458
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Out of Sync: How to solve?

Post by Anonymissimus » August 15th, 2010, 12:58 pm

[option] does currently not work at all in prestart and start events in mutiplayer. The earliest point you can do that is in a turn 1 event.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign

User avatar
Dixie
Posts: 1755
Joined: February 10th, 2010, 1:06 am
Location: $x1,$y1

Re: Out of Sync: How to solve?

Post by Dixie » August 15th, 2010, 1:06 pm

Anonymissimus wrote:[option] does currently not work at all in prestart and start events in mutiplayer. The earliest point you can do that is in a turn 1 event.
Well I can't say for pre-start, but in Paintball Era I use some options in a start event, and so far it has always worked for me. Note that I only tested it in local multiplayer, maybe it would cause OOSes in real MP... I hadn't thought 'bout that. :hmm:
Jazz is not dead, it just smells funny - Frank Zappa
Current projects: Internet meme Era, The Settlers of Wesnoth

Anonymissimus
Inactive Developer
Posts: 2458
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Out of Sync: How to solve?

Post by Anonymissimus » August 15th, 2010, 1:17 pm

Yes it causes OOS (1.8) In 1.9 the wml author gets a forceful error message now.
https://gna.org/bugs/index.php?16378
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign

User avatar
Gambit
Loose Screw
Posts: 3266
Joined: August 13th, 2008, 3:00 pm
Location: Dynamica
Contact:

Re: Out of Sync: How to solve?

Post by Gambit » August 15th, 2010, 3:28 pm

Dixie wrote:
Anonymissimus wrote:[option] does currently not work at all in prestart and start events in mutiplayer. The earliest point you can do that is in a turn 1 event.
Well I can't say for pre-start, but in Paintball Era I use some options in a start event, and so far it has always worked for me. Note that I only tested it in local multiplayer, maybe it would cause OOSes in real MP... I hadn't thought 'bout that. :hmm:
It will if people pick different game-state-changing options.
You need to use side_for=1 and let only the host choose. Or if you want each person to be able to pick differently (per-side settings for example), you will have to do it in side turn 1.

Also start and turn 1 are the same event AFAIK.

AssassinT90
Posts: 39
Joined: December 20th, 2007, 9:47 am

Re: Out of Sync: How to solve?

Post by AssassinT90 » August 15th, 2010, 4:10 pm

Gambit wrote: It will if people pick different game-state-changing options.
You need to use side_for=1 and let only the host choose. Or if you want each person to be able to pick differently (per-side settings for example), you will have to do it in side turn 1.

Also start and turn 1 are the same event AFAIK.
Take a look at the code. 4th line
Anonymissimus wrote:Yes it causes OOS (1.8) In 1.9 the wml author gets a forceful error message now.
https://gna.org/bugs/index.php?16378

Thanks! Gonna figure out an way to avoid that bug.

User avatar
Gambit
Loose Screw
Posts: 3266
Joined: August 13th, 2008, 3:00 pm
Location: Dynamica
Contact:

Re: Out of Sync: How to solve?

Post by Gambit » August 15th, 2010, 4:29 pm

AssassinT90 wrote: Take a look at the code. 4th line
Sorry. That was for Dixie.

User avatar
Dixie
Posts: 1755
Joined: February 10th, 2010, 1:06 am
Location: $x1,$y1

Re: Out of Sync: How to solve?

Post by Dixie » August 15th, 2010, 5:26 pm

Gambit wrote:
Dixie wrote: Well I can't say for pre-start, but in Paintball Era I use some options in a start event, and so far it has always worked for me. Note that I only tested it in local multiplayer, maybe it would cause OOSes in real MP... I hadn't thought 'bout that. :hmm:
It will if people pick different game-state-changing options.
You need to use side_for=1 and let only the host choose. Or if you want each person to be able to pick differently (per-side settings for example), you will have to do it in side turn 1.

Also start and turn 1 are the same event AFAIK.
Well, in paintball era, only the host (well, player one) gets to pick options at the start. The other players are at his mercy :P So I guess that it wouldn't cause OOSes, then. Good :)
Jazz is not dead, it just smells funny - Frank Zappa
Current projects: Internet meme Era, The Settlers of Wesnoth

Post Reply