Jump to content

Photo
* * * * * 3 votes

Item Pick Up Message

Item

  • Please log in to reply
24 replies to this topic

#1 SpacemanDan

SpacemanDan

    Hrm

  • Global Moderators
  • Real Name:Daniel
  • Gender:Male
  • Location:Canada
  • Past Nicks:Blaman

Posted 24 January 2012 - 07:39 PM

Item Pick Up Message

By Joe123


Description

When the player picks up an item with this script in its pick up slot, it will display a string.

Screenshots and Demo

N/A

Code

item script Message{
	void run(int m){
		Screen->Message(m);
	}
}

Setup

Set this script in the Pickup Slot of any item you wish to have a message show up when the player picks it up.

D0 is the string number to display when the player picks up the item.

Resources

No additional resources are required for this script.

#2 Jared

Jared

    The hero rises again.

  • Members
  • Real Name:Link
  • Gender:Male
  • Location:Massachusetts
  • Past Nicks:Lynker

Posted 20 February 2012 - 08:43 PM

Used this in every quest before the one I'm on now, and still works great. Very small, too.
I recommend it if you want your quest to, y'know, be descriptive and more modern Zelda-like.

#3 KyleZCPure

KyleZCPure

    Newbie

  • Members

Posted 25 February 2012 - 06:27 PM

Can someone give me a template on what the code would look like for item script?

#4 Jared

Jared

    The hero rises again.

  • Members
  • Real Name:Link
  • Gender:Male
  • Location:Massachusetts
  • Past Nicks:Lynker

Posted 25 February 2012 - 06:37 PM

What are you talking about? You just make a string, put the number of the string in D0 and put the Script in pickup, and it shows up in the game.

#5 KyleZCPure

KyleZCPure

    Newbie

  • Members

Posted 25 February 2012 - 08:03 PM

Honestly speaking, I'm new to Zelda Classic Script Programing, though I do have the message part. What do I enter in the script?

#6 MoscowModder

MoscowModder

    Dust in the wind.

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

Posted 25 February 2012 - 08:54 PM

Don't enter it in the script. After you compile the script and enter it in the item script slot, go to the item editor, set the pickup script to this item pickup message script, and then set the item's D0 variable to the number of the script.

#7 ShadowTiger

ShadowTiger

    Shine

  • Global Moderators
  • Gender:Unspecified

Posted 26 February 2012 - 06:47 AM

QUOTE
item script Message
. .{
. void run(int m)
. .{
. .Screen->Message(m);
. .}
}



The part in red symbolizes the functionality of "D0" that people are referring to in the item's variable slots. In the "void run" area, it's declaring the variable as an integer for later use in the script to accept a number that will end up as an integer, rather than something more complex like a decimal-based value. Then when Screen->Message(m) pops up, there's "m" right there, corresponding to the item's script D0 entry.

It's "Screen->Message" not because it's tied to the item, but because Screen->Message is the operator (Or whatever you wish to call it) that wants to play a message on the screen. Every string/message has a number. It's matching the number of the string to the number it will happen to find in the number that's also in the script D0 slot in the item.

#8 Jared

Jared

    The hero rises again.

  • Members
  • Real Name:Link
  • Gender:Male
  • Location:Massachusetts
  • Past Nicks:Lynker

Posted 08 September 2012 - 09:28 PM

I need some help with this.This script works perfectly, except for one spot. I've had this problem before.

IPB Image

I tried placing it on the end of a counter thing, but when I make Link talk to the guy (Or the FFC, if you wanna get technical), it won't work. I am assured the script is set up perfectly. Any idea why this is happening? icon_frown.gif

#9 MoscowModder

MoscowModder

    Dust in the wind.

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

Posted 08 September 2012 - 11:10 PM

What exactly are you trying to do?

#10 Jared

Jared

    The hero rises again.

  • Members
  • Real Name:Link
  • Gender:Male
  • Location:Massachusetts
  • Past Nicks:Lynker

Posted 09 September 2012 - 11:49 AM

Just use the script like it should be used.

#11 MoscowModder

MoscowModder

    Dust in the wind.

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

Posted 09 September 2012 - 04:32 PM

You mean, just placing an item on the ground, picking it up, and having the string play as you pick it up?

#12 Jared

Jared

    The hero rises again.

  • Members
  • Real Name:Link
  • Gender:Male
  • Location:Massachusetts
  • Past Nicks:Lynker

Posted 09 September 2012 - 06:14 PM

I'm SO sorry, ignore ALL of this. I posted in the wrong thread. -__-
(Thank you SUCCESSOR, for helping my realize that)

#13 Anthus

Anthus

    "So Where Were the Spiders?"

  • Members
  • Real Name:Alex
  • Gender:Male
  • Location:Columbus, OH.
  • Past Nicks:Tobias Daboi, Rex Zemenheart

Posted 15 February 2013 - 01:34 AM

How do you get this into the list to select from in the "scripts" tab of the item editor? Do you import it like a FFC script or it is different?

#14 Russ

Russ

    your reality is a game to me. and i like gAmes….

  • Local Moderators
  • Real Name:Check my username. You'll figure it out.
  • Gender:Male

Posted 15 February 2013 - 01:41 AM

Yeah, you import and compile it just like you would a ffc script (it should be in the same script file too). Once it's compiled and you're brought to the screen where you assign scripts to slots, look at the top, and you'll notice three tabs: FFC, Global, and Item. Select the Item tab and assign it to a slot. Then go to your item, and over to the Scripts tab. There are two script boxes: Pickup, and Action. A script in the Pickup slot will run when you pick up the item, while scripts in the Action tab run whenever you use the item. Seeing as this is an pickup message script, you'll want to set it to the pickup slot. Then set D0 to the message you want to play, and voila, you're done.

#15 Anthus

Anthus

    "So Where Were the Spiders?"

  • Members
  • Real Name:Alex
  • Gender:Male
  • Location:Columbus, OH.
  • Past Nicks:Tobias Daboi, Rex Zemenheart

Posted 15 February 2013 - 12:37 PM

Thanks icon_smile.gif I got it in, no problems.

Random script question: Whenever you go to bringing in scripts, it always say something about "overwriting a buffer". What is this talking about? I'm assuming it just means it clears the last text file you loaded into the compiler? This doesn't do anything to scripts already in the quest though, right?



Also tagged with one or more of these keywords: Item

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users