15. Changing the Visible Portion of the Map (Intermediate)
The visible portion of the map is what the player can see and move to. Many maps change this throughout the course of a mission, to ensure that a player completes one objective at a time. One such level is the Allied mission (Allied 5) in Europe, where you must destroy the nuclear missile silos. The mission begins with only half of itself visible and expands to include new objectives. In this tutorial we will attempt to show only the top half of a map.
Step 1: Understanding Map Dimensions
Under the Edit menu, select Map. There is one editable text box in the middle. This is the visible portion of the map, symbolized by the blue line on the IsoView. The top text box shows the actual editable dimensions of the map, symbolized by the red line in the IsoView. In order, the dimensions are:
a. Left edge of the visible map.
b. Top edge of the visible map.
c. Width of the remaining portion of the map.
d. Height of the remaining portion of the map.
e. Format: "LeftEdge,TopEdge,Width,Height"
Step 2: Set The Height, Width And Edges
In the second text box, type the following:
a. Set the left edge at 0 (closest you can get to the left side)
b. Set the top edge at 4. DO NOT set the top edge less than 4, or graphic errors will occur.
c. Look at the top text box and find the width. Set the visible width to this number as well.
d. Look at the top text box and find the height. Set the visible height to this number, divided by 2. Exact calculations of the middle are not required, you can approximate.
The left visibility border is now at the far left, the right border is at the far right, the top is as close as it can get to the top of the map, and only the top half of the map is visible.
If you would like to change the visible portion of any map to only the bottom half during gameplay:
Step 1: Create A New Trigger
This tutorial assumes that the player will use a local variable '5 ResizeMap' to trigger the map's resizing. Under the Edit menu, open the Trigger Editor. Create a new trigger with the following attributes:
a. Name: "Resize Map 1"
b. Repeating: No
c. Event: "36-Local is set", parameter "5 ResizeMap,0"
d. Action: "40 Resize visible map", parameters:
- Top = [Map height divided by 2 (middle of map)]
- Left = 0
- Right = [Map width]
- Bottom = [Map height divided by two (when added to Top is the same as the bottom half of the map)]
Original tutorial writer: Thalassicus