HylianGlaceon
01-18-2011, 06:15 PM
Trying to combine a few scripts, but it won't compile and isn't making sense..
The script is here: http://www.purezc.com/forums/index.php?showtopic=38916
error is: "LINE 289: SYNTAX ERROR, UNEXPECTED RBRACE, EXPECTING $END, ON TOKEN }"
Removing or adding a } doesn't do anything.
The line it's complaining about is the } between the dash check and global slot 3.
//Check whether Link can dash onto a combo
int DashCheck(int x, int y, bool xy){
int xoffset; int yoffset;
bool Solid;
if(xy) xoffset = 4;
else yoffset = 3;
if(Screen->isSolid(x-xoffset,y-yoffset) || Screen->isSolid(x+xoffset,y+yoffset)) Solid = true;
if(!Solid && !ComboFI(x-xoffset,y-yoffset,CF_DASH)
&& !ComboFI(x+xoffset,y+yoffset,CF_DASH)) return 0;
else if(Solid && (ComboFI(x-xoffset,y-yoffset,CF_DASH)
|| ComboFI(x+xoffset,y+yoffset,CF_DASH))) return 1;
else return 2;
}
}
global script Slot_3{
void run(){
UseBChu = 0;
I also have Bombchu and Bomb Arrow scripts mixed in there.
This is a bigger part of my script below, couldn't fit all of it.
//Pegasus Boots
void PegasusBoots(){
if(!PegasusCollision){
int loc = ComboAt(Link->X+8,Link->Y+8);
//Check if Link should be dashing
if(((StoreInput == 1 && !Link->InputA)
|| (StoreInput == 2 && !Link->InputB))
|| StoreHP < Link->HP
|| Screen->ComboT[loc] == CT_WATER){
PegasusDash = false;
DashCounter = 0;
}
//Stop all actions
NoAction();
//Movement
if(DashCounter > 10){
if(Link->Dir == 0 && DashCheck(Link->X+8,Link->Y+6,true) != 2){
Link->Y--;
Link->InputUp = true;
}else if(Link->Dir == 1 && DashCheck(Link->X+8,Link->Y+18,true) != 2){
Link->Y++;
Link->InputDown = true;
}else if(Link->Dir == 2 && DashCheck(Link->X,Link->Y+12,false) != 2){
Link->X--;
Link->InputLeft = true;
}else if(Link->Dir == 3 && DashCheck(Link->X+16,Link->Y+12,false) != 2){
Link->X++;
Link->InputRight = true;
}else{
PegasusCollision = true;
DashCounter = 0;
}
}
//Break Pegasus Blocks
if(ComboFI(Link->X+8,Link->Y+8,CF_DASH) && Screen->ComboS[loc] == 1111b){
Screen->ComboD[loc]++;
if(Screen->ComboF[loc] == CF_DASH) Screen->ComboF[loc] = 0;
Game->PlaySound(SFX_PEGASUSBREAK);
}
//Dust tile animation
lweapon Dust;
if(DashCounter%4 == 0){
for(int j=1;j<=Screen->NumLWeapons();j++){
Dust = Screen->LoadLWeapon(j);
if(Dust->ID != LW_SCRIPT10) continue;
if(Link->Dir < 1) Dust->Y-=3;
else if(Link->Dir < 2) Dust->Y+=3;
else if(Link->Dir < 3) Dust->X-=3;
else if(Link->Dir < 4) Dust->X+=3;
}
Dust = Screen->CreateLWeapon(LW_SCRIPT10);
Dust->OriginalTile = T_DUST;
Dust->CSet = DustCSet;
Dust->Y = Link->Y;
Dust->X = Link->X;
Dust->NumFrames = DustAFrames;
Dust->ASpeed = DustASpeed;
Dust->DeadState = DustAFrames*DustASpeed;
}
//Play SFX
if(DashCounter%DashSFXLength == 0) Game->PlaySound(SFX_DASH);
}else{
//Bounceback after hitting a wall
NoAction();
if(DashCounter == 1){
Screen->ClearSprites(SL_LWPNS);
Game->PlaySound(SFX_HITWALL);
Screen->Quake = 10;
}else if(DashCounter == 10){
PegasusDash = false;
PegasusCollision = false;
DashCounter = 0;
}
if(Link->Dir == 0 && DashCheck(Link->X+8,Link->Y+6,true) == 0) Link->Y++;
else if(Link->Dir == 1 && DashCheck(Link->X+8,Link->Y+18,true) == 0) Link->Y--;
else if(Link->Dir == 2 && DashCheck(Link->X+18,Link->Y+8,false) == 0) Link->X++;
else if(Link->Dir == 3 && DashCheck(Link->X-2,Link->Y+8,false) == 0) Link->X--;
if(DashCounter < 5) Link->Z++;
}
DashCounter++;
}
//Check whether Link can dash onto a combo
int DashCheck(int x, int y, bool xy){
int xoffset; int yoffset;
bool Solid;
if(xy) xoffset = 4;
else yoffset = 3;
if(Screen->isSolid(x-xoffset,y-yoffset) || Screen->isSolid(x+xoffset,y+yoffset)) Solid = true;
if(!Solid && !ComboFI(x-xoffset,y-yoffset,CF_DASH)
&& !ComboFI(x+xoffset,y+yoffset,CF_DASH)) return 0;
else if(Solid && (ComboFI(x-xoffset,y-yoffset,CF_DASH)
|| ComboFI(x+xoffset,y+yoffset,CF_DASH))) return 1;
else return 2;
}
}
global script Slot_3{
void run(){
UseBChu = 0;
PegasusDash = false;
PegasusCollision = false;
}
}
item script Bombchu{
void run(){
if(Game->Counter[CR_SCRIPT1] > 0) UseBChu++;
}
}
item script BombArrows{
void run(){
if(Game->Counter[CR_BOMBS] > 0 && Game->Counter[CR_ARROWS] > 0 && UseBombArrow == 0){
UseBombArrow++;
Game->Counter[CR_BOMBS]--;
Game->Counter[CR_ARROWS]--;
}
}
item script PegasusBoots{
void run(){
if(Screen->ComboT[ComboAt(Link->X+8,Link->Y+8)] == CT_WATER
|| ComboFI(Link->X+8,Link->Y+8,CF_DASH)) Quit();
PegasusDash = true;
if(Link->InputB && !Link->InputA) StoreInput = 2;
else if(Link->InputA && !Link->InputB) StoreInput = 1;
}
}
}
The script is here: http://www.purezc.com/forums/index.php?showtopic=38916
error is: "LINE 289: SYNTAX ERROR, UNEXPECTED RBRACE, EXPECTING $END, ON TOKEN }"
Removing or adding a } doesn't do anything.
The line it's complaining about is the } between the dash check and global slot 3.
//Check whether Link can dash onto a combo
int DashCheck(int x, int y, bool xy){
int xoffset; int yoffset;
bool Solid;
if(xy) xoffset = 4;
else yoffset = 3;
if(Screen->isSolid(x-xoffset,y-yoffset) || Screen->isSolid(x+xoffset,y+yoffset)) Solid = true;
if(!Solid && !ComboFI(x-xoffset,y-yoffset,CF_DASH)
&& !ComboFI(x+xoffset,y+yoffset,CF_DASH)) return 0;
else if(Solid && (ComboFI(x-xoffset,y-yoffset,CF_DASH)
|| ComboFI(x+xoffset,y+yoffset,CF_DASH))) return 1;
else return 2;
}
}
global script Slot_3{
void run(){
UseBChu = 0;
I also have Bombchu and Bomb Arrow scripts mixed in there.
This is a bigger part of my script below, couldn't fit all of it.
//Pegasus Boots
void PegasusBoots(){
if(!PegasusCollision){
int loc = ComboAt(Link->X+8,Link->Y+8);
//Check if Link should be dashing
if(((StoreInput == 1 && !Link->InputA)
|| (StoreInput == 2 && !Link->InputB))
|| StoreHP < Link->HP
|| Screen->ComboT[loc] == CT_WATER){
PegasusDash = false;
DashCounter = 0;
}
//Stop all actions
NoAction();
//Movement
if(DashCounter > 10){
if(Link->Dir == 0 && DashCheck(Link->X+8,Link->Y+6,true) != 2){
Link->Y--;
Link->InputUp = true;
}else if(Link->Dir == 1 && DashCheck(Link->X+8,Link->Y+18,true) != 2){
Link->Y++;
Link->InputDown = true;
}else if(Link->Dir == 2 && DashCheck(Link->X,Link->Y+12,false) != 2){
Link->X--;
Link->InputLeft = true;
}else if(Link->Dir == 3 && DashCheck(Link->X+16,Link->Y+12,false) != 2){
Link->X++;
Link->InputRight = true;
}else{
PegasusCollision = true;
DashCounter = 0;
}
}
//Break Pegasus Blocks
if(ComboFI(Link->X+8,Link->Y+8,CF_DASH) && Screen->ComboS[loc] == 1111b){
Screen->ComboD[loc]++;
if(Screen->ComboF[loc] == CF_DASH) Screen->ComboF[loc] = 0;
Game->PlaySound(SFX_PEGASUSBREAK);
}
//Dust tile animation
lweapon Dust;
if(DashCounter%4 == 0){
for(int j=1;j<=Screen->NumLWeapons();j++){
Dust = Screen->LoadLWeapon(j);
if(Dust->ID != LW_SCRIPT10) continue;
if(Link->Dir < 1) Dust->Y-=3;
else if(Link->Dir < 2) Dust->Y+=3;
else if(Link->Dir < 3) Dust->X-=3;
else if(Link->Dir < 4) Dust->X+=3;
}
Dust = Screen->CreateLWeapon(LW_SCRIPT10);
Dust->OriginalTile = T_DUST;
Dust->CSet = DustCSet;
Dust->Y = Link->Y;
Dust->X = Link->X;
Dust->NumFrames = DustAFrames;
Dust->ASpeed = DustASpeed;
Dust->DeadState = DustAFrames*DustASpeed;
}
//Play SFX
if(DashCounter%DashSFXLength == 0) Game->PlaySound(SFX_DASH);
}else{
//Bounceback after hitting a wall
NoAction();
if(DashCounter == 1){
Screen->ClearSprites(SL_LWPNS);
Game->PlaySound(SFX_HITWALL);
Screen->Quake = 10;
}else if(DashCounter == 10){
PegasusDash = false;
PegasusCollision = false;
DashCounter = 0;
}
if(Link->Dir == 0 && DashCheck(Link->X+8,Link->Y+6,true) == 0) Link->Y++;
else if(Link->Dir == 1 && DashCheck(Link->X+8,Link->Y+18,true) == 0) Link->Y--;
else if(Link->Dir == 2 && DashCheck(Link->X+18,Link->Y+8,false) == 0) Link->X++;
else if(Link->Dir == 3 && DashCheck(Link->X-2,Link->Y+8,false) == 0) Link->X--;
if(DashCounter < 5) Link->Z++;
}
DashCounter++;
}
//Check whether Link can dash onto a combo
int DashCheck(int x, int y, bool xy){
int xoffset; int yoffset;
bool Solid;
if(xy) xoffset = 4;
else yoffset = 3;
if(Screen->isSolid(x-xoffset,y-yoffset) || Screen->isSolid(x+xoffset,y+yoffset)) Solid = true;
if(!Solid && !ComboFI(x-xoffset,y-yoffset,CF_DASH)
&& !ComboFI(x+xoffset,y+yoffset,CF_DASH)) return 0;
else if(Solid && (ComboFI(x-xoffset,y-yoffset,CF_DASH)
|| ComboFI(x+xoffset,y+yoffset,CF_DASH))) return 1;
else return 2;
}
}
global script Slot_3{
void run(){
UseBChu = 0;
PegasusDash = false;
PegasusCollision = false;
}
}
item script Bombchu{
void run(){
if(Game->Counter[CR_SCRIPT1] > 0) UseBChu++;
}
}
item script BombArrows{
void run(){
if(Game->Counter[CR_BOMBS] > 0 && Game->Counter[CR_ARROWS] > 0 && UseBombArrow == 0){
UseBombArrow++;
Game->Counter[CR_BOMBS]--;
Game->Counter[CR_ARROWS]--;
}
}
item script PegasusBoots{
void run(){
if(Screen->ComboT[ComboAt(Link->X+8,Link->Y+8)] == CT_WATER
|| ComboFI(Link->X+8,Link->Y+8,CF_DASH)) Quit();
PegasusDash = true;
if(Link->InputB && !Link->InputA) StoreInput = 2;
else if(Link->InputA && !Link->InputB) StoreInput = 1;
}
}
}