Jump to content

Photo

Party members script


  • Please log in to reply
40 replies to this topic

#16 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 01 December 2012 - 01:46 PM

The script compiles for me, so the problem must be with your combining.

It sounds like you tried to take the code snippet that creates the party members and put it outside of the global script - it's supposed to go inside the void run() part (so inside the "{ }" after the words "void run()" but above the "while(true)" line.

#17 Frocks7Snee

Frocks7Snee

    Illustrious

  • Members

Posted 01 December 2012 - 01:58 PM

Can I put the bombchu globals into the PArtymembers.z? It would be a bit easier. When I combine the globals, it compiles just fine. But when I go ingame to test it, the bombchu script isn't working and neither is the partymembers.

Edited by c00ln3rd, 01 December 2012 - 02:11 PM.


#18 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 01 December 2012 - 02:07 PM

Yes, as long as you insert said code snippet from the partymembers global script into the right part of the bombchus global script.

#19 Frocks7Snee

Frocks7Snee

    Illustrious

  • Members

Posted 01 December 2012 - 02:27 PM

I tried putting in just the party members script to see if it could work; it didn't work. I picked up the item that had the ID for spawining a party member in the script, I entered the correct combo with the party member facing up standing, and it didn't work. I'm not sure what I'm doing wrong... icon_frown.gif I got the bombchu script to work perfectly alone, but combined with the party members, it breaks. It all compiles just fine, though. I'll send you the script with all of the things I entered in... It's just the party members script with the bombchu globals combined.
CODE

  //NPC Follower script by Joe123
//Modified for party members by MM

import "std.zh"
import "ffcscript.zh"

//Graphics: Up, Down, Left, Right for each row
//Row 1: Standing
//Row 2: Walking
//Row 3: Floating
//Row 4: Swimming
//Row 5: Jumping (NOT YET IMPLEMENTED)

const int FFCS_PARTYMEMBER    = 1; //10

const int M_NORMAL            = 0;
const int M_MOVINGTOPOS       = 1;
const int M_SOLIDATPOS        = 2;

const int I_MEMBER1           = 211; //Kobe2
const int I_MEMBER2           = 212; //Madi2
const int I_MEMBER3           = 213; //Julia2

const int CMB_MEMBER1         = 1708; //First of 20 combos for party member #1 (standing,

facing up)
const int CMB_MEMBER2         = 20; //Ditto #2
const int CMB_MEMBER3         = 40; //Ditto #3

const int FFC_MEMBER1         = 30; //FFC taken by member #1
const int FFC_MEMBER2         = 31; //FFC taken by member #2
const int FFC_MEMBER3         = 32; //FFC taken by member #3


global script active{
    void run(){
        //Initialize party members
        if ( Link->Item[I_MEMBER1] ){
            ffc member = Screen->LoadFFC(FFC_MEMBER1);
            member->X = Link->X;
            member->Y = Link->Y;
            member->Data = CMB_MEMBER1;
            member->Script = FFCS_PARTYMEMBER;
            member->Flags[FFCF_CARRYOVER] = true;
            member->InitD[0] = 1;
        }
        if ( Link->Item[I_MEMBER2] ){
            ffc member = Screen->LoadFFC(FFC_MEMBER2);
            member->X = Link->X;
            member->Y = Link->Y;
            member->Data = CMB_MEMBER2;
            member->Script = FFCS_PARTYMEMBER;
            member->Flags[FFCF_CARRYOVER] = true;
            member->InitD[0] = 2;
        }
        if ( Link->Item[I_MEMBER3] ){
            ffc member = Screen->LoadFFC(FFC_MEMBER3);
            member->X = Link->X;
            member->Y = Link->Y;
            member->Data = CMB_MEMBER3;
            member->Script = FFCS_PARTYMEMBER;
            member->Flags[FFCF_CARRYOVER] = true;
            member->InitD[0] = 3;

    int bombchutile = 21780; // 21780;
    int bombchuframes = 2; // 2;
    int bombchuaspeed = 5;// 5;
    int bombchucset = 8; // 8;
    
    int bombchudmg = 3;  // 3;
    int bombchuspeed = 100; // 100;

    int HP;
    int bdir;
    int bombchux; int bombchuy;
    lweapon explosion;
        }

    }
}

