User Tag List

Results 1 to 2 of 2

Thread: Script combining

  1. #1
    Gel
    Join Date
    Dec 2012
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    455
    Level
    7
    vBActivity - Bars
    Lv. Percent
    69.76%

    Script combining

    I have attempted twice to combine the scripts that I am using for my quest. The results were the same both times. This is what I get...
    Pass 1: Parsing
    line 3: syntax error, unexpected IDENTIFIER, expecting $end, on token Import
    Fatal Error P00: Can't open or parse input file!

    This is my script file...
    Code:
    //Script File
    
    Import "std.zh"
    Import "ffcscript.zh"
    Import "string.zh"
    Import "ghost.zh"
    
    global script Slot2{
        void run(){
            while(true){
    
       if(Screen->ComboT[ComboAt(Link->X+4,Link->Y+16)]==142 && Screen->ComboT[ComboAt(Link->X+12,Link->Y+16)]==142 && Link->InputDown==true && jumping==false){
                    Link->Jump=1;
                    fallspeed=1;
                    jumping=true;
                    Game->PlaySound(SFX_JUMP);
                }
                if(Screen->ComboT[ComboAt(Link->X+4,Link->Y+16)]==142 && Screen->ComboT[ComboAt(Link->X+12,Link->Y+16)]==142 && jumping==true){
                    Link->Z=1;
                    Link->Y+=fallspeed;
                    Link->SwordJinx=2;
                    Link->ItemJinx=2;
                    if(fallspeed<4){ fallspeed+=0.1; }
                }
                if(Screen->ComboT[ComboAt(Link->X+4,Link->Y+9)]==142 && Screen->ComboT[ComboAt(Link->X+12,Link->Y+9)]==142 && jumping==false){
                    Link->Y+=fallspeed;
                }
                if(Screen->ComboT[ComboAt(Link->X+8,Link->Y+16)]!=142){
                    jumping=false;
                }
    
    
    //Call Pegasus Boots functions
                if(PegasusDash) PegasusBoots();
                //Other global script functions go here
                
                
                StoreHP = Link->HP;
    
    if(icelevel != 0){
                    for(int w = Screen->NumLWeapons(); w > 0; w--){
                        lweapon wpn = Screen->LoadLWeapon(w);
                        if(wpn->isValid()){
                            if(wpn->ID == LW_SPECIALARROW && wpn->Misc[3] == 2){
                                npc enemy;
                                if(HitEdge(wpn)) wpn->Misc[1] = 2;
                                for(int e = Screen->NumNPCs(); e > 0; e--){
                                    enemy = Screen->LoadNPC(e);
                                    if(Collision(wpn, enemy)){
                                        wpn->Misc[1] = 1;
                                        break;
                                    }
                                }
                                if(wpn->Misc[1] != 0){
                                    if(icelevel == 1){
                                        if(wpn->Misc[1] == 1) Freeze(enemy);
                                    }
                                    else if(icelevel == 2){
                                        if(wpn->Misc[1] == 1) Freeze(enemy);
                                        for(int i = 4; i < 8; i += 1){
                                            lweapon shard = CreateLWeaponAt(LW_SHARD,wpn->X,wpn->Y);
                                            shard->UseSprite(WPS_ICESHARD);
                                            shard->Dir = i;
                                            shard->Step = 300;
                                            if(shard->Dir == 4) shard->Flip = 0;
                                            else if(shard->Dir == 5) shard->Flip = 1;
                                            else if(shard->Dir == 6) shard->Flip = 2;
                                            else if(shard->Dir == 7) shard->Flip = 3;
                                            shard->Damage = wpn->Misc[0];
                                        }
                                    }
                                    wpn->DeadState = WDS_DEAD;
                                }
                                else if(wpn->Misc[2] % 4 == 0){
                                    lweapon sparkle = CreateLWeaponAt(LW_SPARKLE,wpn->X,wpn->Y);
                                    sparkle->UseSprite(WPS_ICESPARKLE);
                                }
                                wpn->Misc[2]++;
                            }
                        }
                    }
                }
    
    for(foriceone = 1; foriceone <= Screen->NumEWeapons(); foriceone++){
                eweapon tweapon = Screen->LoadEWeapon(foriceone);
                if(tweapon->Misc[4] == 42){
                    for(foricetwo = 1; foricetwo <= Screen->NumNPCs(); foricetwo++){
                        npc tnpc = Screen->LoadNPC(foricetwo);
                        if(RectCollision(tweapon->X, tweapon->Y, tweapon->X+15, tweapon->Y+15,
    
    tnpc->X+tnpc->HitXOffset, tnpc->Y+tnpc->HitYOffset, tnpc->X+tnpc->HitXOffset+tnpc->HitWidth,
    
    tnpc->Y+tnpc->HitYOffset+tnpc->HitHeight)){
                            Game->PlaySound(freezesound);
                            if(CanFreeze(tnpc) && tnpc->ID != iceblocknpc){
                                tnpc->HP -= tweapon->Misc[10];
                                if(tnpc->HP<=0){
                                    tnpc->HP=500;
                                    tnpc->Misc[12]=145;
                                }
                                else tnpc->Misc[12] = 144;
                                tnpc->Stun = Stunframes+1;
                                npc IceCol = Screen->CreateNPC(iceblocknpc);
                                    IceCol->X = tnpc->X-8;
                                    IceCol->Y = tnpc->Y-8;
                                    if(tnpc->TileHeight == 2 && tnpc->TileWidth == 2){
                                        IceCol->HitHeight = 48;
                                        IceCol->HitWidth = 48;
                                    }
                                    else{
                                        IceCol->HitHeight = 32;
                                        IceCol->HitWidth = 32;
                                    }
                            }
                            tweapon->DeadState = WDS_DEAD;
                        }
                    }
                    Freeze(tweapon);
                }
            }
            for(foricethree = 1; foricethree <= Screen->NumNPCs(); foricethree++){
                npc itnpc = Screen->LoadNPC(foricethree);
                if(itnpc->Misc[12] == 144 || itnpc->Misc[12] == 145){
                    if(itnpc->Stun > 1){
                        itnpc->CollDetection = false;
                        if(itnpc->TileWidth == 2 && itnpc->TileHeight == 2){
                            Screen->DrawTile(IceLayer(itnpc), itnpc->X-8, itnpc->Y-8, threebythreeice, 3, 3,
    
    icecset, -1, -1, 0, 0, 0, 0, true, icetransparency());
                        }
                        else{
                            Screen->DrawTile(IceLayer(itnpc), itnpc->X-8, itnpc->Y-8, twobytwoice, 2, 2, icecset,
    
    -1, -1, 0, 0, 0, 0, true, icetransparency());
                        }
                    }
                    else{
                        itnpc->CollDetection = true;
                        eweapon Melt = Screen->CreateEWeapon(EW_SCRIPT1);
                            Melt->X = itnpc->X;
                            Melt->Y = itnpc->Y;
                            Melt->DrawStyle = DS_CLOAKED;
                        for(foricefour = 1; foricefour <= Screen->NumNPCs(); foricefour++){
                            npc ibnpc = Screen->LoadNPC(foricefour);
                            if(Collision(Melt, ibnpc) && ibnpc->ID == iceblocknpc){
                                ibnpc->X = 256;
                                ibnpc->Y = 176;
                                ibnpc->HP = 0;
                            }
                        }
                        Melt->DeadState = WDS_DEAD;
                        if(itnpc->Misc[12]==145) itnpc->HP=0;
                    }
                }
                else{
                    IceTurn(itnpc);
                }
            }
    
    if(fireballdamage->isValid()) fireballdamage->DeadState = WDS_DEAD;
                for(int i = 1; i < Screen->NumLWeapons()+1; i++){
                    lweapon l = Screen->LoadLWeapon(i);
                    if(l->ID != LW_MAGIC) continue;
                    l->CollDetection = false;
                    fireballdamage = CreateLWeaponAt(LW_FIREMAGIC, l->X, l->Y);
                    fireballdamage->Damage = l->Damage;
                    fireballdamage->Dir = l->Dir;
                    fireballdamage->Tile = 4;
                    if(CanWalk(l->X, l->Y, l->Dir, l->Step/100, true)) continue;
                    int combo = NextCombo(l->X, l->Y, l->Dir, l->Step/100);
                    if(!ComboFI(combo, CF_WANDMAGIC)){
                        int CT = Screen->ComboT[combo];
                        if(CT == CT_ICEBLOCK || CT == CT_BUSHNEXT) Screen->ComboD[combo]++;
                        else if(!IsWater(combo)) l->DeadState = WDS_DEAD;
                    }
                }
    
                if(firelevel != 0){
                    for(int i = Screen->NumLWeapons(); i > 0; i--){
                        lweapon arrow = Screen->LoadLWeapon(i);
                        if(arrow->isValid()){
                            if(arrow->ID == LW_SPECIALARROW && arrow->Misc[3] == 1){
                                if(collided(arrow)){
                                    if(firelevel == 1){
                                        lweapon flame = CreateLWeaponAt(LW_FIRE,arrow->X,arrow->Y);
                                        flame->UseSprite(WPS_FIRE);
                                        flame->Damage = arrow->Misc[0];
                                        flame->Dir = 8;
                                        flame->Step = 0;
                                        arrow->DeadState = WDS_DEAD;
                                    }
                                    else{
                                        lweapon flame[8];
                                        for(int i = 0; i < 8; i++){
                                            flame[i] = CreateLWeaponAt(LW_FIRE,arrow->X,arrow->Y);
                                            flame[i]->UseSprite(WPS_FIRE);
                                            flame[i]->Damage = arrow->Misc[0];
                                            flame[i]->Dir = i;
                                            flame[i]->Angular = true;
                                            flame[i]->Angle = DegtoRad(i * 45);
                                            flame[i]->Step = 80;
                                        }
                                        arrow->DeadState = WDS_DEAD;
                                    }
                                }
                                else if(arrow->Misc[2] % 4 == 0){
                                    lweapon sparkle = CreateLWeaponAt(LW_FIRESPARKLE,arrow->X,arrow->Y);
                                    sparkle->UseSprite(WPS_FIRESPARKLE);
                                    sparkle->Damage = arrow->Misc[1];
                                }
                                arrow->Misc[2]++;
                            }
                        }
                    }
                }
                Waitframe();
            }
        }
    }
    
    void run(){
            PegasusDash = false;
            PegasusCollision = false;
    
    Import "Armos Knights (6).z"
    Import "Birds.z"
    Import "Bombos.z"
    Import "Chicken.z"
    Import "Clock.z"
    Import "Ether.z"
    Import "Fire Arrow.z"
    Import "Fire Rod.z"
    Import "Heart Piece Pick UP.z"
    Import "Ice Arrow.z"
    Import "Ice Rod.z"
    Import "Item Pick Up.z"
    Import "Lanmolas (3).z"
    Import "Light Arrow.z"
    Import "Multi Item Required.z"
    Import "Multi Shot.z"
    Import "NPC2.z"
    Import "Pegasus Boots.z"
    Import "Quake.z"
    Import "Shop All.z"
    Import "ShutterControl.z"
    Import "SignPost.z"
    Import "Stormwind.z"
    Import "Zol 3.z"
    If anyone can give me any advice on what I might be doing wrong I would greatly appreciate it. Thanks in advance for any and all assistance.

    Edit: Also would someone mind explaining how to use the code tags on this site? Please and thank you.
    Last edited by eskimojoe3500; 04-20-2013 at 11:55 AM.

  2. #2
    Username Kaiser SUCCESSOR's Avatar
    Join Date
    Jul 2000
    Location
    Winning.
    Age
    37
    Posts
    4,436
    Mentioned
    152 Post(s)
    Tagged
    7 Thread(s)
    vBActivity - Stats
    Points
    10,563
    Level
    30
    vBActivity - Bars
    Lv. Percent
    52.1%
    Why do you have a run() function outside of a script?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social