Trying to get the Marauder Boatsman to work correctly

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
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Trying to get the Marauder Boatsman to work correctly

Post by turin »

There are two events here. The first is supposed to make it so whenever a Marauder Boatsman moves onto land, his static image switches to boatsman-land.png. The second should make it so whenever one moves onto water, he goes back to boatsman.png.

What actually happens, though, is the first move made by the Boatsman, it switches to boatsman-land.png (boatsman.png is the default image), and after that the image stays the same no matter what the boatsman does. And if I change the [filter_location] tags to [filter], it makes it so the image never changes.

Code: Select all

	[event]
	name=moveto
	first_time_only=no
		[filter]
			[not]
				[filter_terrain]
				terrain=s,c,w,k
				[/filter_terrain]
			[/not]
		type=Marauder Boatsman
		[/filter]
		[store_unit]
			[filter]
			x,y=$x1,$y1
			[/filter]
		variable=temp
		[/store_unit]
		[set_variable]
		name=temp.image
		value="units/marauder/boatsman-land.png"
		[/set_variable]
		[unstore_unit]
		variable=temp
		[/unstore_unit]
		[clear_variable]
		name=temp
		[/clear_variable]
		[allow_undo]
		[/allow_undo]
	[/event]
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
Xan
Inactive Developer
Posts: 258
Joined: August 28th, 2005, 3:05 pm
Contact:

Post by Xan »

It's [filter_location], not [filter_terrain].
"It is time people learned about their failures and my successes."
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Xan wrote:It's [filter_location], not [filter_terrain].
That's actually what it originally was when I got the problem - then I switched it to [filter] to see if it worked, which it didn't, and I switched it back incorrectly to [filter_terrain].

So, there is still a problem if I use [filter_location]. Any ideas?
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
Xan
Inactive Developer
Posts: 258
Joined: August 28th, 2005, 3:05 pm
Contact:

Post by Xan »

It works for me with [filter_location]. You said you have two events, but I only see one. :?
"It is time people learned about their failures and my successes."
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Sorry, apparently the other one didnt' copy correctly... here's what hte code looks like:

Code: Select all

	[event]
	name=moveto
	first_time_only=no
		[filter]
			[not]
				[filter_location]
				terrain=s,c,w,k
				[/filter_location]
			[/not]
		type=Marauder Boatsman
		[/filter]
		[store_unit]
			[filter]
			x,y=$x1,$y1
			[/filter]
		variable=temp
		[/store_unit]
		[set_variable]
		name=temp.image
		value="units/marauder/boatsman-land.png"
		[/set_variable]
		[unstore_unit]
		variable=temp
		[/unstore_unit]
		[clear_variable]
		name=temp
		[/clear_variable]
		[allow_undo]
		[/allow_undo]
	[/event]
	[event]
	name=moveto
	first_time_only=no
		[filter]
			[filter_location]
			terrain=s,c,w,k
			[/filter_location]
		type=Marauder Boatsman
		[/filter]
		[store_unit]
			[filter]
			x,y=$x1,$y1
			[/filter]
		variable=temp
		[/store_unit]
		[set_variable]
		name=temp.image
		value="units/marauder/boatsman.png"
		[/set_variable]
		[unstore_unit]
		variable=temp
		[/unstore_unit]
		[clear_variable]
		name=temp
		[/clear_variable]
		[allow_undo]
		[/allow_undo]
	[/event]
These lines are at the end of the unit.cfg file.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
Xan
Inactive Developer
Posts: 258
Joined: August 28th, 2005, 3:05 pm
Contact:

Post by Xan »

Whoops. It turned out there was a bug where the last [event] could be lost. So you can work around this bug until the next release be adding a fake event after the last real one.
"It is time people learned about their failures and my successes."
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Xan wrote:Whoops. It turned out there was a bug where the last [event] could be lost. So you can work around this bug until the next release be adding a fake event after the last real one.
OK. Thanks.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

As I mentioned in the Fall of Silvium thread, I applied this knowledge and now they display the correct frame, but because of the transparency effect in water it looks like they sit in a sunk tub :lol:. Any way to turn this off for them?
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Rhuvaen wrote:As I mentioned in the Fall of Silvium thread, I applied this knowledge and now they display the correct frame, but because of the transparency effect in water it looks like they sit in a sunk tub :lol:. Any way to turn this off for them?
You can set unit.flying=yes for the boat variation - I think you can't put that in the unit variation definition though, but must modify that variable in the event that flips the water/land variations around.
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Since the standing frame will never appear in the water (it will always be the boat frame), why can't you just make him always flying?
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Rhuvaen wrote:As I mentioned in the Fall of Silvium thread, I applied this knowledge and now they display the correct frame, but because of the transparency effect in water it looks like they sit in a sunk tub :lol:. Any way to turn this off for them?
Maybe you can invoke the flies attribute when the unit is stored. Its effect is to not submerge the unit. Another idea could be to modify the unit sprite to move it up in the hex (if I understand the issue correctly).
Hope springs eternal.
Wesnoth acronym guide.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

scott wrote:Another idea could be to modify the unit sprite to move it up in the hex (if I understand the issue correctly).
Doesn't always work right, since different terrain can have a different amount of submerge, such as shallow water vs deep water.
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Post by Noyga »

Well on those terrains it uses the boat image too, so i guess flying=yes works well here.
bruno
Inactive Developer
Posts: 293
Joined: June 26th, 2005, 8:39 pm
Contact:

Post by bruno »

Can you retest this with current SVN?
Xan's original fix caused some other problems. I now have one that fixes those other problems, but I am not sure about yours.
If you can test it, can you provide source and instructions for how to test it?
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

bruno wrote:Can you retest this with current SVN?
Xan's original fix caused some other problems. I now have one that fixes those other problems, but I am not sure about yours.
If you can test it, can you provide source and instructions for how to test it?
I don't have current SVN - it will take me at least 30 minutes to download and compile. I'll report back then.

If you don't want to wait, you can just download the Imperial Era and move around the Marauder Boatsman contained therein. The WML for the unit has not changed since that version.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
Post Reply