ffc script FollowLink{
    void run(int num){
        int orig = this->Data;
        int lastDir;
        int MovementState;
        int CurrentScreen;
        int idle;
        while(true){
            int x = Link->X; int y = Link->Y;
            if(Link->Dir == DIR_UP||Link->Dir == DIR_DOWN) y -= Link->Dir*(16+16*num)-16;
            else x -= (Link->Dir-2)*(16+16*num)-16;
            
            if(CurrentScreen != Game->GetCurScreen()) MovementState = NormalPlacement

(this,x,y);
            if(MovementState == M_NORMAL){
                if(lastDir != Link->Dir) MovementState = MoveToPosition(this,x,y);
                else MovementState = NormalPlacement(this,x,y);
            }else if(MovementState == M_MOVINGTOPOS) MovementState = WhileMoving

(this,x,y,idle);
            else if(MovementState == M_SOLIDATPOS) MovementState = CheckPos(this,x,y);
            
            SetGraphics(this,orig);
            CurrentScreen = Game->GetCurScreen();
            idle = (idle+1)%6;
            lastDir = Link->Dir;
        Waitframe();
        }
    }
    int NormalPlacement(ffc this,int x,int y){
        if(Solid(this,x,y)) return M_SOLIDATPOS;
        this->X = x; this->Y = y;
        return M_NORMAL;
    }
    int MoveToPosition(ffc this,int x,int y){
        if(Solid(this,x,y)) return M_SOLIDATPOS;
        int speed = Distance(x,y,this->X,this->Y)/8;
        if(speed < 0.5) return M_NORMAL;
        else if(speed < 1.2) speed *= 2;
        FFCToPoint(this,x,y,speed);
        return M_MOVINGTOPOS;
    }
    int WhileMoving(ffc this,int x,int y,int idle){        
        if(Abs(this->X-x) < 3 && Abs(this->Y-y) < 3){
            this->Vx = 0; this->Vy = 0;
            return M_NORMAL;
        }
        
        if(idle == 0) return MoveToPosition(this,x,y);
        return M_MOVINGTOPOS;
    }
    int CheckPos(ffc this,int x,int y){
        if(Solid(this,x,y)) return M_SOLIDATPOS;
        return MoveToPosition(this,x,y);
    }
    bool Solid(ffc this,int x,int y){
        if( Screen->isSolid(x+8,y+8) && !IsWater(ComboAt(x+8, y+8)) ){ //Modification: Not

consered solid if water
            this->Vx = 0; this->Vy = 0;
            return true;
        }
    }
    void SetGraphics(ffc this,int orig){
        int moving;
        int combo = ComboAt(CenterX(this), CenterY(this));
        
        //Find the appropriate sprite row
        if ( this->Misc[0] > 0 ) //In air
            moving = 1724;
        else if ( IsWater(combo) && isMoving(this) ) //Swimming
            moving = 1720;
        else if ( IsWater(combo) ) //Floating
            moving = 1716;
        else if(isMoving(this)) //Walking
            moving = 1712;
            
        this->Data = orig+moving+Link->Dir;
    }
    int FFCToPoint(ffc f,int x,int y,int speed){
        if(speed == 0) return -1;
        int dx = x-f->X; int dy = y-f->Y;
        int dis = Abs(dx) + Abs(dy);
        int d = dis/speed;
        f->Vx = dx/d; f->Vy = dy/d;
        return d;
    }
    bool isMoving(ffc this){
        return (Link->InputUp || Link->InputDown || Link->InputLeft || Link->InputRight
          || this->Vx != 0 || this->Vy != 0);
    }
}


//D0: Number of party members needed (not counting Link)
ffc script partySecret{
    void run ( int count ){
        if ( Screen->State[ST_SECRET] )
            return;
        
        while ( CountFFCsRunning(FFCS_PARTYMEMBER) < count )
            Waitframe();
            
        Screen->State[ST_SECRET] = true;
        Screen->TriggerSecrets();
    }
}


Now here's the Bombchu script with the partymembers globals in them.

CODE


import "std.zh"

const int bombchuflag = 98; //Flag the bombchu can pass through (even if solid)

bool bombchuattack;
bool isSolid(int x,int y){
if(x<0 || x>255 || y<0 || y>175) return false;
int mask=1111b;
if(x%16<8) mask&=0011b;
else mask&=1100b;
if(y%16<8) mask&=0101b;
else mask&=1010b;
return (!(Screen->ComboS[ComboAt(x,y)]&mask)==0);
}

