Bitrons WML Questions

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

Re: Bitrons WML Questions

Post by Bitron » April 21st, 2018, 7:05 pm

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: 1028
Joined: February 10th, 2013, 2:25 pm

Re: Bitrons WML Questions

Post by gfgtdf » April 21st, 2018, 7:27 pm

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
Moderator
Posts: 438
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: Bitrons WML Questions

Post by Bitron » April 21st, 2018, 7:48 pm

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: 1028
Joined: February 10th, 2013, 2:25 pm

Re: Bitrons WML Questions

Post by gfgtdf » April 21st, 2018, 9:03 pm

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