|
RPG Toolkit: check your inventory You can read Part One in this series here. Part Two is here. Part Three is here. Last night I started working on a flexible object inventory system for the RPG. Ok, here's what I've got so far for the Inventory system: This is a card in a substack called "objects." The Load Image script is fairly simple: on mouseUp -- get file name with dialog box answer file "Select the image for the object" with filter \ "Web Graphics,*.jpg;*.gif;*.png" import paint from file it -- put icon of new image in iconid put the short name of last image into tempImage put image tempImage into image "Image" put the short name of image tempImage into field \ "objectName" --put the icon of it into field "iconID" put the ID of image "Image" into field "iconID" -- make small version of image in Object Icon put image "Image" into image "imageIcon" -- left, top is 226, 30 -- get max of width and height, set larger to 100, set -- smaller proportionally put max(width of image "imageIcon", height of image \ "ImageIcon") into newScale set width of image "imageIcon" to width of image \ "ImageIcon" * 100/newScale set height of image "imageIcon" to height of image \ "ImageIcon" * 100/newScale --set the rect of image "imageIcon" to 0, 0, 100, 100 delete image tempImage end mouseUp I seem to have a problem where after closing and opening the stack, the image attached to the "icon" goes back to full size, though. Still trying to sort that out. Once I've got that working, the plan is to write the "get" script like this: on mouseUp -- highlight gettable objects - set outer glow to true -- set their disable to false -- wait for get signal to come back -- hide button of taken object -- put && char after field "inventory" -- set the icon of last char of field "inventory" to icon -- of "gotten" button -- use the "inventory" version of the graphic from -- substack of objects end mouseUp The "gettable objects" and "gotten" button refer to button controls on the card that represent the objects in the scene that the player can use the "get" command on. Some objects will be background images only, and others will be too large to "get" (but might take other actions, like "use.") I plan to have the "gettable" objects glow like this when the "get" button is clicked: Edited because I found the parameter I want: set the outerglow["color"] of me to "255,0,0" Speaking of verbs, I've been mulling over the "essential" list of verbs to include in a game like this for years. Some are drawn from MUD/MUSH/MOO code, others are from paper-and-pencil RPGs. Here's a short list of my favorites: I feel like I'm making good progress on this, I look forward to bringing you another installment next time!
|
Tweet
|