bool bombchucheck(int x, int y){
    if((isSolid(x,y) && Screen->ComboF[ComboAt(x,y)] != bombchuflag && Screen->ComboI

[ComboAt(x,y)] != bombchuflag)
     || (Screen->ComboF[ComboAt(x,y)] == 6 || Screen->ComboI[ComboAt(x,y)] == 6 ||Screen-

>ComboF[ComboAt(x,y)] == 11 || Screen->ComboI[ComboAt(x,y)] == 11)) return true;
}

void noaction(){
    Link->InputR = false;
    Link->InputL = false;
    Link->InputA = false;
    Link->InputB = false;
    Link->InputUp = false;
    Link->InputDown = false;
    Link->InputRight = false;
    Link->InputLeft = false;
}
global script slot_2{
    void run(){
    int bombchutile = 21780; // 21780;
    int bombchuframes = 2; // 2;
    int bombchuaspeed = 5;// 5;
    int bombchucset = 8; // 8;
    
    int bombchudmg = 3;  // 3;
    int bombchuspeed = 100; // 100;

    int HP;
    int bdir;
    int bombchux; int bombchuy;
    lweapon explosion;

//Initialize party members
        if ( Link->Item[I_MEMBER1] ){
            ffc member = Screen->LoadFFC(FFC_MEMBER1);
            member->X = Link->X;
            member->Y = Link->Y;
            member->Data = CMB_MEMBER1;
            member->Script = FFCS_PARTYMEMBER;
            member->Flags[FFCF_CARRYOVER] = true;
            member->InitD[0] = 1;
        }
        if ( Link->Item[I_MEMBER2] ){
            ffc member = Screen->LoadFFC(FFC_MEMBER2);
            member->X = Link->X;
            member->Y = Link->Y;
            member->Data = CMB_MEMBER2;
            member->Script = FFCS_PARTYMEMBER;
            member->Flags[FFCF_CARRYOVER] = true;
            member->InitD[0] = 2;
        }
        if ( Link->Item[I_MEMBER3] ){
            ffc member = Screen->LoadFFC(FFC_MEMBER3);
            member->X = Link->X;
            member->Y = Link->Y;
            member->Data = CMB_MEMBER3;
            member->Script = FFCS_PARTYMEMBER;
            member->Flags[FFCF_CARRYOVER] = true;
            member->InitD[0] = 3;
        }
    
    }
}


        while(true){
            if(bombchuattack){
                if(Link->X > 15 && Link->X < 241 && Link->Y > 15 && Link->Y < 153){
                lweapon bombchu = Screen->CreateLWeapon(31);
                    bdir = Link->Dir;
                    bombchu->OriginalTile = bombchutile+(bdir*bombchuframes);
                    bombchu->Tile = bombchutile+(bdir*bombchuframes);
                    bombchu->NumFrames = bombchuframes;
                    bombchu->ASpeed = bombchuaspeed;
                    bombchu->CSet = bombchucset;
                    bombchux = 0; bombchuy = 0;
                    if(bdir>1) bombchux = (((bdir-2)*2)-1)*16;
                    if(bdir<2) bombchuy = ((bdir*2)-1)*16;
                    bombchu->X = Link->X+bombchux;
                    bombchu->Y = Link->Y+bombchuy;
                    bombchu->Step = bombchuspeed;
                    Link->Action = LA_ATTACKING;
                    Game->Counter[6]--;
                    Waitframe();

                    while(bombchu->isValid()){
                        HP = Link->HP;
                        if(Link->InputUp) bdir = 0;
                        if(Link->InputDown) bdir = 1;
                        if(Link->InputLeft) bdir = 2;
                        if(Link->InputRight) bdir = 3;
                        if(bdir == 0 && bombchucheck(bombchu->X+8,bombchu->Y+4)
                        || (bdir == 1 && bombchucheck(bombchu->X+8,bombchu->Y+12))
                        || (bdir == 2 && bombchucheck(bombchu->X+4,bombchu->Y+8))
                        || (bdir == 3 && bombchucheck(bombchu->X+12,bombchu->Y+8)))

bombchu->DeadState = 0;
                        bombchu->Dir = bdir;
                        bombchu->Tile = bombchutile+(bdir*bombchuframes);
                        bombchu->OriginalTile = bombchutile+(bdir*bombchuframes);
                    bombchux = bombchu->X;
                    bombchuy = bombchu->Y;
                    noaction();
                    Waitframe();
                    if(Link->HP < HP) bombchu->DeadState = 0;
                    }
                
                    explosion = Screen->CreateLWeapon(LW_SBOMB);
                    explosion->Damage = bombchudmg;
                    explosion->X = bombchux;
                    explosion->Y = bombchuy;
                }else{
                    bdir = Link->Dir;
                    bombchux = 0; bombchuy = 0;
                    if(bdir>1) bombchux = (((bdir-2)*2)-1)*16;
                    if(bdir<2) bombchuy = ((bdir*2)-1)*16;
                    explosion = Screen->CreateLWeapon(LW_SBOMB);
                    explosion->X = Link->X+bombchux;
                    explosion->Y = Link->Y+bombchuy;
                    explosion->Damage = bombchudmg;
                }
            Link->Action = 0;
            bombchuattack = false;
            }
        Waitframe();
        }
    }
}

