Unitmarkers [SP/MP modification for 1.14]

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
josteph
Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Unitmarkers [SP/MP modification for 1.12/1.13]

Post by josteph »

I've just installed this add-on for the first time.

Using Wesnoth v1.13.10+dev (38e31aa61f-Clean), when I enable the mod in SP mode, I get:
User Interaction Required

The currently chosen era is not compatible with your setup. Please select a compatible one.

[default]
That doesn't happen with 1.13.8.

Edit: I see there are separate sets of markers for leaders/loyals/others.

Edit2: This is https://github.com/wesnoth/wesnoth/issues/2229
User avatar
Paulomat4
Moderator Emeritus
Posts: 721
Joined: October 16th, 2012, 3:32 pm
Location: Wesmere library, probably summoning Zhangor

Re: Unitmarkers [SP/MP modification for 1.12/1.13]

Post by Paulomat4 »

Even though this seems to be a wesnoth issue, thank you for reporting :)
Creator of Dawn of Thunder and Global Unitmarkers

"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
User avatar
Paulomat4
Moderator Emeritus
Posts: 721
Joined: October 16th, 2012, 3:32 pm
Location: Wesmere library, probably summoning Zhangor

Re: Unitmarkers [SP/MP modification for 1.14]

Post by Paulomat4 »

Unitmarkers has now been uploaded to the 1.14 add-on server. There has also been a bugfix that prevented heroes and leaders to go back to normal.
Changelog (also for the previous version for completeness sake):

Code: Select all

Version 1.4.2
-Fixed the bug of Hero and Leader units getting the loyal Icon after "revert all changes"
-upload to 1.14

Version 1.4.1
-Manually reshaded every pixel of the flag icon (finally happy with it)
-complete macro-rewrite to use objects for filtering (hopefully unlocking overlay storing)
-recoloring of leader crowns
Creator of Dawn of Thunder and Global Unitmarkers

"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
User avatar
josteph
Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Unitmarkers [SP/MP modification for 1.14]

Post by josteph »

On 1.14, when a unit marked with crossed flaming swords stands on shallow water (Ww) and the Animate water wesnoth preference is enabled, the top-left end of the swords blinks:
Screenshot_2018-07-04_08-58-48.png
Screenshot_2018-07-04_08-58-48.png (14.33 KiB) Viewed 9222 times
The surrounding hexes are all shallow and deep water. Blinking stops if I place a Sky Drake in the adjacent hex to the NE, but not if I place a Peasant in that hex.
User avatar
Paulomat4
Moderator Emeritus
Posts: 721
Joined: October 16th, 2012, 3:32 pm
Location: Wesmere library, probably summoning Zhangor

Re: Unitmarkers [SP/MP modification for 1.14]

Post by Paulomat4 »

Hello Josteph,

Thanks for reporting first of all. I think the problem you're having is due to the way that wesnoth renders overlays. Maybe I could place the swords a few pixels farther down so it won't be cut off from the hex?
Creator of Dawn of Thunder and Global Unitmarkers

"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
User avatar
josteph
Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Unitmarkers [SP/MP modification for 1.14]

Post by josteph »

Hi Paulomat, you're welcome. Placing the overlay a bit farther down should work, but I wonder if this isn't a wesnoth bug, in that the water animation shouldn't be rendered over the overlay.
Shiki
Developer
Posts: 306
Joined: July 13th, 2015, 9:53 pm
Location: Germany

Re: Unitmarkers [SP/MP modification for 1.14]

Post by Shiki »

josteph wrote:
July 4th, 2018, 9:05 am
On 1.14, when a unit marked with crossed flaming swords stands on shallow water (Ww) and the Animate water wesnoth preference is enabled, the top-left end of the swords blinks:

Screenshot_2018-07-04_08-58-48.png

