Scrolling a map between scenarios

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
Helmet
Posts: 331
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Scrolling a map between scenarios

Post by Helmet »

This is the situation.

The map for the second scenario is Map_2. Map_2 is 25x10 hexes.
The map for the third scenario is Map_3. Map_3 is also 25x10 hexes.
Map_3 is exactly due west of Map_2. The maps overlap by 5 hexes. The player's keep is located in those overlapping hexes.

My playtester did not realize that Map_3 is adjacent to Map_2. This was disappointing, so I made a new map to serve as a transition from Map_2 to Map_3. This longer map is 45x10 hexes and duplicates both maps. I call the transition map Map_2_3_transition. After the player has beaten the second scenario and is preparing to start the third scenario, I want them to see Map_2_3_transition scroll from east to west. The player will then realize that the third scenario is taking place due west of the second scenario, and that their keep remains the same. Then Map_3 will load and the battle will start.

How do I do that?

Is it possible to simply use Map_2_3_transition for BOTH scenarios and not bother with Map_2 and Map_3? How would I do that instead? Of course, I wouldn't want the player to send units to capture villages in the western map-area while he is playing on the eastern half, and I don't want him to capture villages on the eastern half when he is playing on the western half. The east and west maps are two distinct scenarios with their own villages, objectives, and so forth, even though they connect geographically.
User avatar
WhiteWolf
Forum Moderator
Posts: 735
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: Scrolling a map between scenarios

Post by WhiteWolf »

I'd use a well timed series of fade to blacks, fade ins, and replace maps. Something like this:

Code: Select all

#end of scenario
{FADE_TO_BLACK}
{SCROLL_TO 1 1}
[replace_map]
    map={path/to/Map_2_3.map}
    shrink=yes
    expand=yes
[/replace_map]
{FADE_IN}
#could consider a healthy amount of [delay] here, experiment with its length
{SCROLL_TO 45 1}
{FADE_TO_BLACK}
[replace_map]
    map={path/to/Map_3.map}
    shrink=yes
    expand=yes
[/replace_map]
{FADE_IN}
You'll of course need to solve units that get outside the map boundaries (IIRC by default they are put to the recall list.)
Author of the Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Standalone works: The Ravagers - now for 1.14, with new bugs!
User avatar
Helmet
Posts: 331
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: Scrolling a map between scenarios

Post by Helmet »

WhiteWolf wrote: October 30th, 2020, 9:47 pm I'd use a well timed series of fade to blacks, fade ins, and replace maps. Something like this...
Thanks, WhiteWolf. I got it to work!

I wish [replace_map] had an x,y= parameter so the map could be centered anywhere as it appeared. Oh well, no biggy.
User avatar
octalot
Developer
Posts: 534
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: Scrolling a map between scenarios

Post by octalot »

Helmet wrote: October 30th, 2020, 11:14 pm I wish [replace_map] had an x,y= parameter so the map could be centered anywhere as it appeared. Oh well, no biggy.
My first thought was "that tag does exist, it happens in LoW S04".

Sadly it's in data/campaigns/Legend_of_Wesmere/lua/wml_tags.lua, and was never ported into being a general tag. It's [replace_map_section], if anyone wants to have a go at generalizing it.
Post Reply