global script slot_3{
    void run(){
        bombchuattack = false;
    }
}

item script bombchu{
    void run(){
        if(Game->Counter[6] > 0) bombchuattack = true;
    }
}


Party members script alone:

CODE

//NPC Follower script by Joe123
//Modified for party members by MM

import "std.zh"
import "ffcscript.zh"

//Graphics: Up, Down, Left, Right for each row
//Row 1: Standing
//Row 2: Walking
//Row 3: Floating
//Row 4: Swimming
//Row 5: Jumping (NOT YET IMPLEMENTED)

const int FFCS_PARTYMEMBER    = 1; //10

const int M_NORMAL            = 0;
const int M_MOVINGTOPOS       = 1;
const int M_SOLIDATPOS        = 2;

const int I_MEMBER1           = 211; //Item spawning first party member
const int I_MEMBER2           = 212; //Item spawning second party member
const int I_MEMBER3           = 213; //Item spawning third party member

const int CMB_MEMBER1         = 1708; //First of 20 combos for party member #1 (standing,

facing up)
const int CMB_MEMBER2         = 20; //Ditto #2
const int CMB_MEMBER3         = 40; //Ditto #3

const int FFC_MEMBER1         = 30; //FFC taken by member #1
const int FFC_MEMBER2         = 31; //FFC taken by member #2
const int FFC_MEMBER3         = 32; //FFC taken by member #3


global script active{
    void run(){
        //Initialize party members
        if ( Link->Item[I_MEMBER1] ){
            ffc member = Screen->LoadFFC(FFC_MEMBER1);
            member->X = Link->X;
            member->Y = Link->Y;
            member->Data = CMB_MEMBER1;
            member->Script = FFCS_PARTYMEMBER;
            member->Flags[FFCF_CARRYOVER] = true;
            member->InitD[0] = 1;
        }
        if ( Link->Item[I_MEMBER2] ){
            ffc member = Screen->LoadFFC(FFC_MEMBER2);
            member->X = Link->X;
            member->Y = Link->Y;
            member->Data = CMB_MEMBER2;
            member->Script = FFCS_PARTYMEMBER;
            member->Flags[FFCF_CARRYOVER] = true;
            member->InitD[0] = 2;
        }
        if ( Link->Item[I_MEMBER3] ){
            ffc member = Screen->LoadFFC(FFC_MEMBER3);
            member->X = Link->X;
            member->Y = Link->Y;
            member->Data = CMB_MEMBER3;
            member->Script = FFCS_PARTYMEMBER;
            member->Flags[FFCF_CARRYOVER] = true;
            member->InitD[0] = 3;
        }
        
    }
}


