Jump to content

Photo

[FFC] Sideview door.


  • Please log in to reply
1 reply to this topic

#1 LordVolcanon

LordVolcanon

    sorry had to buddy

  • Members
  • Real Name:Zecora
  • Gender:Female
  • Location:Everfree Forest
  • Past Nicks:blackbishop89

Posted 07 July 2011 - 01:38 PM

So I decided to create a sideview door script for no apparent reason. Hopefully it will be used by someone. Here's how it works. Create 5 combos with your door graphic and set the types up like so. "None, Warp A, Warp B, Warp C, Warp D" Then go ahead and create a ffc and attach the script below. Finally set the first attribute to the tolerance and second attribute to the tile warp activated by the combo. "So if I want warp c I set it to 3, NOT C!" Now when the player is within range of the door "this range is controlled by tolerance 16 means link can be full tile away and still activate it" and presses up it will turn into a warp tile and warp link. I recommend using sensitive warps.

CODE
ffc script sideviewdoor{
    void run(int tolerance, int warp){
        for(int i = 0; i <= 4; i += 1) this->Misc[i] = this->Data + i;
        while(true){
            if(Link->X >= this->X - tolerance && Link->X <= this->X + this->EffectWidth - tolerance){
                if(Link->Y >= this->Y - tolerance && Link->Y <= this->Y + this->EffectHeight - tolerance){
                    if(Link->PressUp && this->Data == this->Misc[0]){
                        this->Data = this->Misc[warp];
                    }
                }
            }
            Waitframe();
        }
    }
}


#2 SpacemanDan

SpacemanDan

    Deified

  • Global Moderators
  • Gender:Male
  • Past Nicks:Blaman

Posted 17 January 2012 - 03:05 PM

I got it to work from the left, however I could get the door open to from the right. Is there anything in the setup that may cause this? Otherwise, my suggestion would be to change how you figure the distance out. I prefer using something like this:

CODE
Abs((Link->X + 8) - (this->X + 8))


I add 8 so that it's more centred. I also kept them in their own brackets so I would mix myself up somehow. That's my suggestion an way. icon_cat.gif


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users