question about unit's direction
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.
- Cavalcadeur
- Posts: 7
- Joined: December 21st, 2014, 4:18 pm
question about unit's direction
Hi everyone,
I'm trying to make a campaign about the second punic war but I have a problem with some units named "Walls".
I have made immobile units with lot of hitpoints used to protect castles. Like castle's walls.
The problem is here : when the wall is under attack, he changes direction to look at his opponent but he's not supposed to do this because he's a wall and he can't move !!!
I can't find how to avoid ths mirroring. Anybody have a solution ??
PS: Sorry for my english ...
I'm trying to make a campaign about the second punic war but I have a problem with some units named "Walls".
I have made immobile units with lot of hitpoints used to protect castles. Like castle's walls.
The problem is here : when the wall is under attack, he changes direction to look at his opponent but he's not supposed to do this because he's a wall and he can't move !!!
I can't find how to avoid ths mirroring. Anybody have a solution ??
PS: Sorry for my english ...
Re: question about unit's direction
I believe you need to do that with direction-filtered animations.
- Cavalcadeur
- Posts: 7
- Joined: December 21st, 2014, 4:18 pm
Re: question about unit's direction
Thanks a lot !
- Elvish_Hunter
- Posts: 1575
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: question about unit's direction
Another solution is that your wall unit can have "misc/empty.png" as base frame, then you'll put the wall image on its hex with an [item] tag. Then, in an appropriate die event, you'll use [remove_item] to clear the hex. Or you can define your own terrain overlay with the wall image and change the terrain in the die event.Cavalcadeur wrote:Hi everyone,
The problem is here : when the wall is under attack, he changes direction to look at his opponent but he's not supposed to do this because he's a wall and he can't move !!!
I can't find how to avoid ths mirroring. Anybody have a solution ??
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
Re: question about unit's direction
misc/empty.png is a 640x480 image. For units it’s safer to use misc/blank-hex.png, which is 72x72 and will take up less memory in the event it’s instantiated as an uncompressed surface. A larger image will also cause problems in 1.13.0 due to the overlays+bars repositioning “feature”.Elvish_Hunter wrote:Another solution is that your wall unit can have "misc/empty.png" as base frame, then you'll put the wall image on its hex with an [item] tag.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
- Elvish_Hunter
- Posts: 1575
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: question about unit's direction
You're right, I confused the two files: I meant "misc/blank-hex.png".shadowm wrote:misc/empty.png is a 640x480 image. For units it’s safer to use misc/blank-hex.png
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)