ffc script FollowLink{
    void run(int num){
        int orig = this->Data;
        int lastDir;
        int MovementState;
        int CurrentScreen;
        int idle;
        while(true){
            int x = Link->X; int y = Link->Y;
            if(Link->Dir == DIR_UP||Link->Dir == DIR_DOWN) y -= Link->Dir*(16+16*num)-16;
            else x -= (Link->Dir-2)*(16+16*num)-16;
            
            if(CurrentScreen != Game->GetCurScreen()) MovementState = NormalPlacement

(this,x,y);
            if(MovementState == M_NORMAL){
                if(lastDir != Link->Dir) MovementState = MoveToPosition(this,x,y);
                else MovementState = NormalPlacement(this,x,y);
            }else if(MovementState == M_MOVINGTOPOS) MovementState = WhileMoving

(this,x,y,idle);
            else if(MovementState == M_SOLIDATPOS) MovementState = CheckPos(this,x,y);
            
            SetGraphics(this,orig);
            CurrentScreen = Game->GetCurScreen();
            idle = (idle+1)%6;
            lastDir = Link->Dir;
        Waitframe();
        }
    }
    int NormalPlacement(ffc this,int x,int y){
        if(Solid(this,x,y)) return M_SOLIDATPOS;
        this->X = x; this->Y = y;
        return M_NORMAL;
    }
    int MoveToPosition(ffc this,int x,int y){
        if(Solid(this,x,y)) return M_SOLIDATPOS;
        int speed = Distance(x,y,this->X,this->Y)/8;
        if(speed < 0.5) return M_NORMAL;
        else if(speed < 1.2) speed *= 2;
        FFCToPoint(this,x,y,speed);
        return M_MOVINGTOPOS;
    }
    int WhileMoving(ffc this,int x,int y,int idle){        
        if(Abs(this->X-x) < 3 && Abs(this->Y-y) < 3){
            this->Vx = 0; this->Vy = 0;
            return M_NORMAL;
        }
        
        if(idle == 0) return MoveToPosition(this,x,y);
        return M_MOVINGTOPOS;
    }
    int CheckPos(ffc this,int x,int y){
        if(Solid(this,x,y)) return M_SOLIDATPOS;
        return MoveToPosition(this,x,y);
    }
    bool Solid(ffc this,int x,int y){
        if( Screen->isSolid(x+8,y+8) && !IsWater(ComboAt(x+8, y+8)) ){ //Modification: Not

consered solid if water
            this->Vx = 0; this->Vy = 0;
            return true;
        }
    }
    void SetGraphics(ffc this,int orig){
        int moving;
        int combo = ComboAt(CenterX(this), CenterY(this));
        
        //Find the appropriate sprite row
        if ( this->Misc[0] > 0 ) //In air
            moving = 16;
        else if ( IsWater(combo) && isMoving(this) ) //Swimming
            moving = 12;
        else if ( IsWater(combo) ) //Floating
            moving = 8;
        else if(isMoving(this)) //Walking
            moving = 4;
            
        this->Data = orig+moving+Link->Dir;
    }
    int FFCToPoint(ffc f,int x,int y,int speed){
        if(speed == 0) return -1;
        int dx = x-f->X; int dy = y-f->Y;
        int dis = Abs(dx) + Abs(dy);
        int d = dis/speed;
        f->Vx = dx/d; f->Vy = dy/d;
        return d;
    }
    bool isMoving(ffc this){
        return (Link->InputUp || Link->InputDown || Link->InputLeft || Link->InputRight
          || this->Vx != 0 || this->Vy != 0);
    }
}


//D0: Number of party members needed (not counting Link)
ffc script partySecret{
    void run ( int count ){
        if ( Screen->State[ST_SECRET] )
            return;
        
        while ( CountFFCsRunning(FFCS_PARTYMEMBER) < count )
            Waitframe();
            
        Screen->State[ST_SECRET] = true;
        Screen->TriggerSecrets();
    }
}


Bombchu script alone:

CODE

import "std.zh"

const int bombchuflag = 98; //Flag the bombchu can pass through (even if solid)

bool bombchuattack;
bool isSolid(int x,int y){
if(x<0 || x>255 || y<0 || y>175) return false;
int mask=1111b;
if(x%16<8) mask&=0011b;
else mask&=1100b;
if(y%16<8) mask&=0101b;
else mask&=1010b;
return (!(Screen->ComboS[ComboAt(x,y)]&mask)==0);
}

bool bombchucheck(int x, int y){
    if((isSolid(x,y) && Screen->ComboF[ComboAt(x,y)] != bombchuflag && Screen->ComboI

[ComboAt(x,y)] != bombchuflag)
     || (Screen->ComboF[ComboAt(x,y)] == 6 || Screen->ComboI[ComboAt(x,y)] == 6 ||Screen-

>ComboF[ComboAt(x,y)] == 11 || Screen->ComboI[ComboAt(x,y)] == 11)) return true;
}

