Jump to content

Photo

Item -> Cutscene


  • Please log in to reply
16 replies to this topic

#1 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 21 November 2007 - 01:59 AM

Is there a script that would warp Link to another screen when an item was obtained? I'd use the Item -> String script, but string BGs can't contain transparent combos. icon_frown.gif

#2 Joe123

Joe123

    Retired

  • Members

Posted 21 November 2007 - 03:06 AM

CODE
ffc script itemwarp{
     void run(int itm, int map, int scr){
          Waitframes(5);
          if(Link->item[itm]){Link->Warp(map,scr);}
     }
}


D0 - Item ID
D1 - Dmap
D2 - Screen. Screens are counted across the top from 0 to 15, then on the next row from 16 to 31 etc.

If you want anything more specific, you'll have to be a bit more clear.
What that script does as of the moment is check once when Link first enters a screen whether he has said item (well, it waits for 5 frames first because if it doesn't you can get some interested bug). If you want any other action on it, just ask.

Edited by Joe123, 21 November 2007 - 03:06 AM.


#3 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 21 November 2007 - 10:25 PM

Okay, I put the script in, and try to "Compile ZScript" but I get an error message. How am I supposed to get the script in?

#4 Aslion

Aslion

    End Fascism

  • Members
  • Real Name:Ryan
  • Location:Plug One's spectacles

Posted 21 November 2007 - 11:34 PM

Did you type in that "import std.zh" thing? I hear that's pretty important.

#5 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 22 November 2007 - 12:12 AM

Here is a simpler version:

CODE
item script warper{
    import "std.zh"
       void run (int dmap, int scr){
          Link->Warp(dmap,scr);
             }
}


Compile this item script, and put it in the script slot in the pick up tab of the item. Then go to the augments, and make D0 the dmap Link is warped to, and D1 the screen on the dmap he is warped to. Tell me if it doesn't work.

#6 Joe123

Joe123

    Retired

  • Members

Posted 22 November 2007 - 03:12 AM

Russ? why did you put Import std.zh within the script?

And although that script will warp Link when he gets the item, it won't warp him when he gets the item, then goes to the correct room.

CODE
import "std.zh"

ffc script itemwarp{
     void run(int itm, int map, int scr){
          Waitframes(5);
          if(Link->item[itm] = true){Link->PitWarp(map,scr);}
     }
}


Try that Ebola. If it doesn't compile, can you tell me what the error message is?

Edited by Joe123, 22 November 2007 - 03:12 AM.


#7 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 22 November 2007 - 01:14 PM

QUOTE(Joe123 @ Nov 22 2007, 12:12 AM) View Post

Russ? why did you put Import std.zh within the script?

And although that script will warp Link when he gets the item, it won't warp him when he gets the item, then goes to the correct room.

CODE
import "std.zh"

ffc script itemwarp{
     void run(int itm, int map, int scr){
          Waitframes(5);
          if(Link->item[itm] = true){Link->PitWarp(map,scr);}
     }
}


Try that Ebola. If it doesn't compile, can you tell me what the error message is?


I am not very good at scripting, so that is why import std.zh is inside the script. What exactly do you mean by it won't warp him when he gets the item, then go to the correct room? And your script is a freeform combo script. Wouldn't it be easier to attach it to the pickup script of an item so it activates when he gets the item, rather then having a ffc check to see if Link has the item, then warping him?

#8 Joe123

Joe123

    Retired

  • Members

Posted 22 November 2007 - 02:51 PM

Ah, I misread what he said in the first post, you were right.
I'd personally prefer to do it with the ffc script anyway, I prefer them to item scripts, but that's up to Ebola.

#9 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 22 November 2007 - 04:29 PM

Okay, russadwan's script produced this error:
CODE
PASS 1: PARSING
PASS 2: SYNTAX ERROR, UNEXPECTED IMPORT, ON TOKEN IMPORT
FATAL ERROR P00: CAN'T OPEN OR PARSE INPUT FILE!

And Joe123's produced this error:
CODE
PASS 1: PARSING
LINE 6: SYNTAX ERROR, UNEXPECTED ITEM, EXPECTING IDENTIFIER, ON TOKEN ITEM
FATAL ERROR P00: CAN'T OPEN OR PARSE INPUT FILE!


What gives? Just to make sure I'm doing this right, here's what I did to attempt to import both scripts:
  1. I copied all text and pasted it into Notepad. I then saved it as Item Script.z.
  2. In ZQuest, I opened Tools -> Scripts -> Compile ZScript...
  3. I clicked Import and loaded the Item Script.z file.
  4. I then clicked Compile! and the error messages above were produced.


#10 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 22 November 2007 - 04:48 PM

QUOTE
import "std.zh"

item script warper{
void run (int dmap, int scr){
Link->Warp(dmap,scr);
}
}


This one should work. Follow same directions I gave before. Attach to pickup tab of item, set D0 to be the dmap, and D1 to be the screen Link is warped to.

#11 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 22 November 2007 - 06:05 PM

Alright, that works. But when I warp, it doesn't display a string... defeating the purpose of said script. Is there any way to fix this?

#12 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

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

Posted 22 November 2007 - 07:03 PM



CODE
import "std.zh"

ffc script itemwarp{
     void run(int itm, int map, int scr){
          Waitframes(5);
          if(Link->item[itm] == true){Link->PitWarp(map,scr);}
     }
}





Hhaha! well look who's the pot calling the stoner green....or something. Here we go.


And Russ, what's the point in taking out the item part? You can already instantaniously warp without a script in the beta's.


#13 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 22 November 2007 - 08:09 PM

Gleeok, your script prduces the same error message as Joe's.

#14 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 23 November 2007 - 12:52 AM

QUOTE(Ebola Zaire @ Nov 22 2007, 03:05 PM) View Post

Alright, that works. But when I warp, it doesn't display a string... defeating the purpose of said script. Is there any way to fix this?

Wait, you just want it to display a string when you pick up the item. Joe123 posted a script that does that. Here it is.
QUOTE
item script string_message{
void run(int str){
Screen->Message(str);
}
}


Just put it in the pickup tab's script slot and set D0 to be the string to display.

#15 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 23 November 2007 - 02:09 AM

No no no, I want a script that warps. But for some reason, the script on the screen I warped to doesn't display... probably something I forgot to set, or something. I'll mess with it tomorrow... er, MUCH later today, by my time.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users