The surrounding hexes are all shallow and deep water. Blinking stops if I place a Sky Drake in the adjacent hex to the NE, but not if I place a Peasant in that hex.
Does it fit into https://github.com/wesnoth/wesnoth/blob ... /alpha.png ?

If not, then it is not an issue specific to water, I saw it with caves. It has an impact when you move the mouse over certain adjacent hexes.
User avatar
josteph
Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Unitmarkers [SP/MP modification for 1.14]

Post by josteph »

Thanks Shiki. The chopped part starts a few pixels outside the yellow frame that marks the hex under the cursor. I can reproduce the issue in caves too as you describe. Is there anything I can do to help fix this?
User avatar
josteph
Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Unitmarkers [SP/MP modification for 1.14]

Post by josteph »

Commit https://github.com/wesnoth/wesnoth/comm ... 59d6da560c in master causes the markers to disappear when a unit advances.

(That commit had a syntax error that was fixed by the next commit, https://github.com/wesnoth/wesnoth/comm ... a2c2688627)

update: See #4058
User avatar
Paulomat4
Moderator Emeritus
Posts: 721
Joined: October 16th, 2012, 3:32 pm
Location: Wesmere library, probably summoning Zhangor

Re: Unitmarkers [SP/MP modification for 1.14]

Post by Paulomat4 »

thanks for informing me josteph! I'll see if I can get around to create a fix.
Creator of Dawn of Thunder and Global Unitmarkers

"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
User avatar
josteph
Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Unitmarkers [SP/MP modification for 1.14]

Post by josteph »

Thanks Paulomat. I'm not sure if Unitmarkers should be changed or if wesnoth upstream should come up with a backwards compatible solution. If the former, then the change should certainly be mentioned in changelog.
User avatar
josteph
Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Unitmarkers [SP/MP modification for 1.14]

Post by josteph »

Hi again Paulomat. When a unit has a marker, removing the marker also removes all other objects the unit has (for example, if the unit had picked up a storm trident, removing the marker also removes the storm trident attack from the unit). This is because the [remove_object] on event_macros.cfg:138 does not specify an object_id.

The following patch fixes it in my testing (I had unit1 pick up a storm trident, gave unit1 a marker, gave unit2 a marker, and reverted unit1's marker), but it leaves the unit with both the name=normal_unit object and with two copies of the _last_last_overlays object. I'm not sure if that's the correct outcome.
Spoiler:
I discovered this the hard way - I removed the marker from a unit that had picked up an item, and had to replay a few turns when I found out...
User avatar
josteph
Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Unitmarkers [SP/MP modification for 1.14]

Post by josteph »

Hi Paulomat, any news on the regression in master (4 posts up)?
gfgtdf
General Code Maintainer
Posts: 1343
Joined: February 10th, 2013, 2:25 pm

Re: Unitmarkers [SP/MP modification for 1.14]

Post by gfgtdf »

I just updated the unitmarker part of the addon world conquest II to 1.15 which does basicially the same thing as this addon, maybe it'll help you: https://github.com/gfgtdf/World_Conques ... marker.lua . (it currently only supports 2 images, but you can easily add more images to the list at the top of that file), it required the wc2_utils.menu_item function that you'll also find in that addon. The code won't work in 1.14 though, only in 1.15+
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
josteph
Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Unitmarkers [SP/MP modification for 1.14]

Post by josteph »

Paulomat, see https://github.com/wesnoth/wesnoth/issues/4288, Unitmarker will need a code change when it's uploaded to 1.15. Also, please see my previous report here viewtopic.php?f=21&t=39771&start=30#p635017. If you like I can upload Unitmarker with these issues fixed.

gfgtdf, thanks for the reference. The functionality in wcII in 1.14 is exactly the same as the functionality in Unitmarker. I'll definitely get either wcII or Unitmarker set up when I start playing on 1.15. Actually, I might even try and set up both of them at the same time, since Unitmarker puts its icons on the top-left corner and wcII on the top-right corner. I'm sure I'll find a use for that... :whistle:
Post Reply