Scenery over walker but under flier

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
User avatar
beetlenaut
Developer
Posts: 2491
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Scenery over walker but under flier

Post by beetlenaut »

Is it possible to have a piece of scenery or item that covers a normal unit in its hex, but appears below a flying unit in the same hex? Are flying units drawn above layer zero?
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
cephalo
Posts: 137
Joined: December 20th, 2009, 4:37 pm

Re: Scenery over walker but under flier

Post by cephalo »

I bet you could design a flyer that would fly over such terrain, but I would be surprised if existing flyers were drawn on a different layer than other units.
User avatar
beetlenaut
Developer
Posts: 2491
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Scenery over walker but under flier

Post by beetlenaut »

I was going to use a bat, but a modified bat would work fine. I just can't think of how to do it.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
SkyOne
Posts: 1310
Joined: January 3rd, 2009, 7:23 pm

Re: Scenery over walker but under flier

Post by SkyOne »

beetlenaut wrote:Is it possible to have a piece of scenery or item that covers a normal unit in its hex, but appears below a flying unit in the same hex?
Well, I don't think this is the best idea because this one fires after a unit moves to the hex, but how about:
- spawning a moveto event with [filter] type=something Bat, then remove and place the item/scenery-image (depending on the unit) as "image=" and "halo=" with [if] + [have_unit] + [else] tags... If the bat is on the hex, the x,y is "image=", and for the other units, showing the image as "halo="...

There may be a hint for a better idea on this Alarantalara's thread: http://forums.wesnoth.org/viewtopic.php ... 01#p493881


If I misunderstand your question, sorry...
Fate of a Princess/feedback thread: "What is in own heart that is the most important, not who you are."
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
User avatar
beetlenaut
Developer
Posts: 2491
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Scenery over walker but under flier

Post by beetlenaut »

Something like that may work. I don't think halo is correct because halo images don't change according to day/night rules, but I think I could change the terrain layer depending on what was on it. It wouldn't be pretty during the unit's move, but it would work otherwise. It may be a bear to code, but Alarantalara's thread should help with that.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
Alarantalara
Art Contributor
Posts: 784
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: Scenery over walker but under flier

Post by Alarantalara »

Terrrain layers are static, you can't change them based on the presence of units.
You could add an event to change the terrain depending on the unit on it where the two terrains are identical other than the layer of the image.
User avatar
beetlenaut
Developer
Posts: 2491
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Scenery over walker but under flier

Post by beetlenaut »

That's kind of what I figured would be involved. Thanks.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Post Reply