void noaction(){
    Link->InputR = false;
    Link->InputL = false;
    Link->InputA = false;
    Link->InputB = false;
    Link->InputUp = false;
    Link->InputDown = false;
    Link->InputRight = false;
    Link->InputLeft = false;
}
global script slot_2{
    void run(){
    int bombchutile = 21780; // 21780;
    int bombchuframes = 2; // 2;
    int bombchuaspeed = 5;// 5;
    int bombchucset = 8; // 8;
    
    int bombchudmg = 3;  // 3;
    int bombchuspeed = 100; // 100;

    int HP;
    int bdir;
    int bombchux; int bombchuy;
    lweapon explosion;

        while(true){
            if(bombchuattack){
                if(Link->X > 15 && Link->X < 241 && Link->Y > 15 && Link->Y < 153){
                lweapon bombchu = Screen->CreateLWeapon(31);
                    bdir = Link->Dir;
                    bombchu->OriginalTile = bombchutile+(bdir*bombchuframes);
                    bombchu->Tile = bombchutile+(bdir*bombchuframes);
                    bombchu->NumFrames = bombchuframes;
                    bombchu->ASpeed = bombchuaspeed;
                    bombchu->CSet = bombchucset;
                    bombchux = 0; bombchuy = 0;
                    if(bdir>1) bombchux = (((bdir-2)*2)-1)*16;
                    if(bdir<2) bombchuy = ((bdir*2)-1)*16;
                    bombchu->X = Link->X+bombchux;
                    bombchu->Y = Link->Y+bombchuy;
                    bombchu->Step = bombchuspeed;
                    Link->Action = LA_ATTACKING;
                    Game->Counter[6]--;
                    Waitframe();

                    while(bombchu->isValid()){
                        HP = Link->HP;
                        if(Link->InputUp) bdir = 0;
                        if(Link->InputDown) bdir = 1;
                        if(Link->InputLeft) bdir = 2;
                        if(Link->InputRight) bdir = 3;
                        if(bdir == 0 && bombchucheck(bombchu->X+8,bombchu->Y+4)
                        || (bdir == 1 && bombchucheck(bombchu->X+8,bombchu->Y+12))
                        || (bdir == 2 && bombchucheck(bombchu->X+4,bombchu->Y+8))
                        || (bdir == 3 && bombchucheck(bombchu->X+12,bombchu->Y+8)))

bombchu->DeadState = 0;
                        bombchu->Dir = bdir;
                        bombchu->Tile = bombchutile+(bdir*bombchuframes);
                        bombchu->OriginalTile = bombchutile+(bdir*bombchuframes);
                    bombchux = bombchu->X;
                    bombchuy = bombchu->Y;
                    noaction();
                    Waitframe();
                    if(Link->HP < HP) bombchu->DeadState = 0;
                    }
                
                    explosion = Screen->CreateLWeapon(LW_SBOMB);
                    explosion->Damage = bombchudmg;
                    explosion->X = bombchux;
                    explosion->Y = bombchuy;
                }else{
                    bdir = Link->Dir;
                    bombchux = 0; bombchuy = 0;
                    if(bdir>1) bombchux = (((bdir-2)*2)-1)*16;
                    if(bdir<2) bombchuy = ((bdir*2)-1)*16;
                    explosion = Screen->CreateLWeapon(LW_SBOMB);
                    explosion->X = Link->X+bombchux;
                    explosion->Y = Link->Y+bombchuy;
                    explosion->Damage = bombchudmg;
                }
            Link->Action = 0;
            bombchuattack = false;
            }
        Waitframe();
        }
    }
}

global script slot_3{
    void run(){
        bombchuattack = false;
    }
}

item script bombchu{
    void run(){
        if(Game->Counter[6] > 0) bombchuattack = true;
    }
}


Please tell me if there's anything wrong with it. I absolutely NEED the party members script for my quest and I really want the bombchus...

#20 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 01 December 2012 - 02:50 PM

Pro tip: Put large blocks of code in


Note: Your bombchu script is an older one that's rather obsolete - I tidied it up a little bit, but there's also a newer, easier-to-use version by BlackBishop out there.

