okay here's what the .z file looks like
CODE
import "std.zh"
const int SWORD3 = 143; //This should be set to the id of the item Link picks up.
const int SWORD3A = 144; //this should be set to the id of the sword that does damage
const int SWORD3B = 145; //and this should be set to the id of the sword that doesn't
int SaveX;
int SaveY;
bool WasOnLadder = false;
bool HookGrab(){
int HSFor;
for(HSFor = 1; HSFor <= Screen->NumLWeapons(); HSFor++){
lweapon HSCheck = Screen->LoadLWeapon(HSFor);
if(HSCheck->ID == LW_HOOKSHOT && Screen->ComboT[ComboAt (HSCheck->X, HSCheck->Y)] == CT_HSGRAB || Screen->ComboT[ComboAt (HSCheck->X+15, HSCheck->Y)] == CT_HSGRAB || Screen->ComboT[ComboAt (HSCheck->X, HSCheck->Y+15)] == CT_HSGRAB || Screen->ComboT[ComboAt (HSCheck->X+15, HSCheck->Y+15)] == CT_HSGRAB){
return(true);
}
}
return(false);
}
bool OnLadder()
{
if(Screen->ComboT[ComboAt (Link->X, Link->Y+8)] == CT_SCRIPT1 || Screen->ComboT[ComboAt (Link->X+15, Link->Y+8)] == CT_SCRIPT1 || Screen->ComboT[ComboAt (Link->X, Link->Y+15)] == CT_SCRIPT1 || Screen->ComboT[ComboAt (Link->X+15, Link->Y+15)] == CT_SCRIPT1){
return(true);
}
return(false);
}
bool OnLadderDown()
{
if(Screen->ComboT[ComboAt (Link->X, Link->Y+8)] != CT_SCRIPT1 && Screen->ComboT[ComboAt (Link->X+15, Link->Y+8)] != CT_SCRIPT1 && (Screen->ComboT[ComboAt (Link->X, Link->Y+15)] == CT_SCRIPT1 || Screen->ComboT[ComboAt (Link->X+15, Link->Y+15)] == CT_SCRIPT1)){
return(true);
}
return(false);
}
bool isLSolidHorz(int y)
{
int x;
for(x=Link->X; x<=Link->X+16; x+=8)
{
if(x==Link->X+16) x--;
if(Screen->isSolid(x, y)) return(true);
}
return(false);
}
bool isFiringHS(){
int HSFor;
for(HSFor = 1; HSFor <= Screen->NumLWeapons(); HSFor++){
lweapon HSCheck = Screen->LoadLWeapon(HSFor);
if(HSCheck->ID == LW_HOOKSHOT){
return(true);
}
}
return(false);
}
bool isJumping(){
if((GetEquipmentA() == I_ROCSFEATHER && Link->InputA == true) || (GetEquipmentB() == I_ROCSFEATHER && Link->InputB == true) || Link->Jump > 1){
return(true);
}
return(false);
}
global script Slot2{
void run(){
while(true){
if(OnLadder() == true && HookGrab() == false && isJumping() == false){
if(WasOnLadder == false){
Link->Jump = 1;
if(OnLadderDown()){
Link->Y++;
SaveY = Link->Y;
}
}
else{
Link->Jump = 0;
}
if(!isFiringHS()){
if(Link->InputUp == true && !isLSolidHorz(Link->Y+7)){
SaveY--;
}
else if(Link->InputDown == true && !isLSolidHorz(Link->Y+16)){
SaveY++;
}
if(Link->InputLeft == true && !Screen->isSolid(Link->X-1, Link->Y+8) && !Screen->isSolid(Link->X-1, Link->Y+15)){
SaveX--;
}
else if(Link->InputRight == true && !Screen->isSolid(Link->X+16, Link->Y+8) && !Screen->isSolid(Link->X+16, Link->Y+15)){
SaveX++;
}
}
Link->X = SaveX;
Link->Y = SaveY;
WasOnLadder = true;
}
else{
if(WasOnLadder == true){
Link->Jump = 0;
WasOnLadder = false;
}
SaveX = Link->X;
SaveY = Link->Y;
}
if(Link->Item[SWORD3] == true){
if(Link->MP > 0){
Link->Item[SWORD3A] = true;
Link->Item[SWORD3B] = false;
}
else{
Link->Item[SWORD3A] = false;
Link->Item[SWORD3B] = true;
}
}
}
Waitframe();
}
}
item script Roc{
void run(){
if(OnLadder() == true){
Link->Jump = 3;
}
}
}
and here is my allegro
Zelda Classic v2.50 Beta (Build 20)
Allocating quest path buffers (4.00k/4.00k)...OK
Allocating map buffer (1008.84k/1012.84k)... OK
Allocating combo buffer (5.98k/1018.82k)... OK
Allocating string buffer (680.00k/1.66M)... OK
Allocating door combo buffer (159.50k/1.81M)... OK
Allocating dmap buffer (234.00k/2.04M)... OK
Allocating combo buffer (1.62M/3.66M)... OK
Allocating color data buffer (314.11k/3.97M)... OK
Allocating tile buffer (8.50M/12.47M)... OK
Allocating trash buffer (97.66k/12.56M)... OK
Allocating item buffer (31.00k/12.59M)... OK
Allocating weapon buffer (2.50k/12.59M)... OK
Allocating guy buffer (28.00k/12.62M)... OK
Allocating combo class buffer (33.30k/12.65M)... OK
Initializing Allegro... OK
Checking Files... OK
Allocating bitmap buffers... OK
Loading data files:
Zelda.Dat...OK
Fonts.Dat...OK
SFX.Dat...OK
Initializing sound driver... OK
Used switch: -windowed
set gfx mode succsessful at -2 8bpp 640 x 480
Triplebuffer not available
Loading saved games... OK
Loading Quest...
Decrypting...okay.
Opening...okay.
Loading Quest...
Decrypting...okay.
Opening...okay.
Loading Quest...
Decrypting...okay.
Opening...okay.
Loading Quest...
Decrypting...okay.
Opening...okay.
Loading Quest...
Decrypting...okay.
Opening...okay.
Loading Quest...
Decrypting...okay.
Opening...okay.
Loading Quest...
Decrypting...okay.
Opening...okay.
I don't know but the whole program freezes
as soon as i start the game up
Edited by linktopower, 04 July 2011 - 07:12 PM.