Jump to content

Photo

Help with Making Two Scripts Work Together


  • Please log in to reply
15 replies to this topic

#1 Korben

Korben

    Junior

  • Members
  • Location:USA

Posted 11 May 2021 - 12:34 PM

I'm trying to use the holelava script and the Moving Platform script together. In the description for the Moving Platform script it says "This version makes use of a global variable onplatform which stores the number of the FFC if Link is on a platform. Check if this variable equals zero to make it compatible with other scripts such as one of the holelava scripts". What does this mean? 

 

Also I know this doesn't have anything to do with scripting but I don't want to clutter the zquest editor help forum with posts and I already have a recent post. On NES Dungeon maps while trying to go through a northern door Link won't go through unless he is in the very center of the door, he can't be even a single pixel off. Usually if he is a little off it will just re-center him into the center of the door. I've tried it in multiple rooms on multiple maps, it is always the same. I'm using 2.55 Alpha 45. Anyone know why this is happening?



#2 Mani Kanina

Mani Kanina

    Rabbits!

  • Members

Posted 11 May 2021 - 01:54 PM

Could you point in the direction of which two scripts you're using specifically? There are multiple hole/lava combo scripts around for example, and that would make it easier to solve the problem.



#3 Korben

Korben

    Junior

  • Members
  • Location:USA

Posted 11 May 2021 - 02:42 PM

Could you point in the direction of which two scripts you're using specifically? There are multiple hole/lava combo scripts around for example, and that would make it easier to solve the problem.

Oh Sorry, I didn't know that. I don't remember where I got it from but here is the script itself 

//Pits and Lava

const int WSP_FALLING        = 100; //Weapon/Misc. sprite for Link falling down a hole
const int WSP_LAVA            = 101; //Weapon/Misc. sprite for Link drowning in lava
const int SFX_FALLING        = 38; //SFX for falling down a hole
const int SFX_LAVA            = 55; //SFX for drowning in lava
const int CMB_AUTOWARP        = 751; //Combo ID of a transparent AutoWarp A combotype

const int CT_HOLELAVA        = 11; //Combotype to give hole functionality to (default is Left Statue)

bool Falling;
ffc script HoleLava{
    void run(int lava, int warpto, int warptype, int damage){
        int graphic = WSP_FALLING; int sfx = SFX_FALLING;
        if(lava){ graphic = WSP_LAVA; sfx = SFX_LAVA; }
        if(this->X == 0 && this->Y == 0){
            Waitframes(5);
            this->X = Link->X; this->Y = Link->Y;
        }
        if(damage == 0) damage = 8;
    
        while(true){
            while(!OnPitCombo()) Waitframe();
            int pitclk = 0;
            while(OnPitCombo() && pitclk++ < 4) WaitCancelFeather();
            if(pitclk >= 5) Fall(this,sfx,graphic,damage,warpto,warptype);
        }
    }
    void Fall(ffc pos, int sfx, int graphic, int damage, int warpto, int warptype){
        Falling = true;
        Game->PlaySound(sfx);
        
        for(int i=1;i<=Screen->NumLWeapons();i++){
            lweapon l = Screen->LoadLWeapon(i);
            if(l->ID == LW_SWORD) l->DeadState = WDS_DEAD;
        }
        
        int wait = CreateGraphic(graphic);
        Link->CollDetection = false; Link->Invisible = true;
        for(int i=0;i<30;i++) WaitNoAction();
        Link->CollDetection = true; Link->Invisible = false;

        if(warpto) Warp(pos, warptype);

        Link->X = pos->X; Link->Y = pos->Y;
        Link->HP -= damage;
        Game->PlaySound(SFX_OUCH);
        Falling = false;
    }
    void Warp(ffc Warp, int warptype){
        int orig = Warp->Data;
        Warp->Data = CMB_AUTOWARP+warptype;
        Warp->Flags[FFCF_CARRYOVER] = true;
        Waitframe();
        Warp->Data = orig;
        Warp->Flags[FFCF_CARRYOVER] = false;
        Link->Z = Link->Y;
        Quit();
    }
    bool OnPitCombo(){
        return (Screen->ComboT[ComboAt(Link->X+8,Link->Y+8)] == CT_HOLELAVA && Link->Z <= 0 && Link->Action != LA_FROZEN);
    }
    int CreateGraphic(int sprite){
        lweapon l = Screen->CreateLWeapon(LW_SCRIPT1);
        l->HitXOffset = 500;
        l->UseSprite(sprite);
        l->DeadState = l->NumFrames*l->ASpeed;
        l->X = Link->X; l->Y = Link->Y;
        return l->DeadState;
    }
    void WaitCancelFeather(){
        if(GetEquipmentA() == I_ROCSFEATHER && Link->InputA) Link->InputA = false;
        if(GetEquipmentB() == I_ROCSFEATHER && Link->InputB) Link->InputB = false;
        Waitframe();
    }
}

And then the moving platform script is just the moving platform script in the database by Mero.



#4 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 11 May 2021 - 08:47 PM

I'm trying to use the holelava script and the Moving Platform script together. In the description for the Moving Platform script it says "This version makes use of a global variable onplatform which stores the number of the FFC if Link is on a platform. Check if this variable equals zero to make it compatible with other scripts such as one of the holelava scripts". What does this mean?

It means it's a poorly thought out script that expects the user to know how to script themselves in order to use basic functionality. What I'd recommend is using my pit script instead of the old Mero version. It respects FFC collision automatically instead of referencing a global variable. The platform script should be compatible with it, though if it isn't I can write you a better one.

