URL:
  <http://gna.org/bugs/?16688>

                 Summary: Support for [movement_costs] in [filter_radius]
                 Project: Battle for Wesnoth
            Submitted by: zookeeper
            Submitted on: Sunday 09/12/10 at 11:22
                Category: Feature Request
                Severity: 1 - Wish
                Priority: 5 - Normal
              Item Group: WML
                  Status: None
                 Privacy: Public
             Assigned to: sapient
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: trunk
        Operating System: all

    _______________________________________________________

Details:

While SLF's can already do almost anything, tasks like reliably finding out
the exact movement/vision range of a unit or how many movement points are
needed to reach a given location are still practically impossible. However,
if [filter_radius] could take a [movement_costs] tag which would specify how
many "points" it takes for the radius to expand to a given hex, these would
become doable.

For example, this would store the farthest away locations that side 1 can
reach (to attack):


[store_unit]
    [filter]
        side=1
    [/filter]
    
    kill=no
    variable=units
[/store_unit]

{FOREACH units i}
    [store_locations]
        find_in=locs
        
        [or]
            [and]
                x,y=$units[$i].x,$units[$i].y
                radius="$($units[$i].moves + 1)"
                
                [filter_radius]
                    [insert_tag]
                        name=movement_costs
                        variable=units[$i].movement_costs
                    [/insert_tag]
                [/filter_radius]
            [/and]
            
            [not]
                x,y=$units[$i].x,$units[$i].y
                radius=$units[$i].moves
                
                [filter_radius]
                    [insert_tag]
                        name=movement_costs
                        variable=units[$i].movement_costs
                    [/insert_tag]
                [/filter_radius]
            [/not]
        [/or]
        
        variable=locs
    [/store_locations]
{NEXT i}


As a simpler example, this SLF could be used to store the locations onto
which overflowing lava should expand to, if you'd want it to expand twice as
fast onto cave floor than onto rockbound cave:


    terrain=Ql*
    radius=2
    
    [filter_radius]
        [movement_costs]
            flat=1
            cave=1
            hills=2
        [/movement_costs]
    [/filter_radius]


Of course, the tag could be named [radius_costs] too. I'm assigning to
Sapient since this is your area of expertise; feel free to unassign if you're
not interested.




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?16688>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to