Jump to content

Photo

script that warps you to another place if you have a specific item.


  • Please log in to reply
15 replies to this topic

#1 Lemmy Koopa

Lemmy Koopa

    We are the champions

  • Members
  • Location:Ohio

Posted 28 May 2007 - 02:34 PM

Can anyone give me an example of like a script that checks if you have like... Level 1 sword, and if you do, it'll warp you to another screen or set up tiles used for warping the player?

#2 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 12 September 2007 - 12:54 AM

I'll do one better than what you asked. This one lets you do anything from warp to open up a path, or whatever you can think of using secret combos. icon_wink.gif

CODE

import "std.zh"

//========================================================
// FFC SCRIPT TRIGGER SECRETS (no pun intended) hah;)
// D0 - Item neccesary. Check std.zh for values
// Gleeok was here-
//========================================================
ffc script trigger_secrets{
    
    void run(int have_item){

        if (Link->Item[have_item] == true && Screen->NumNPCs() >= 1){
                        npc enemy_trig = Screen->LoadNPC(1);
            enemy_trig->HP = 0;
            
        }
    }
}


How it works;
Set screen enemy one to trigger enemy.
Set enemies->secrets and secret combos 16-32.
Set D0 to the item link must have.
If link has the item he we trigger screen secrets.

...Let me know how it works out.

Edited by Gleeok, 12 September 2007 - 12:55 AM.


#3 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 12 September 2007 - 10:02 PM

Nice. Can you set D0 to a specific level's triforce, or even set multiple items?



#4 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 12 September 2007 - 11:33 PM

QUOTE(Gleeok @ Sep 11 2007, 11:54 PM) View Post

Trifoce I believe is item 44. Just check std.zh for the complete list.


-If you want to use three items(pendants right?) then use this version.
CODE

import "std.zh"

//========================================================
// FFC SCRIPT TRIGGER SECRETS (no pun intended) hah;)
// D0 - D2;  Items neccesary. Check std.zh for values
// Gleeok was here-
//========================================================
ffc script trig_secret2{
    
    void run(int have_item, int have_item2, int have_item3){

                 if ((Link->Item[have_item] == true) &&
        (Link->Item[have_item2] == true) &&
        (Link->Item[have_item3] == true) && Screen->NumNPCs() >= 1){
            npc enemy_trig = Screen->LoadNPC(1);
            enemy_trig->HP = 0;
            
        }
    }
}




Let me know how it works.

#5 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 13 September 2007 - 07:09 PM

Alright, I replaced "D0 - D2" with "5 - 6 - 7" for the three swords and saved it as a .txt file. I then tried to import the script, but recieved the following message:
CODE
Unable to parse instruction 1 from script Multiple Ite (that's the file name)
The error was: Invalid instruction.
The command was ("std.zh") (,)


#6 Majora

Majora

    Unironic Marxist-Leninist

  • Members

Posted 13 September 2007 - 07:24 PM

is there an "import std.zh" in the script?

#7 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 13 September 2007 - 07:53 PM

QUOTE(Majora @ Sep 13 2007, 07:24 PM) View Post
is there an "import std.zh" in the script?
Yeah, it's
CODE
import "std.zh"


#8 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 14 September 2007 - 12:09 AM

I just imported it and it compiled fine...

Do you have an import "std.zh" already in you notepad? If so leave the second one out.

Also don't change anything in the script; D0 is in Zquest under FFC->Arguments page. You should only have to change the ffc combo and script number.

It should work. Leme know if not and i'll stick it in a while loop or something, although that shouldn't matter.

#9 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 14 September 2007 - 03:44 PM

This time, I directly copied from the text to Notepad... still got the same error message. Just to make sure I'm doing it correctly... I go Tools -> Scripts -> Import ASM FFC Script, right?


#10 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 14 September 2007 - 08:31 PM

I wouldn't know, I don't know how to script ASM. icon_wink.gif It should be the last option on the list though.

This one will allow carry-over ffc as well, though i'm not sure why.....anyway.

CODE

import "std.zh"

//========================================================
// FFC SCRIPT TRIGGER SECRETS (no pun intended) hah;)
// D0 - D2;  Items neccesary. Check std.zh for values
//========================================================
ffc script trig_secret2{
    
    void run(int have_item, int have_item2, int have_item3){

                  while(true) {

                 if ( (Link->Item[have_item] == true) && (Link->Item[have_item2] == true) &&
                            (Link->Item[have_item3] == true) && (Screen->NumNPCs() >= 1) ) {
                          npc enemy_trig = Screen->LoadNPC(1);
                          enemy_trig->HP = 0;
                          Waitframe()
                    }
             }
      }
}




EDIT: THIS THREAD WAS JUST EDITED. just making sure you know it changed.

Edited by Gleeok, 14 September 2007 - 08:35 PM.


#11 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 14 September 2007 - 08:36 PM

Okay, I'm a total n00b at ZScript. icon_blah.gif Can you explain how I would get this script into my quest, or simply link me to a thread that could do the same?

#12 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 14 September 2007 - 08:51 PM

http://zctut.com/script1.php


That's a good one. Enjoy.

#13 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 14 September 2007 - 09:17 PM

I imported the script just fine, set the screen rule "Enemies -> Secrets", set secret combo 0, set the flag down, set up the FFC arguments, and nothing happens. I'm truly at a loss.

#14 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 14 September 2007 - 10:23 PM

Hmmm...Yeah, I'm looking into it.

#15 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 14 September 2007 - 11:54 PM

OK, here was the problem;

The ffc somehow doesn't want to work in the first one.(there's no good reason except it ends before the enemy spawning begins)

There was the equivelent of a typo in the last one, meaning it would freeze ZC.(fixed)

Here is the tested and fixed version, it works fine. It will instantly kill any enemies on screen, triggering enemies->secrets, if you have the items in D0-D2. Have fun!
CODE

import "std.zh"

//========================================================
// FFC SCRIPT TRIGGER SECRETS (no pun intended) hah;)
// D0 - D2;  Items neccesary. Check std.zh for values
//========================================================
ffc script trig_secret2{
    
    void run(int have_item, int have_item2, int have_item3){

                  while(true) {

                 if ( (Link->Item[have_item] == true) && (Link->Item[have_item2] == true) &&
                            (Link->Item[have_item3] == true) && (Screen->NumNPCs() >= 1) ) {
                          npc enemy_trig = Screen->LoadNPC(1);
                          enemy_trig->HP = 0;
                    }  // end if
            Waitframe();
             }  //end loop
      } // end void
} //end scr



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users