Also I know this doesn't have anything to do with scripting but I don't want to clutter the zquest editor help forum with posts and I already have a recent post. On NES Dungeon maps while trying to go through a northern door Link won't go through unless he is in the very center of the door, he can't be even a single pixel off. Usually if he is a little off it will just re-center him into the center of the door. I've tried it in multiple rooms on multiple maps, it is always the same. I'm using 2.55 Alpha 45. Anyone know why this is happening?

For this issue, are you using New Link Movement? I know that's been known to have issues, and I wonder if it's interacting poorly with NES dungeon doors. I haven't had issues entering doors on previous versions. You may be able to fix this by enabling Freeform Dungeons as well though, as having that off enforces pretty strict restrictions on edge of screen collisions in dungeons.

Edited by Moosh, 11 May 2021 - 08:54 PM.

  • Twilight Knight likes this

#5 Korben

Korben

    Junior

  • Members
  • Location:USA

Posted 11 May 2021 - 10:28 PM

It means it's a poorly thought out script that expects the user to know how to script themselves in order to use basic functionality. What I'd recommend is using my pit script instead of the old Mero version. It respects FFC collision automatically instead of referencing a global variable. The platform script should be compatible with it, though if it isn't I can write you a better one.

For this issue, are you using New Link Movement? I know that's been known to have issues, and I wonder if it's interacting poorly with NES dungeon doors. I haven't had issues entering doors on previous versions. You may be able to fix this by enabling Freeform Dungeons as well though, as having that off enforces pretty strict restrictions on edge of screen collisions in dungeons.

 

Ah, okay. Thanks, I'll switch to using your script. As for the doorway problem, I have the movement set as "original", or is the New Link Movement thing something separate? Either way turning on freeform dungeons fixed the door problem, thanks! I'll just have to manually put in the layers for above doorways.



#6 Valerie

Valerie

    Illustrious

  • Members
  • Real Name:Valerie
  • Location:K-Town

Posted 12 May 2021 - 12:56 PM

I'll just have to manually put in the layers for above doorways.


I think you could just make the combos "overhead" combos.

#7 Korben

Korben

    Junior

  • Members
  • Location:USA

Posted 12 May 2021 - 01:02 PM

I think you could just make the combos "overhead" combos.

Oh wow, thanks! You saved me a lot of time.


  • Valerie likes this

#8 Korben

Korben

    Junior

  • Members
  • Location:USA

Posted 12 May 2021 - 03:09 PM

What I'd recommend is using my pit script instead of the old Mero version. 

 

Okay, everything is working fine including the moving platform script. The only problem is when Link falls in a pit and reappears where he entered the screen, the tile underneath him turns into combo 1 in cset 0 until he steps off of it.



#9 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 12 May 2021 - 07:30 PM

Okay, everything is working fine including the moving platform script. The only problem is when Link falls in a pit and reappears where he entered the screen, the tile underneath him turns into combo 1 in cset 0 until he steps off of it.

That's defined in ffcscript.zh, FFCS_INVISIBLE_COMBO. Most tilesets have invisible combos at the start, but a couple don't and either the constant or the tileset need to be updated to match.



#10 Korben

Korben

    Junior

  • Members
  • Location:USA

Posted 12 May 2021 - 07:48 PM

That's defined in ffcscript.zh, FFCS_INVISIBLE_COMBO. Most tilesets have invisible combos at the start, but a couple don't and either the constant or the tileset need to be updated to match.

Got it! Thanks. 


Edited by Korben, 12 May 2021 - 09:24 PM.


#11 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 13 May 2021 - 06:19 PM

Ah, okay. Thanks, I'll switch to using your script. As for the doorway problem, I have the movement set as "original", or is the New Link Movement thing something separate? Either way turning on freeform dungeons fixed the door problem, thanks! I'll just have to manually put in the layers for above doorways.

New Link Movement is a quest rule; in 2.55, "Quest>>Options>>Hero>>New Hero Movement". But, I know for a fact I specifically tested dungeon doors with new hero movement, and had no issues...



#12 Korben

Korben

    Junior

  • Members
  • Location:USA

Posted 14 May 2021 - 12:12 AM

New Link Movement is a quest rule; in 2.55, "Quest>>Options>>Hero>>New Hero Movement". But, I know for a fact I specifically tested dungeon doors with new hero movement, and had no issues...

I'm using 2.55 Alpha 45, Build: 48 . I don't see "options" under "quest". Maybe I'm using an older version of 2.55?



#13 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 15 May 2021 - 10:35 AM

Oh, that build is from 2019. You *really* need to update. Current alpha is *92*, https://www.zeldacla....com/downloads/



#14 Korben

Korben

    Junior

  • Members
  • Location:USA

Posted 15 May 2021 - 11:00 AM

Oh, that build is from 2019. You *really* need to update. Current alpha is *92*, https://www.zeldacla....com/downloads/

Thanks, I'll do it now.



#15 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 16 May 2021 - 07:17 AM

 

I'm trying to use the holelava script and the Moving Platform script together. In the description for the Moving Platform script it says "This version makes use of a global variable onplatform which stores the number of the FFC if Link is on a platform. Check if this variable equals zero to make it compatible with other scripts such as one of the holelava scripts". What does this mean? 

 

Also I know this doesn't have anything to do with scripting but I don't want to clutter the zquest editor help forum with posts and I already have a recent post. On NES Dungeon maps while trying to go through a northern door Link won't go through unless he is in the very center of the door, he can't be even a single pixel off. Usually if he is a little off it will just re-center him into the center of the door. I've tried it in multiple rooms on multiple maps, it is always the same. I'm using 2.55 Alpha 45. Anyone know why this is happening?

 

 

 

2.55 has native combo types for holes pits, and lava. You are nearly 50 versions out of date: I strongly advise updating to the current alphas, as not only are you missing out on features, but you are inviting possible bugs that have been resolved to creep into your game.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users