Script for gifting items to NPCs... (resolved)

Started by happyman, November 14, 2009, 01:09:33 pm

Previous topic - Next topic


November 14, 2009, 01:09:33 pm Last Edit: November 15, 2009, 03:09:52 pm by game_guy
I've never requested a script before, so please excuse me if I'm out of line anywhere.

I'm making a Harvest Moon/Animal Crossing Game and I need a way of giving items to NPCs as gifts.

Here's what I really want to happen:
When you speak with a character, the player is given three choices:  Talk, Gift, Nevermind (or something).  Obviously, choosing "Talk" would display text for the specified character.  I don't have a problem here, or with the choice "Nevermind."  :D  But when you choose "Gift," I need a menu to pop up, displaying a list of items currently in possession of the party.  I'm thinking selecting an item would deplete held quantity of said item by 1, and a text box would display for the NPC.  If I can store the selected item as a variable, then I can use Condition Branch to determine different reactions from the NPC depending on the item.  Example: "Oh, thank you, I love flowers!"  or "Ew!  Gross!  I hate bugs!"  I have variables that determine the happiness of every NPC, which would change depending on the gift.

I also think it's important to cancel the process of gifting while the window's open.  Doing so would probably Jump to a Label, specified in the "Nevermind" option.  <-- Unless someone thinks of a better way.

So that's it.  I want to be able to control this script with eventing (I'm not sure if I even need a script).  All I need is the power to summon a Gift Window when a player chooses "Gift," and assign the selected item to a variable.  Seems simple enough, I hope.

Coincidentally, I'm also having trouble finding a good HP/SP bar displayed onscreen during gameplay (Not in the menu or battle, in the field).  Can anyone help me out?  Thanks for any help :)

I forgot to mention, I'm using some scripts already.  Don't know if they'll affect this request though.  I'm using Blizzard's ATES, a Ring CMS and an AMS (advanced message script).  The CMS might be a problem if you think i need to access the menu to get to the items...  But I'm not a scripter and idk.

Added resolved tag ~ G_G


November 14, 2009, 01:25:45 pm #1 Last Edit: November 14, 2009, 01:29:13 pm by Aqua
HP/SP display is a HUD
Search around XD

As with the gift window thing, it's not too hard.
It'd just call a scene that would show the inventory, and then have it do stuff on action.
I might be able to do this today... but... not sure XD
Depends on what other stuff I have to do D:

Don't double-post.
Use the modify button instead.

Do you want all game items to be able to be gifted or only certain ones?
If only certain, do you want to define the list in the script or use an element check?

Also, how big do you want the selection of the window in terms of columns and rows?


For the item selection window, it would be nice if the items were in one column.  How many could fit in one row?  Maybe six, with the option of scrolling down for more.  I didn't consider that.

I DO have some special items that shouldn't be gifted.  How would an element check work?  Is it kind of like a switch in the item settings, and basically all items of the element "fire," for instance, will appear grayed out and unselectable?  Because that sounds good to me :)

Sorry for the double post.  Learned my lesson :)


The ones with the "fire" wouldn't show up at all :P

Lol I was thinking of the one column too :D

So... just tell me if you want the element check, and I'll work on it soon (I hope)


That element check idea sounds good!  :)  I imagined the ungiftable items to appear gray in the list, but if they don't show up at all, that's okay too.

Thanks a lot for taking an interest.  There's no rush, so take all the time you need :)


I can make them show up as grey or not show up at all...
Which do you want? :p


November 14, 2009, 04:16:22 pm #6 Last Edit: November 14, 2009, 04:19:15 pm by happyman
Well, if I get to choose, I would prefer them to be grey.  But if it's easier to make then not appear, that's okay too.

Also, i just realized...  It might be cool if the Icons for every Item could appear next to each item.  You know what I mean?  Is that a possibility?


Spoiler: ShowHide

Of course... :P
I wouldn't have it any other way.

Mm... forgot to change the size of the selection...
And I still gotta make the gift to be "processed" XD



It's a combination of a script & event system...
Do you want me to comment the event parts?



Still working on it...
Basically... it's done... I just wanna make it look better XD


November 14, 2009, 07:46:22 pm #12 Last Edit: November 14, 2009, 08:22:58 pm by happyman
I have no problem with that  :)

Btw, I've searched High and Low for a good HP/SP bar HUD, but with no luck.  Should I make a new script request?


November 15, 2009, 11:40:42 am #13 Last Edit: November 15, 2009, 12:54:55 pm by Aqua
If you want to really make one that's unique to your game, then you'd need to make a script request.

Make sure to include a mockup of what you want it to look like and include any features you would like the HUD to have.

Here's the demo with the gift giving.

I only did the minimal comments.
The NPC is fully commented, but script itself is barely commented XD

Anyway... it should be (hopefully) easy to understand and set up.

If you want anything changed, let me know.


nice !
great work aqua !
this is veary handy for making quests :p



Wow!  Aqua, this is awesome!  And it's perfect!  Just what I needed!


Glad it's what you needed :D
Please add a [Resolved] tag to the title of your first post to signify that this request is resolved.

Lol... I'm too lazy to officially release it right now XD


Great job aqua! However, it would be better if you had it call a common event rather than flip the event's self switch. (since you're going to have to use a different event for the person on every map) But it's easy to get around, as you can just have the second event page call said common event. Other than that, GREAT script Aqua :D


If I use a common event, then it won't be customized to each event... :P