Bitrons WML Questions

The place to post your WML questions and answers.

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.
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: Bitrons WML Questions

Post by Bitron »

Well, I tried to fix it by defining a time_area at x,y=0,0 in a prestart event, but that didn't help.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Bitrons WML Questions

Post by gfgtdf »

hmm that's suprising, and you made sure to refresh your wml (F5) ?
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.
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: Bitrons WML Questions

Post by Bitron »

I quit the game, rewrote the WML (I added the prestart event into the very same macro), saved, and started the game again.

Code: Select all

	[event]
		name=start
		[time_area]
			x,y=1,1
			{UNDERGROUND}
		[/time_area]
	[/event]

	[event]
		name=prerecruit
		first_time_only=no
		
		[filter]
			type_adv_tree=Vampire Deformity
		[/filter]
		
		[store_time_of_day]
		[/store_time_of_day]
		
		[if]
			[variable]
				name=time_of_day.lawful_bonus
				less_than_equal_to=0
			[/variable]
			[then]
				[unpetrify]
					type_adv_tree=Vampire Deformity
					side=$side_number
				[/unpetrify]
			[/then]
			[else]
				[petrify]
					type_adv_tree=Vampire Deformity
					side=$side_number
					[not]
						[filter_location]
							area=underground
						[/filter_location]
					[/not]
				[/petrify]
			[/else]
		[/if]
	[/event]
	
	[event]
		name=turn refresh
		first_time_only=no
		
		[store_time_of_day]
		[/store_time_of_day]
		
		[if]
			[variable]
				name=time_of_day.lawful_bonus
				less_than_equal_to=0
			[/variable]
			[then]
				[unpetrify]
					type_adv_tree=Vampire Deformity
					side=$side_number
				[/unpetrify]
			[/then]
			[else]
				[heal_unit]
					[filter]
						type_adv_tree=Vampire Deformity
						side=$side_number
						[not]
							[filter_location]
								area=underground
							[/filter_location]
						[/not]
					[/filter]
					amount=10
					animate=yes
					restore_statuses=yes
				[/heal_unit]
				[petrify]
					type_adv_tree=Vampire Deformity
					side=$side_number
					[not]
						[filter_location]
							area=underground
						[/filter_location]
					[/not]
				[/petrify]
			[/else]
		[/if]
	[/event]
#enddef
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Bitrons WML Questions

Post by gfgtdf »

hmm ok i just tested it myself:

test code:

Code: Select all

--wesnoth.wml_actions.time_area { x=4, y=4, T.time {}, }
wesnoth.match_location(5,5, { area = "underground"})
(code from a menu items) and it crashes but when i uncomment the [time_area] part it does no longer crash.
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.
Post Reply