QUOTE(Joe123 @ Jul 25 2010, 03:12 AM)
I've had issues with Link->InputStart = false; in the past actually, I think there might be some ZC-related bug. Freezing the screen isn't too hard.
Can you tell me how to do it? I have no idea where to start. And Link->InputStart=false is working just fine for me, as long as it's inside of a while(); loop.
Also, I have no idea how to make a nice opening effect with DrawTile's... >.>
One more question. If I loaded an LWeapon (like LW_BOMBS or LW_BRANG), would they act like they would if used by normal items, instead of being triggered with a button press? And would they still trigger secrets/flags?
EDIT: By the way, this is what it will look like when empty:
http://img809.images...screenzors.png/EDIT2: HEY JOE!
I've got everything done (almost) aside from scripting the items. It's a very long script though.
CODE
//EX1 is X, EX2 is Y buttons.
//constants for custom subscreen
bool hasitem[30];
item script mayhaveitem{
void run(int itemnum, int arrnum){
hasitem[arrnum]=true;
Link->Item[itemnum]=false;
}
}
bool subscreen;
const int subscreentile=28080;
const int subscreenoverlay=28340;
int tiletile;
int tiletile2;
const int blanktile=259;
const int noitem=0;
const int boomerang=1;
const int bombs=2;
const int icewand=3;
const int sbombs=5;
const int bow=4;
const int hookshot=6;
const int hammer=7;
const int arrow1=10;
const int arrow2=11;
const int arrow3=12;
const int boomerangtile=924;
const int icewandtile=490;
const int bombtile=409;
const int sbombtile=429;
const int bowtile=1152;
const int hookshottile=616;
const int hammertile=1180;
const int pointertile=25060;
const int sword1tile=12101;
const int sword2tile=12121;
const int sword3tile=12161;
const int sword4tile=10752;
int hcpiecetile;
int xassign;
int yassign;
int bassign;
int xpos;
int ypos;
int position;
int poschange;
bool xbutton;
bool ybutton;
int savelinkx;
int savelinky;
int thescreen;
//counters, etc...
if(poschange>0){
poschange--;
}
if(Link->InputEx1){
xbutton=true;
}
else xbutton=false;
if(Link->InputEx2){
ybutton=true;
}
else ybutton=false;
// Subscreen functions
//item assignment graphics
if(xassign==boomerang){
Screen->FastTile(6,176,-40,boomerangtile,6,128);
if(!subscreen && xbutton){
}
}
if(yassign==boomerang){
Screen->FastTile(6,192,-56,boomerangtile,6,128);
}
if(bassign==boomerang){
Screen->FastTile(6,208,-40,boomerangtile,6,128);
}
if(xassign==icewand){
Screen->FastTile(6,176,-40,icewandtile,7,128);
}
if(yassign==icewand){
Screen->FastTile(6,192,-56,icewandtile,7,128);
}
if(bassign==icewand){
Screen->FastTile(6,208,-40,icewandtile,7,128);
}
if(xassign==bombs){
Screen->FastTile(6,176,-40,bombtile,7,128);
if(xbutton && Game->Counter[CR_BOMBS]!=0){
Game->Counter[CR_BOMBS]--;
lweapon bomb=Screen->CreateLWeapon(LW_BOMB);
bomb->UseSprite(7);
if(Link->Dir==DIR_UP){
bomb->X=Link->X;
bomb->Y=Link->Y-16;
}
if(Link->Dir==DIR_DOWN){
bomb->X=Link->X;
bomb->Y=Link->Y+16;
}
if(Link->Dir==DIR_LEFT){
bomb->X=Link->X-16;
bomb->Y=Link->Y;
}
if(Link->Dir==DIR_RIGHT){
bomb->X=Link->X+16;
bomb->Y=Link->Y;
}
Waitframes(10);
}
}
if(yassign==bombs){
Screen->FastTile(6,192,-56,bombtile,7,128);
if(ybutton && Game->Counter[CR_BOMBS]!=0){
Game->Counter[CR_BOMBS]--;
lweapon bomb=Screen->CreateLWeapon(LW_BOMB);
bomb->UseSprite(7);
if(Link->Dir==DIR_UP){
bomb->X=Link->X;
bomb->Y=Link->Y-16;
}
if(Link->Dir==DIR_DOWN){
bomb->X=Link->X;
bomb->Y=Link->Y+16;
}
if(Link->Dir==DIR_LEFT){
bomb->X=Link->X-16;
bomb->Y=Link->Y;
}
if(Link->Dir==DIR_RIGHT){
bomb->X=Link->X+16;
bomb->Y=Link->Y;
}
Waitframes(10);
}
}
if(bassign==bombs){
Screen->FastTile(6,208,-40,bombtile,7,128);
if(Link->InputB && Game->Counter[CR_BOMBS]!=0){
Game->Counter[CR_BOMBS]--;
lweapon bomb=Screen->CreateLWeapon(LW_BOMB);
bomb->UseSprite(7);
if(Link->Dir==DIR_UP){
bomb->X=Link->X;
bomb->Y=Link->Y-16;
}
if(Link->Dir==DIR_DOWN){
bomb->X=Link->X;
bomb->Y=Link->Y+16;
}
if(Link->Dir==DIR_LEFT){
bomb->X=Link->X-16;
bomb->Y=Link->Y;
}
if(Link->Dir==DIR_RIGHT){
bomb->X=Link->X+16;
bomb->Y=Link->Y;
}
Waitframes(10);
}
if(xassign==bow){
Screen->FastTile(6,176,-40,bowtile,6,128);
}
if(yassign==bow){
Screen->FastTile(6,192,-56,bowtile,6,128);
}
if(bassign==bow){
Screen->FastTile(6,208,-40,bowtile,6,128);
}
if(xassign==sbombs){
Screen->FastTile(6,176,-40,sbombtile,8,128);
}
if(yassign==sbombs){
Screen->FastTile(6,192,-56,sbombtile,8,128);
}
if(bassign==sbombs){
Screen->FastTile(6,208,-40,sbombtile,8,128);
}
Link->InputStart=false;
if(!subscreen){
if(Link->InputR){
Link->InputRight=false;
Link->InputLeft=false;
Link->InputUp=false;
Link->InputDown=false;
Game->PlaySound(5);
subscreen=true;
savelinkx=Link->X;
savelinky=Link->Y;
Waitframes(15);
}
ffc cursor=Screen->LoadFFC(31);
cursor->Data=0;
}
if(subscreen){
if(xbutton && hasitem[position]){
if(yassign==position) yassign=noitem;
if(bassign==position) bassign=noitem;
xassign=position;
}
if(ybutton && hasitem[position]){
if(xassign==position) xassign=noitem;
if(bassign==position) bassign=noitem;
yassign=position;
}
if(Link->InputB && hasitem[position]){
if(yassign==position) yassign=noitem;
if(xassign==position) xassign=noitem;
bassign=position;
}
if(position==1){
xpos=136;
ypos=24;
if(Link->InputRight&& poschange == 0){
position=2;
poschange=10;
}
if(Link->InputLeft&& poschange == 0){
position=3;
poschange=10;
}
if(Link->InputDown&& poschange == 0){
position=4;
poschange=10;
}
if(Link->InputUp&& poschange == 0){
position=7;
poschange=10;
}
}
if(position==2){
xpos=168;
ypos=24;
if(Link->InputRight&& poschange == 0){
position=3;
poschange=10;
}
if(Link->InputLeft&& poschange == 0){
position=1;
poschange=10;
}
if(Link->InputDown&& poschange == 0){
position=5;
poschange=10;
}
if(Link->InputUp&& poschange==0){
position=8;
poschange=10;
}
}
if(position==3){
xpos=200;
ypos=24;
if(Link->InputRight&&poschange==0){
position=1;
poschange=10;
}
if(Link->InputLeft&&poschange==0){
position=2;
poschange=10;
}
if(Link->InputDown&&poschange==0){
position=6;
poschange=10;
}
if(Link->InputUp&&poschange==0){
position=9;
poschange=10;
}
}
if(position==4){
xpos=136;
ypos=56;
if(Link->InputRight&&poschange==0){
position=5;
poschange=10;
}
if(Link->InputLeft&&poschange==0){
position=6;
poschange=10;
}
if(Link->InputDown&&poschange==0){
position=7;
poschange=10;
}
if(Link->InputUp&&poschange==0){
position=1;
poschange=10;
}
}
if(position==5){
xpos=168;
ypos=56;
if(Link->InputRight&&poschange==0){
position=6;
poschange=10;
}
if(Link->InputLeft&&poschange==0){
position=4;
poschange=10;
}
if(Link->InputDown&&poschange==0){
position=8;
poschange=10;
}
if(Link->InputUp&&poschange==0){
position=2;
poschange=10;
}
}
if(position==6){
xpos=200;
ypos=56;
if(Link->InputRight&&poschange==0){
position=4;
poschange=10;
}
if(Link->InputLeft&&poschange==0){
position=5;
poschange=10;
}
if(Link->InputDown&&poschange==0){
position=9;
poschange=10;
}
if(Link->InputUp&&poschange==0){
position=3;
poschange=10;
}
}
if(position==7){
xpos=136;
ypos=88;
if(Link->InputRight&&poschange==0){
position=8;
poschange=10;
}
if(Link->InputLeft&&poschange==0){
position=9;
poschange=10;
}
if(Link->InputDown&&poschange==0){
position=1;
poschange=10;
}
if(Link->InputUp&&poschange==0){
position=4;
poschange=10;
}
}
if(position==8){
xpos=168;
ypos=88;
if(Link->InputRight&&poschange==0){
position=9;
poschange=10;
}
if(Link->InputLeft&&poschange==0){
position=7;
poschange=10;
}
if(Link->InputDown&&poschange==0){
position=2;
poschange=10;
}
if(Link->InputUp&&poschange==0){
position=5;
poschange=10;
}
}
if(position==9){
xpos=200;
ypos=88;
if(Link->InputRight&&poschange==0){
position=7;
poschange=10;
}
if(Link->InputLeft&&poschange==0){
position=8;
poschange=10;
}
if(Link->InputDown&&poschange==0){
position=3;
poschange=10;
}
if(Link->InputUp&&poschange==0){
position=6;
poschange=10;
}
}
hcpiecetile=35329+ Game->Generic[GEN_HEARTPIECES];
Link->InputStart=false;
ffc cursor=Screen->LoadFFC(31);
cursor->Data=141;
cursor->X=xpos;
cursor->Y=ypos;
Screen->DrawTile(5,0,0,subscreentile,16,11,6,-1,-1,0,0,0,0,false,128);
Screen->FastTile(6,cursor->X,cursor->Y,pointertile,11,128);
Screen->FastTile(6,64,48,hcpiecetile,8,128);
//Item placement on subscreens, depending on whether link currently has the item or not.
//also, item assigning control codes.
//non-selectables. These are NOT custom scripted.
if(Link->Item[I_SWORD1]){
Screen->FastTile(6,41,105,sword1tile,5,128);
}
if(Link->Item[I_SWORD2]){
Screen->FastTile(6,41,105,sword2tile,5,128);
}
if(Link->Item[I_SWORD3]){
Screen->FastTile(6,41,105,sword3tile,7,128);
}
if(Link->Item[I_SWORD4]){
Screen->FastTile(6,41,105,sword4tile,11,128);
}
if(Link->Item[I_SHIELD1]){
Screen->FastTile(6,57,105,343,6,128);
}
if(Link->Item[I_SHIELD2]){
Screen->FastTile(6,57,105,453,11,128);
}
if(Link->Item[I_SHIELD3]){
Screen->FastTile(6,57,105,456,8,128);
}
if(Link->Item[I_FLIPPERS]){
Screen->FastTile(6,73,105,912,7,128);
}
if(Link->Item[I_RING1]){
Screen->FastTile(6,89,105,714,7,128);
}
if(Link->Item[I_RING2]){
Screen->FastTile(6,89,105,714,8,128);
}
if(Link->Item[I_RING3]){
Screen->FastTile(6,89,105,715,10,128);
}
if(Link->Item[I_BOMBBAG1]){
Screen->FastTile(6,105,105,13340,7,128);
}
if(Link->Item[I_BOMBBAG2]){
Screen->FastTile(6,105,105,13341,7,128);
}
if(Link->Item[I_BOMBBAG3]){
Screen->FastTile(6,105,105,13342,7,128);
}
if(Link->Item[I_QUIVER1]){
Screen->FastTile(6,41,121,13440,7,128);
}
if(Link->Item[I_QUIVER2]){
Screen->FastTile(6,41,121,13441,7,128);
}
if(Link->Item[I_QUIVER3]){
Screen->FastTile(6,41,121,13442,8,128);
}
if(Link->Item[I_COMPASS]){
Screen->FastTile(6,57,121,376,7,128);
}
if(Link->Item[I_MAP]){
Screen->FastTile(6,73,121,397,6,128);
}
//Selectables. These are custom scripted.
if(hasitem[boomerang]){
Screen->FastTile(6,144,32,boomerangtile,6,128);
}
if(hasitem[icewand]){
Screen->FastTile(6,208,32,icewandtile,7,128);
}
if(hasitem[bombs]){
Screen->FastTile(6,176,32,bombtile,7,128);
}
if(hasitem[sbombs]){
Screen->FastTile(6,176,64,sbombtile,8,128);
}
if(hasitem[bow]){
Screen->FastTile(6,144,64,bowtile,6,128);
}
if(hasitem[hookshot]){
Screen->FastTile(6,144,82,hookshottile,7,128);
}
if(hasitem[hammer]){
Screen->FastTile(6,208,64,hammertile,7,128);
}