Inventory for newbies! (my first tutorial)

This forum is meant for people to share their knowledge by writing their own tutorials for Adventure Maker.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Inventory for newbies! (my first tutorial)

Postby Stitches » Mon Mar 10, 2014 5:41 pm

Hi, this is my first real tutorial. I'm gonna tell you how to make an impressive looking inventory if you're just getting started with AM and are cluess on coding etc... or if ye just haven't thought of it. This is inventory for noobs with no plugin involvement and just a smidge of easily translated code (which you can just copy and paste from the help files of AM or here :) ) Below the windows one is a method for iPad and PSP that could help some of you.

1 Create an inventory bar:
Let's say you're using a 1024 x 768 resolution (or whatever). We make a bar, say 1024 by 100. A transparent PNG file in whatever pain program you use (I use paintshop pro)
Next fill this rectangle with any colour or picture etc. Get the look of your bar.
Be sure to make a selection for say Health? if you want that... Just a box which is erased to become transparent. So you'l have a bar with some alpha boxes in it, all see through and lovely. This is why we save to PNG at first.

2. Get Gimp (2.0) for free off it's official page (google it)
Using Gimp, import your PNG bra and then go to File>Export> Then rename the top title from "inventorybar.png" (whatever it's called) to inventorybar.gif and then choose export to GIF from the drop down menu to the lower right of the Gimp export screen. If you did this correctly, a box should appear asking if you want to add a gif signature... uncheck or leave the box checked, your choice. Then export. Bingo, there is your bar.. with the transparent layer in as a gif! It's automatically saved so now close gimp.

3. Open AM And create a blank frame (call it inventory frame or whatever) and create a hotspot. Click hotspot picture as your inventory.gif. Do not resize.

4. Position the inventory bar at 0left 668top coordinates by dragging it about and observing the coordinates in the box which appears in AM. Once in position, hover your mouse over the empty transparent box you left in there and log the upper left coordinates (on a text pad or in your head :) )
Exit and create a new frame (call it game frame for now).

5. The gameframe will be your stencil for each frame. On here, Right click to add text box (just type 1 or something into it). Now drag that box to the coordinates on the frame which you logged in your head. Get it now? The variable value will be shown in the blank space, though you cannot see that yet... hold on!

6. Go to frame properties.
Type into advanced VBS
Text(1).Caption=""+CStr(Health) < keep this code handy. You will need to implement it into every action which affects the health value.

7. Exit an go to Runtime frame merging. Select the gameframe and assign the inventorybar frame to it. And there you go!

Extras:
Now when you go back to the inventory frame you can add other ghotspots... let's say a gif which says "look" "talkto" etc. Make each one switch between a variable of the same name. OR Use two jpeg images or gifs or what have you... just 2 images. One for active and one for inactive. Have the one on the bottom "only visible when "lookat = 0" and the upper when "lookat = 1" Lay them directly over the top of each other. Now awesome is this now then? Go back to the gameframe...

Example of it in action.
Draw a hotspot on the game frame and load a graphic of any sorts. Go to the VBS section and type
Health = Health - 10
Text(1).Caption=""+CStr(Health) < This code updates the value on the screen

Then go to frame props and type Health = 100
You have just given your health 100 points and asked it to display them in real time.
Test frame... If all went well your inventory bar should be there and you should have 100 points in it... then when you click the hotspot picture in the middle, 10 points should be taken off this time ...

There you go. A reeeeaaaal simple way of doing this. You cannot use text objects with constant updates from a merged frame, that's why you need the transparent bits in the bar to display your value from the game frame instead. It took me a while to come to terms with this. Mew. Consider this dinosaur bones... gte digging yerself now you know how. Keyguard can be implemented for better effects and stuff, but this is in cae you don't want plugins used.


"How would I do it for an ipad or PSP?"

Well there's a way... through variables...


Create 5 variables "HP1 HP 2 HP3 and so on. Then create 5 corresponding hotspots on the game frame you have. Make each one only available if it's variable is at 1.
Create a blank frame with one hotspot. make it go to your game frame. Go to the variables and make it change HP 1-5 to 1 on the way. This will display your 5 health points.
Now draw a hotspot on the gameframe... make it an enemy or something. In it's hotspot properties make it so it takes HP 1 - 3 to 0. Select hide and diable when done.
Duplicate the hotspot.
Go to its properties and make it so it turns HP2 and 1 to 0. Select hide and disable.

Just a though as I'm using windows versions.
But this method should allow for you to have "HP points" displayed and taken away or added (through whatever inventive method you decide). I wrote this as I know PSP games and IPad ones don't allow for VBscript to be added to te advanced properties. Hope it's been helpful to someone.

Taterz folks! :D :D :D
http://www.youtube.com/user/MaynardStaly/videos and http://libertycap.webs.com
“With a bit of luck, his life was ruined forever. Always thinking that just behind some narrow door in all of his favorite bars, men in red woolen shirts are getting incredible kicks from things he’ll never know.”
User avatar
Stitches
Active Member
 
Posts: 71
Joined: Tue Nov 12, 2013 3:56 am
Location: UK

Return to Post Your Own Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests

cron