Note #2: I made an item script that you need to attach to the party member items - set the items' D0 values to the party member's number (1-3).

#21 Frocks7Snee

Frocks7Snee

    Illustrious

  • Members

Posted 01 December 2012 - 03:39 PM

Bombchus work fine, but when I pick up the party member 1 item, the party member appears on screen but they're on pallette 0 and they don't follow link. They spawn ontop of where the item was, and they stay on the same spot on every screen. o-o I set the D0s pickup and action scripts on the items, And it won't work...
I did the same with the other party member items, but it does the XACT same thing. Am I doing something wrong? I'm probably just an idiot... xD Also, farore's wind seems to get rid of the party members. xD Better not put that in my quest! lol

Edited by c00ln3rd, 01 December 2012 - 03:44 PM.


#22 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 01 December 2012 - 03:45 PM

Colors: Add this block under the CMB_MEMBER# section:
CODE
const int CSET_MEMBER1        = 7;  //CSets of the party members
const int CSET_MEMBER2        = 7;
const int CSET_MEMBER3        = 7;


And add this line under every instance of "member->Data = MEMBER#", changing the 1 to a 2 or 3 for the second and third members:
CODE
member->CSet = CSET_MEMBER1;



No movement: make sure "FFCS_PARTYMEMBER" is set to the FFC script slot with the party member script (probably 2 in your case; you can see it when compiling and assigning scripts to slots).

#23 Frocks7Snee

Frocks7Snee

    Illustrious

  • Members

Posted 01 December 2012 - 03:56 PM

Thanks! It works perfectly now. icon_smile.gif But when link walks up or left, all 3 party members bunch up. lol

#24 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 01 December 2012 - 04:07 PM

Well, here's something you can try.

Replace this part of the followLink script:
CODE
            int x = Link->X; int y = Link->Y;
            if(Link->Dir == DIR_UP||Link->Dir == DIR_DOWN) y -= Link->Dir*(16+16*num)-16;
            else x -= (Link->Dir-2)*(16+16*num)-16;


With this:
CODE
int x = Link->X + inFrontX(Link->Dir, -2 - (num*16));
            int y = Link->Y + inFrontY(Link->Dir, -2 - (num*16));


#25 Frocks7Snee

Frocks7Snee

    Illustrious

  • Members

Posted 01 December 2012 - 04:14 PM

Pass 3: Building symbol tables
TMP, line 175: Error S10: Function InfrontX is undeclared.
TMP, line 176: Error S10: Function InfrontY is undeclared.

#26 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 01 December 2012 - 04:27 PM

ARGH.

Capitalize the "inFrontX/Y" to "InFrontX/Y".

#27 Frocks7Snee

Frocks7Snee

    Illustrious

  • Members

Posted 01 December 2012 - 04:31 PM

Erm... Now the party members go infront of link. xD


#28 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 01 December 2012 - 04:38 PM

WHAT. I specifically set a negative distance in front of Link.

No matter.

Change those lines to this:
CODE
int x = Link->X + InFrontX(reverseDir(Link->Dir), (num*16));
int y = Link->Y + InFrontY(reverseDir(Link->Dir), (num*16));


And throw this function in at the bottom of your file:
CODE
//Returns the opposite of a direction
int reverseDir(int dir){
    if ( dir == DIR_UP ) return DIR_DOWN;
    if ( dir == DIR_DOWN ) return DIR_UP;
    if ( dir == DIR_LEFT ) return DIR_RIGHT;
    if ( dir == DIR_RIGHT ) return DIR_LEFT;
    if ( dir == DIR_LEFTUP ) return DIR_RIGHTDOWN;
    if ( dir == DIR_RIGHTUP ) return DIR_LEFTDOWN;
    if ( dir == DIR_LEFTDOWN ) return DIR_RIGHTUP;
    if ( dir == DIR_RIGHTDOWN ) return DIR_LEFTUP;
    return -1;
}


#29 Frocks7Snee

Frocks7Snee

    Illustrious

  • Members

Posted 01 December 2012 - 04:46 PM

GAH.

Line 301: Syntax error, unexpected Lparen, expecting Assign, on token (



#30 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 01 December 2012 - 04:51 PM

I don't know exactly what your merged script looks like now. Can you please show me your line 301?


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users