Jump to content

Photo

Switch Hook


  • Please log in to reply
10 replies to this topic

#1 drakemilio

drakemilio

    Junior

  • Members

Posted 09 January 2012 - 02:09 AM

Would it be possible for anyone to make a Switch Hook item script? If you don't know what I'm talking about it was an item in Oracle of Ages that, when you shoot it and it hit a block, you would switch places with that block.

Switch Hook on Zelda Wiki

#2 drakemilio

drakemilio

    Junior

  • Members

Posted 27 January 2012 - 02:17 PM

Also, is it possible to make the combo stay wherever you move it to with the switch hook even if you leave the screen?

#3 drakemilio

drakemilio

    Junior

  • Members

Posted 15 April 2012 - 12:58 PM

Can anyone help me?

#4 tox_von

tox_von

    Zelda Addict

  • Members
  • Real Name:Redgor
  • Gender:Unspecified
  • Location:Toxicville , Simcity

Posted 15 April 2012 - 05:44 PM

this could probably be done if there is a collision event between the hook and the tile
store x,y = lnk xy
linkxy = comboxy
comboxy = store xy.

but i dont know how you can detect collisions with the hookshot.


#5 MoscowModder

MoscowModder

    Dust in the wind.

  • Script DB Staff
  • Gender:Male
  • Location:Not where you'd think

Posted 15 April 2012 - 05:52 PM

This might require a purely custom item so you don't have hookshot functionality

Suggested algorithm:
* (Possibly) re-create the hookshot chain/head by script
* If the switch hook lweapon collides with an enemy, move Link and the enemy towards each other (and disable Link's collision checking) until they reach the other's original position
* Do the same for combos with a certain flag (SCRIPT1), but change them to the undercombo and place an FFC for the moving combo, and set the combo formerly under Link to the combo you move

#6 tox_von

tox_von

    Zelda Addict

  • Members
  • Real Name:Redgor
  • Gender:Unspecified
  • Location:Toxicville , Simcity

Posted 26 April 2012 - 08:19 AM

since the hookshot cant be created i thought i might be able to make this work with the boomerang it almost works by putting link to the collision square but not the combo to where link was what did i do wrong?

CODE
import "std.zh"

ffc script new_script
{
    void run()
    {
       bool flag = false;
       while(true)
       {
        flag = false;
        int i;
        for(i=1; i<=Screen->NumLWeapons(); i++)
          {
          lweapon wpn = Screen->LoadLWeapon(i);
          if(wpn->ID==LW_BRANG && ComboAt(this->X,this->Y) == 10 && flag == false);
             {
              flag = true;
              this->Data = 100;
              ComboAt(Link->X,Link->Y) == 10;
              Link->X = this->X;
              Link->Y = this->Y;
             }
          }

        Waitframe();
       }
    }
}


#7 aaa2

aaa2

    Wizard

  • Members
  • Gender:Unspecified

Posted 26 April 2012 - 12:37 PM

ComboAt cannot be set as far as i know.
Try ComboD[number of combo under Link] and set this.
However since it is an ffc why not just change ffc position and switch it with Link's that should avoid weird behaviour at edges of a combo because of grid restrictions. Also i think it wont look nice why not move Link toward where the ffc was(by interpolation of start and endpoint using waitframes to get a nice animation)?(however i did not try the script so those are just blind suggestions)

Edited by aaa2, 26 April 2012 - 12:41 PM.


#8 Avataro

Avataro

    Questmaker

  • Members
  • Real Name:Robin
  • Gender:Male
  • Location:Germany

Posted 26 April 2012 - 01:34 PM

A switch boomerang? That does not make so much sense to me. What about a Switch Wand?

#9 ABH15

ABH15

    Recipient of Ways

  • Members
  • Real Name:Austin
  • Gender:Male
  • Location:Tennessee

Posted 26 April 2012 - 01:39 PM

If you can't replace the combo link is standing on could you maybe change it via secret combos? Assuming there are no others on the screen.

Edited by ABH15, 26 April 2012 - 01:39 PM.


#10 MoscowModder

MoscowModder

    Dust in the wind.

  • Script DB Staff
  • Gender:Male
  • Location:Not where you'd think

Posted 26 April 2012 - 01:49 PM

Using secrets is a bad idea. Instead, try transferring the source combo to an FFC, then transferring the FFC to the combo Link was standing on.

#11 tox_von

tox_von

    Zelda Addict

  • Members
  • Real Name:Redgor
  • Gender:Unspecified
  • Location:Toxicville , Simcity

Posted 04 May 2012 - 07:44 AM

http://www.mediafire...6w4l4z5bnwycm3w

this works but it doesnt switch until the hook has returned to link any ideas why?

CODE
import "std.zh"

ffc script new_script
{
    void run()
    {
       bool flag = false;
       while(true)
       {
        flag = false;
        int i;
        int storeX = 0;
        int storeY = 0;
        int storeat = 0;        
        for(i=1; i<=Screen->NumLWeapons(); i++)
          {
          lweapon wpn = Screen->LoadLWeapon(i);
          if(wpn->ID==LW_HOOKSHOT && Collision(this, wpn) && flag == false);
             {
              flag = true;
              storeat = Screen->ComboD[ComboAt(Link->X,Link->Y)];
              Screen->ComboD[ComboAt(Link->X,Link->Y)] = Screen->ComboD[ComboAt(this->X,this->Y)];
              Screen->ComboD[ComboAt(this->X,this->Y)] = storeat;
              storeX = Link->X;                      
              Link->X = this->X;
              this->X = storeX;
              storeY = Link->Y;                      
              Link->Y = this->Y;
              this->Y = storeY;              
             }
          }

        Waitframe();
       }
    }
}



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users