PDA

View Full Version : [FFC] Inventory Determines Tile Warp Destination



Wolfman2000
06-30-2010, 09:28 PM
We have a new function in ZQuest thanks to Joe123, and I wanted to try to take advantage of it. Here's a simple way of changing a tile warp based on the inventory item Link has. It's best to use this on an FFC that can blend in easily, like a floor tile.


// ChangeWarp function using SetTileWarp, first released on build 1274.
// Thanks to Plissken for assistance.
// D0 is the item Link has. Used with Link->Item[]
// D1 is the warp kind, A, B, C, D in 0-3
// D2 is the screen to warp to.
// D3 is the dmap to warp to.
// D4 is the warp type. Use the Warp Type (WT_*) constants.

import "std.zh"

ffc script ChangeWarp
{
void run(int var_item, int warp, int screen, int dmap, int type)
{
while(!Link->Item[var_item])
{
Waitframe();
}
Screen->SetTileWarp(warp, screen, dmap, type);
}
}