Location-Based Recruit Lists?

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
weewah
Posts: 101
Joined: October 31st, 2019, 7:11 pm

Location-Based Recruit Lists?

Post by weewah »

Is there a way to make location-based recruit lists?

I'm aware that, if I wanted to make a leader able to recruit different units at different keeps, I could simply use move events to change the recruit list whenever the leader moves onto a keep.

But what if I wanted to make a leader able to recruit different units on different castle tiles, while remaining on the same keep? Is there any way to do that?
User avatar
Celtic_Minstrel
Developer
Posts: 2214
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Location-Based Recruit Lists?

Post by Celtic_Minstrel »

I'm pretty sure there isn't a way to do that, unless someone can come up with something weird and clever (but I doubt it).
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Location-Based Recruit Lists?

Post by gfgtdf »

Well you could try to use mouseover events to change the recruitlist in a way that would only allow those units that'd be legal for the position (note that it's more complicated because when the location is occupied it will be placed somewhere else) you also have to be careful with sync or other clients might reject that action.
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.
Tad_Carlucci
Inactive Developer
Posts: 503
Joined: April 24th, 2016, 4:18 pm

Re: Location-Based Recruit Lists?

Post by Tad_Carlucci »

What he means is you would need to not only detect the tile with a mouseover event but you would need to detect if it is occupied and, if so, know the search pattern for nearby tiles, looking for an un-occupied tile, to determine the position where the new unit will appear.
I forked real life and now I'm getting merge conflicts.
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: Location-Based Recruit Lists?

Post by octalot »

It wouldn't be a good UX, but maybe show a message, refund the gold, and kill the unit?

Code: Select all

    [event]
        name=recruit
        first_time_only=no
        [filter]
            race=merman
            [filter_location]
                terrain=!,Chw,Khw,Cm*,Km*,W*
            [/filter_location]
        [/filter]
        [message]
            speaker=narrator
            message=_ "Merfolk can only be recruited on water-castle tiles"
        [/message]
        [gold]
            side=$unit.side
            amount=$unit.cost
        [/gold]
        [kill]
            id=$unit.id
        [/kill]
    [/event]
Tad_Carlucci
Inactive Developer
Posts: 503
Joined: April 24th, 2016, 4:18 pm

Re: Location-Based Recruit Lists?

Post by Tad_Carlucci »

If you have to go to so much work you have to ask: is it really necessary? And: can I get a similar effect with a totally different approach?

While it's possible you've identified a new use case, and could possibly even justify changing the engine to support it, I sort of suspect a small adjustment in your design goals would make the issue simply go away.
I forked real life and now I'm getting merge conflicts.
Post Reply