Jump to content

"Warp Map" Screen with Selectable Destination

Overview
Creator: eNJuR Updated: 06 Jul 2022 Tags: 2.55, FFC Downloads: 27
Rating[?]: Rating: 4.5/5 (3 ratings)
View Script Download Example
(3.08 MB)
Information

Description Setup Reviews Comments

To use this as a warp-whistle map, change the destinations of all slots of the whistle item's selected warp ring to target the screen you've set up as a warp map.
On to the script set-up (requires std.zh):

Warp Map screen uses Screen->D[0] to trigger the warp when the player presses A, B, or start.
Warp_Map_Set_Valid uses Screen->D[0] so that it only runs on the first visit to the screen (with an optional delay on setting D0 = 1 so that other events that use D0 to indicate first time visiting the screen have a chance to run).

Change the text's color and background in the following lines: (0x2A means 10th (hex Ath) color of CSet 2 for example)
const int WARP_MAP_LABEL_BG = 0x0F;
const int WARP_MAP_LABEL_TEXT = 0x01;

For combos you will need: A combo for the Whirlwind decoration, A 2x2 combo for the Selector (set x/y skip to 1 and in the FFC editor set width and height to 2), and combos for the location icons as follows:
Location icon combos may be re-used or you may use unique ones for as many of the locations as you want, but the FFC should be set to use the combo for an inactive location, and the next combo in the list should be for an active location. CSets of the combos are instead set in the script with the constants WARP_MAP_SKIP_CSET and WARP_MAP_VALID_CSET. These two must be different, but you can have the icons use the same CSet by using the "CSet 2" function of the combo edior (for example, having "skip-cset" set to 7 and then using CSet 2 with a value of 1 a full blue square to have the combo appear as if it is CSet 8 ).
On the warp map, I recommend having a full-solid screen, setting layer 3 to istelf and/or making Link invisible in screen data. The second row, second column combo should be a "Sensitive Warp A". Select a tile warp method (new in 2.55: can select a custom sound to use when warping in the combo editor), but the destination chosen in the tile warp editor will only ever be used if Link somehow finds himself on the screen without unlocking any warp points, which you should try to not let happen.

I suggest setting the wind FFC as the lowest number, and the selector as the next, followed by the location FFCs. But please note that the Location FFCs must be consecutive (i.e. all in order with no FFCs inbetween that are not a Location FFC). The order the player will cycle through will be +1 if pressing down or right and -1 if pressing up or left (rolling over when at the last, of course)

Variables:

Warp_Map_Wind: (place one FFC with this script on the warp screen)
d0 = # of the FFC with the selector script
d1 = speed to move at (defaults to 2)

Warp_Map_Selector: (place one FFC with this script on the warp screen)
d0 = # of the first (and defaultly selected) of the Location FFCs
d1 = total number of Location FFCs
d2 = validity flag (0~32). If 0, skips checking if the first location is valid. Elsewise goes to location numbered in d3 if that flag is off
d3 = # of the Location FFC of the back-up defaultly-selected location
d4 = sound to play when moving (defaults to 5)

Warp_Map_Location: (place as many FFCs with this script on the warp screen as you like, but they must be in continuous numbered slots)
d0 = validity flag (0~32). 0 means the location is always available; elsewise, the location is only warp-to-able if the index's nth digit in binary of from the right is 1 (see "Warp_Map_Set_Valid")
d1 = string # for location label. Should be <= 32 characters long
d2 = # of the FFC with the selector script
d3 = this location's destination dmap
d4 = this location's destination screen (note that screen numbers in-editor are hexadecimal numbers)

Warp_Map_Set_Valid: (when the player first visits a screen that has an FFC with this script, it will modify which locations will be valid next time the warp screen is used)
d0 = validity flag (1~32)
d1 = leave as 0 to add location to list of valid locations. 1 will remove location, 2 will toggle location, and -1 will make only that location valid (though locations with a flag number of 0 will still be available. Also, if using this, you should set this location as the back-up default in the selector's variables)
d2 = delay before setting the screen's d0. -1 means it doesn't set (and unless something else does, it will run every time you visit the screen)

Warp_Map_Set_Valid_I: acts as the above, but as an item script (and no d2)
One final note: the validity flag can be at most 32 (17 in 2.53 or below), but there are no limits to amount of locations that share the same flag (including flag = 0). If you have very many warp destinations, I suggest creating multiple warp screens and duplicating the script, replacing Warp_Map_Index in the copy with a new variable.

 

Getting to work in earlier versions:

change #include to import, delete the block comment (/**...*/), change the "long" identifier in the top variables list to "int", comment out all @author lines, change all "1Lb"s to "1"s, and change:

switch(op){
case 1 : Warp_Map_Index ~= 1Lb<<(flagNum-1); break;
case 2 : Warp_Map_Index ^= 1Lb<<(flagNum-1); break;
case -1 : Warp_Map_Index = 1Lb<<(flagNum-1); break;
default : Warp_Map_Index |= 1Lb<<(flagNum-1);
}

to

if(op==1) Warp_Map_Index &= ~(1<<(flagNum-1));
else if(op==2) Warp_Map_Index ^= 1<<(flagNum-1);
else if(op==-1) Warp_Map_Index = 1<<(flagNum-1);
else Warp_Map_Index |= 1<<(flagNum-1);


Doing the above, it can compile in 2.53, though I haven't extensively tested this version of the script in such.