changing all terrain hexes a unit passes over

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
User avatar
Huston
Posts: 1070
Joined: April 29th, 2009, 8:26 pm
Location: Somewhere in this World(I Think)

changing all terrain hexes a unit passes over

Post by Huston »

is it possible to change the terrain that a unit passes over as the unit passes over the hex.
so for instance if i have a unit that can move 5 hexes i want it to change all 5 hexes it passed into sand. how could i get it to turn only the hexes the unit touched into sand?

i'll try and illustrate what i mean X will be the hex O will be the unit and it's path.

starting point:

OXXXXXXX
XXXXXXXX
XXXXXXXX
XXXXXXXX

first hex passed over:

OXXXXXXX
XOXXXXXX
XXXXXXXX
XXXXXXXX

second hex passed over:

OXXXXXXX
XOOXXXXX
XXXXXXXX
XXXXXXXX

third hex passed over:

OXXXXXXX
XOOXXXXX
XXXOXXXX
XXXXXXXX


fourth hex passed over:

OXXXXXXX
XOOXXXXX
XXXOOXXX
XXXXXXXX


ending point:

OXXXXXXX
XOOXXXXX
XXXOOXXX
XXXXXOXX

so how do i get all those O's to change into sand considering (to the best of my knowledge) a moveto event only triggers for the last hex the unit hits?
User avatar
Huston
Posts: 1070
Joined: April 29th, 2009, 8:26 pm
Location: Somewhere in this World(I Think)

Re: changing all terrain hexes a unit passes over

Post by Huston »

so i guess since no one has responded yet that what I've asked is impossible to do. :(

sorry about the double post.
JKilligans
Posts: 10
Joined: June 5th, 2009, 3:38 pm

Re: changing all terrain hexes a unit passes over

Post by JKilligans »

That's a shame, cause it sounds like a really interesting idea.
User avatar
beetlenaut
Developer
Posts: 2825
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: changing all terrain hexes a unit passes over

Post by beetlenaut »

Huston wrote:what I've asked is impossible to do.
Yeah. The game doesn't store the exact hexes of a unit's path, and you can't make something happen while a unit is moving.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Fosprey
Posts: 254
Joined: January 25th, 2008, 8:13 am

Re: changing all terrain hexes a unit passes over

Post by Fosprey »

I´m not the wisest person around about wml, but in the past i was in the need of the same WML filter, and i was told by zookeeper that he already suggested a wml filter that would make what you suggest work. It just seems nobody did the coding yet, but i think it´s it´s on the ¨wanted things¨ for a few years, it should be complicated if nobody implemented it yet because this is something that a lot of modders would benefit off.
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: changing all terrain hexes a unit passes over

Post by Sapient »

This is not possible yet, but has been on the wiki/FutureWML page for a long time.
I agree that it is a needed feature... I haven't had much spare coding time lately unfortunately.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
User avatar
Huston
Posts: 1070
Joined: April 29th, 2009, 8:26 pm
Location: Somewhere in this World(I Think)

Re: changing all terrain hexes a unit passes over

Post by Huston »

ok...thanks for the info guys.
Post Reply