Adding graphics / menus when moving units?

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.
Post Reply
ialdabaoth
Posts: 9
Joined: November 22nd, 2013, 5:57 pm

Adding graphics / menus when moving units?

Post by ialdabaoth »

This might be a little complicated to explain, but here's basically what I want to do:

Current behavior:
When you've selected a unit and begin to move the cursor, a footprint path renders on the map to where the cursor is, and clicking on that hex will move you to that hex.

If the cursor is highlighting an enemy unit and you can reach that enemy unit, the footprint path will end with a red 'attack' arrow, and clicking on that enemy unit will open an 'attack' dialog; selecting 'ok' on that attack dialog will move you adjacent to that enemy unit, and attack it.

What I want to do:
If the cursor is highlighting a friendly unit with a particular custom [trait] and you can reach that friendly unit, the footprint path will end with a green 'action' arrow, and clicking on that friendly unit will open an 'action' dialog; selecting 'ok' on that action dialog will move you adjacent to that friendly unit, and perform the chosen action.

Where do I need to look to get a sense for how I would do this?
gfgtdf
General Code Maintainer
Posts: 1344
Joined: February 10th, 2013, 2:25 pm

Re: Adding graphics / menus when moving units?

Post by gfgtdf »

in general this sounds like a good and generic solution, that could also allow users to implement unit carrying sytem in wml (ask fabi about this). a but i wouldn't bind this to special traits maybe adding a toplevel [unit_to_unit_action] tag wich specifies when the dialog should appear.

how do you do it? well its hard because you cannot do this in wml. If you want a similar behavior with wml your best options are right-click-menu-items. If you want it like you say, you have to implement it in the c++ core! That requires: knowledge of c++, knowledge of wesnoth, some days to study the wesnoth sourcecode, learning to use GIT, talking with devs.... .
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.
ialdabaoth
Posts: 9
Joined: November 22nd, 2013, 5:57 pm

Re: Adding graphics / menus when moving units?

Post by ialdabaoth »

Hrm. Well, I suppose I should open up the c++ source, then. This should be entertaining.
Post Reply