This comes from my attempt to reproduce the "level-1-locked-door-opens" bug in the original NES LoZ. What's supposed to happen is, after entering level 1 and then exiting, the first locked door should become a passage, without using a key.
So I wrote a script (in build 357) to try this out. Here it is, sort of:
import "std.zh"bool bug_active = false;
// this ffc to be placed on screen 37 of the overworld
ffc script eagle_bug_ext{
void run()
{
if(bug_active)
{
// remove the door
Game->SetMapFlag(dmap1, screen73, MF_DOORUP, false);
Waitframe();
// add it back
Game->SetMapFlag(dmap1, screen73, MF_DOORUP, true);
Quit();
}
else
{
Waitframe();
}
}
}
// this ffc to be placed on screen 73 of level 1
ffc script eagle_bug_int{
void run()
{
bug_active = true;
Quit();
}
}
Well, I tried many different calls of Game->SetMapFlag(), and I could not get it to compile. I see in the documentation that the function takes three arguments: int dmap, int flag, bool value. So, if I try to compile code with
Game->SetMapFlag(1, MF_DOORUP, false); in it, I get a T21 error: TMP, LINE 11: ERROR T21: COULD NOT MATCH TYPE SIGNATURE SETMAPFLAG(GAME, FLOAT, FLOAT, BOOL).So, why does it put GAME as the first parameter of SetMapFlag()? And why does it expect floats? (Or is this irrelevant)
Also, from a limitation point of view: Is this even what I want? Is there any way to set what doors there are in dungeons? SetMapFlag() doesn't even accept screen as a parameter, so what exactly are the MF_DOOR... constants for? Are the "map" flags actually dmap flags?
😕
Much confusion abounds.