Make your own inventory

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

Make your own inventory

Postby domozo » Thu Dec 01, 2011 9:48 pm

Make your own inventory:
In this topic I will display my method in making a new inventory and passing up the AM inventory though
I did not abandon it completely but I depended on it to make it easy to arrange and write an INI keeping the names of the items, and being the source of them always though I will hide the AM inventory
completely, and you must know that I am not good in explaining though I am not bad in scripting, and
there is another thing that this topic is extruding from my first test in making a game so any one can develop
the work and post his notes and even cancel the AM inventory as a source.
I started in the home this topic by writing the wanted scripts but I couldn't complete it because of the
computer layout so the numbers turned to Arabic numbers and the brackets inverted so I decided to
explain the steps theoretically, and to attach(or upload) a little size project so everyone can copy
and past the scripts wrote in it.

generally:
1- You can use this inventory in the panoramic and 2d frames (this is the most important feature)
2- You can mix items and arrange them as you want as long you are in the inventory frame but they will
be arranged automatically when you return to it.
3- You can use key guard blugin (great thanks to Shadow Hunter) to make the items glow when the
pointer pass over them.
4-You can make a slot containing an item anywhere in the game to use it privately like a frame with an admirer to examine a crime scene , or an adhesive tape to gather a torn paper and so on.
5-You don't need to drag the items because the cursor will change to the item icon.
6-You can make your items by any size you want.
7-You can use any inventory graphic easily (leather, wood or anything else by GIF format).
8-You can display an explain GIF to the items also by key guard.
9-You can use the inventory frame as a HQ to the player so he can go from it to a pause menu
or document or objectives frame.

right click work:
at first I bypassed displaying the original inventory from the project properties and made a start
menu, and wrote a script in the advanced tap to execute a VBScript instead, so the mouse right click
take the player to the inventory and make a non visible picture pox object in any frame in the game and take a snapshot to any frame by the code (Action.CaptureFrame) and load it into this picture pox then save the picture by the code (action.saveAPicture) of course to the external folder, anyone can open the attached or (uploaded)project properties and copy the code.

inventory frame:
I create the hotspot(1) in the inventory frame which its size is the same size of the frame .
my inventory frame is complicated, I made buttons to go from this basic frame to the pause menu and document frames and others.
and of course the player can return easily to the game by the same way he come or by a button.
I create a hotspot(2) to contain the inventory graphic (GIF file) and two other hotspots to contain
two separated slots the first contain the admirer which can discover the items and go to a special
frame to each item and I create in its main hotspot by 3ds MAX program a video display the item turning
so the player can examine it.
the second separate slot used to mix items by a special sub (mix sub) and by (action.RemoveItem) and
(Action.AddItem) I removed the two old items and added a new one.
and the most important thing in this frame that it will load the saved picture to the hotspot(1) every
time it appear from external folder (snap.BMP) by the code :
Hotspot(1).picture=LoadPicture(Action.GetPath+"snap.BMP")
NOTE: anyone interested can use this code for the save and load system as a snap to the saved or loaded
game

items preparation and writing to an INI file:
I made 7 files to each item in the game for example: (knife) and this is the files
1-knife.max (this file will be saved and edited any time).
2-knife.avi (this file will be a forever turning object to be examined).
3-knife.ico (this file will be the new pointer after clicking an item).
4-knifeover.ico (this file will be the glow of the pointer)
5-knife.gif (this file by any size will be displayed in the inventory slots).
6-knifeover.gif (this file will be the glow of the item)
7-knifeexplain.gif (this file will be a GIF coming from a text file which will appear fast with the movement
of the mouse pointer).
in this case it will be easy to use key guard so the script read the INI file which I write in it the names
of the items that exist in the original and hidden inventory(by the has item function : this function used to save the items so I used it to write the names of them to the INI I mentioned before which exist in the external folder), and the script will read the keys one by one :
9-knife
10-DVD
11-matches
12-lamp???..etc
note that I started from 9 because I used many hot spots to the inventory graphic and other things
and the first slot of the items come by this number ,so the script will read the key 9 in the INI
file (for example : the items names written in the section 4 , keys 9 to 35) , after this the script will
load what wrote in key 9 +".gif" ,of course everyone know the code(Action.ReadINI).
finally the key guard will load "key9"+"over"+".gif" and will load in a special hotspot "key9"+"explain"
+".gif" by the code (Action.LoadAPicture) from the area folder.
of course when the player click on an item in the inventory the cursor will change to the item icon
by the code(Acion.ChangeDefaultCursor).
and the script that I wrote in the frame property advanced tap (this frame contain the hotspotwork)
will load over the work hotspot "item icon"+"over"+".ico"


hiding the AM inventory and returning to the main pointer:
when the player click an item he can return to the game by right click or by clicking the button
of returning to the game or by pressing ESC key , so if the item doesn't fit he can do a right
click to return to the main pointer (this due to the variable value witch wrote in all the game
playing frames for example myvar=5 , beside the code(Action.ChangeDefaultCursor) note that in the
inventory frame advanced tap property myvar=9 (for example) so the right click doesn't remove the
item when the player is in this frame.
all this coming from the code I wrote in the project properties window (advanced tap):
if myvar =5 then Action.GoToFrame "inventory1"
if myvar=9 then Action.GoToFrame Action.readINI(snap.replaceme,1,1) and this mean to go to the frame
which the player come from.
because the mouse right click writes to the same INI the name of this frame (Action.WriteINI)
(Action.GetCurrentFrame) of course to a deferent section (1,1).
NOTE: in the 2d frames the player return to the default cursor by right click immediately without
any problem but in a panoramic frame he will need a click after this to activate the frame.
to hide the AM inventory when I take an item from the game (by (Action.AddItem )or (hotspot tap
properties)) I wrote in the advanced tap of the hot spot (that containing the item to take)
(Action.GoToFrame"the same frame which contain the item" ) and in the advanced tap of the
frame (Action.HideInventoryButton) so it's impossible that the AM inventory pop up , beside
this I made a transparent gif button graphic instead of the original.







differences between general items and special items and mixing :
the general items as I said before coming from reading INI which wrote by (has Item function)
so when some item is removed the items places or slots will change and become more close to
the first slot and this will not be good for the steady items like admirer so I wrote a script in the
inventory advanced tap property which write the word "admirer" to the same INI file but to
deferent section in the key 1, (so the appearance of the inventory frame will write and load
the admirer item though it is not exist in the AM inventory.) and the key 2 will receive the name
of the item which put in the mixing slot , but the same script in the advanced tap property will
erase this name so it will be temporary and could be erased by leaving and returning to the inventory
frame (this is unique to this item) and by taking it again from this slot (like any other item).
for this every time the player go to the inventory by mouse right click will see the admirer
but he will not see any item he put in the mixing slot (the item will return to its slot in order to its
number which come from the time of taking it in the game (if the player take the knife before
the DVD so the knife will stay closer to the first slot (Hotspot(9)) to the end of the game unless
they removed)).
NOTE: the slots of the admirer and mixed items come by numbers which doesn't account with
the general items (9-35 as I said in the example before).

the hotspot of items work know if you are carrying an item:
because I wrote in the advanced tap of every hotspot of items work a script tell the hotspot that
if catch1 (a variable turn from 0 to 1 in the advanced tap of every slot in the inventory when you
click on an item, note that when the player do a mouse right click to return from being carry an item
to the main or default cursor this variable will return to 0 ) then if regname (a variant variable coming
from writing to the mentioned INI in a deferent section the name of the item when you click on it of
course in the advanced tap of the slots of the inventory)which=ActionRedadINI (snap.replaceme,7,1) for example then .do something Else (Action.Message"no")
NOTE: you can write INI to one txt file (snap.replaceme) or to many files , for me I put the name of
the current frame in a separate file and all other information about the items in another one together
with information making the player able to start a new game (all the variables=0 and other information
about save and load).
NOTE: the ESC button do the same act of mouse right click
NOTE: I did not mention all the details of the scripts you can download the attached
or (uploaded)project.

suggestions:
1-I suggest any experienced and interested one to depend on an INI contain the names of the
the items he would use in the game and pass up the original inventory completely.
2-right click is removing the item and return to the panoramic frame so I suggest to make
the returning to the frame easier to the player.
3-checking the item must be in a hot spot that enable the player to turn the item up and down
and in all directions (like using a 3d object) with four arrows up, down ,left ,and right
NOTE: I don't know if we can use C++ in our projects.
4-playing when the player carry an item make the item (cursor) disappear on every hot spot has a
deferent cursor (like cursor of going to another frame) so it will be good to keep the carried item
and stop changing to deferent cursors and stop interacting with hot spots while this.
5-finally I used right click and ESC key to go to the inventory frame and then by a button the
player go to the pause menu, so I suggest to make a script take the player with a right click
to the inventory while the ESC key take the player to a pause menu.
NOTE: I didn't have the chance to make all this, may be in the future.


completion :
because I didn't put a work hot spot in the project so make a hot spot in any frame ,
if it was panoramic you must check the option (update 360 degree panorama to
reflect hot spot changes) , then in the advanced properties tap past this code
and you must change it as desired:
Code: Select all
If catch1=0 Then
Action.message "the vise is ready.." 
End If

regname = Action.ReadINI("startnewgame.domozo",109,1)


'-------------------------------------------------------------
'-------------------------------------------------------------
'-------------------------------------------------------------


If catch1=1 and ienteredsafeframe=1 Then
If regname = "sidebar broken" Then
PlaySound GetPath(4) + "box open1.wav",False
Action.ChangeDefaultCursor "main.ico"
Action.CreateTimedEvent 0.2 ,"x=5",False
Action.WriteINI "startnewgame.domozo",109,1,"main"
Action.WriteINI "startnewgame.domozo",110,1,"IhaveNoItemNow"
catch1=0
If sidebarpierced =0 then Action.CreateTimedEvent 0.5, "Action.GoToFrame ""rfrm5-7-1"""
If sidebarpierced =1 then Action.CreateTimedEvent 0.5, "Action.GoToFrame ""rfrm5-7-2"""
End If


If regname = "admirer" then Action.message "the vise is ready.."
If regname = "phone" then Action.message "no..impossible.."
If regname = "sidebar repared" then Action.message "it has been repaired.."




If regname <> "admirer" and regname<> "phone" and regname<> "sidebar repared"_
and regname<> "sidebar broken" then Action.message "no.."
End If




If catch1=1 and ienteredsafeframe=0 Then
If regname = "sidebar broken" Then
Action.message "I don't have a reason to do that..maybe I  must call DR.Salem.."
phoneuse2 = 1
End If


If regname = "admirer" then Action.message "the vise is ready.. "
If regname = "phone" then Action.message "of course not.."
If regname = "sidebar repared" then Action.message "it has been repaired.."



If regname <> "admirer" and regname<> "phone" and regname<> "sidebar repared"_
and regname<> "sidebar broken" then Action.message "no.."
End If



of course you must create the wanted graphic to make changes.
then in the advanced tap of the frame witch containing this hot spot past this code:

Code: Select all
regname = Action.ReadINI("startnewgame.domozo",109,1)

If catch1=0 then
Hotspot(1).MouseIcon = LoadGraphicFile("handtry48.ico")
End If

If catch1=1 then
Hotspot(1).MouseIcon = LoadGraphicFile(regname&"over.ico")
End If

supposing that hot spot(1) is the work hotspot


finally :
I succeed to upload the project and this is the URL
http://www.crocko.com/DB7043C1D73545DBBB22E06BBC031C73/unleashing_inventory.rar
and I hope if there is some question when I have no chance to enter the forums that the experienced
members answer it.
the project name is (unleashing inventory).
the project size is 38.9 M.B , it has no music, and the important thing that it use cylindrical panorama
blugin and key guard blugin so any one can download it from Shadow Hunter's web site.
the uploaded project was made by AM 4.5.2
and it is compatible with Windows XP
please scan it with some antivirus program .
have fun and good luck to everyone.
DOMOZO-SYRIA-LATAKIA.
Attachments
50.jpg
50.jpg (640.62 KiB) Viewed 12537 times
64.jpg
64.jpg (339.38 KiB) Viewed 12537 times
60.jpg
60.jpg (576.57 KiB) Viewed 12537 times
23.jpg
23.jpg (639.04 KiB) Viewed 12537 times
Last edited by domozo on Mon Dec 12, 2011 3:49 pm, edited 2 times in total.
User avatar
domozo
Frequent Poster
 
Posts: 147
Joined: Mon Jan 24, 2011 9:40 pm
Location: Syria-Latakia

Postby mercedes » Thu Dec 01, 2011 10:10 pm

This looks excellent!~ Sadly..I can't download it though..cause i don't have .rar....I can see alot of work went into this...Nice pictures too!~..:)
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby domozo » Thu Dec 01, 2011 10:28 pm

------------------
Last edited by domozo on Sun May 03, 2015 4:38 pm, edited 1 time in total.
User avatar
domozo
Frequent Poster
 
Posts: 147
Joined: Mon Jan 24, 2011 9:40 pm
Location: Syria-Latakia

Postby Vengeance66 » Thu Dec 01, 2011 10:35 pm

Wow! domozo!

This looks awesome! :o

I'm downloading the project to see the custom inventory! This is something that I dreamed of...

Thanks a lot for sharing this!
Stay a while and listen...

Rainbow Enterainment - http://rainbowenter.com/
User avatar
Vengeance66
Administrator
 
Posts: 630
Joined: Wed Oct 13, 2010 2:17 pm
Location: Macedonia

Postby domozo » Thu Dec 01, 2011 10:44 pm

OK Vengeance66 I really wish you good luck..
this project is a little part of The Arabic Advanture game
I hope you forgive me if you couldn't leave the room frame.
domozo
User avatar
domozo
Frequent Poster
 
Posts: 147
Joined: Mon Jan 24, 2011 9:40 pm
Location: Syria-Latakia

Postby Vengeance66 » Thu Dec 01, 2011 10:51 pm

I'm getting only error when I click right-click.

Type mismatch MediaPlayerObject

What is the problem? :(

Edit: No problem domozo ;) I just wanted to see how the inventory works. But only errors with the MediaPlayerObject :/
Stay a while and listen...

Rainbow Enterainment - http://rainbowenter.com/
User avatar
Vengeance66
Administrator
 
Posts: 630
Joined: Wed Oct 13, 2010 2:17 pm
Location: Macedonia

Postby juhuwoorps » Thu Dec 01, 2011 10:54 pm

I think you have tried it with WIN7 and the demo is made with XP or Vista.

It's a typically WIN7 compatibly error
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby Vengeance66 » Thu Dec 01, 2011 10:55 pm

juhuwoorps wrote:I think you have tried it with WIN7 and the demo is made with XP or Vista.

It's a typically WIN7 compatibly error


Yes... yes...

Solution?
Stay a while and listen...

Rainbow Enterainment - http://rainbowenter.com/
User avatar
Vengeance66
Administrator
 
Posts: 630
Joined: Wed Oct 13, 2010 2:17 pm
Location: Macedonia

Postby domozo » Thu Dec 01, 2011 10:55 pm

OK
just start the project from the AM list and yuo will get no error
I am using WAV files I don't know if this cause some error
domozo
User avatar
domozo
Frequent Poster
 
Posts: 147
Joined: Mon Jan 24, 2011 9:40 pm
Location: Syria-Latakia

Postby domozo » Thu Dec 01, 2011 10:57 pm

juhuwoorps
this project made by Windows XP
domozo
User avatar
domozo
Frequent Poster
 
Posts: 147
Joined: Mon Jan 24, 2011 9:40 pm
Location: Syria-Latakia

Postby juhuwoorps » Thu Dec 01, 2011 10:59 pm

Vengeance66 wrote:
juhuwoorps wrote:I think you have tried it with WIN7 and the demo is made with XP or Vista.

It's a typically WIN7 compatibly error


Yes... yes...

Solution?



You have to change the PlaySound script.

Have a look at the WIN7 threads here in the forum. Ther's somewhere a script that is compatible with xp,vista and win7

Also be sure you are using AM 4.6.0 or 4.6.1
Last edited by juhuwoorps on Thu Dec 01, 2011 11:00 pm, edited 1 time in total.
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby Vengeance66 » Thu Dec 01, 2011 11:00 pm

juhuwoorps wrote:
Vengeance66 wrote:
juhuwoorps wrote:I think you have tried it with WIN7 and the demo is made with XP or Vista.

It's a typically WIN7 compatibly error


Yes... yes...

Solution?



You have to change the PlaySound script.

Have a look at the WIN7 threads here in the forum. Ther's somewhere a script that is compatible with xp,vista and win7


So, that must be the problem...

Thanks! :)
Stay a while and listen...

Rainbow Enterainment - http://rainbowenter.com/
User avatar
Vengeance66
Administrator
 
Posts: 630
Joined: Wed Oct 13, 2010 2:17 pm
Location: Macedonia

Postby domozo » Thu Dec 01, 2011 11:04 pm

I am using AM 4.5.2
sorry
domozo
Last edited by domozo on Fri Dec 02, 2011 1:13 am, edited 1 time in total.
User avatar
domozo
Frequent Poster
 
Posts: 147
Joined: Mon Jan 24, 2011 9:40 pm
Location: Syria-Latakia

Postby juhuwoorps » Thu Dec 01, 2011 11:06 pm

domozo wrote:I am using AM 4.3.2
sorry
domozo


So if you want to publish the game you should warn your users that the game is not WIN7 compatible
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby domozo » Thu Dec 01, 2011 11:07 pm

Iam leaving now Iam tired it is 12mid night in Latakia
see you later.
domozo
Last edited by domozo on Fri Dec 02, 2011 1:17 am, edited 1 time in total.
User avatar
domozo
Frequent Poster
 
Posts: 147
Joined: Mon Jan 24, 2011 9:40 pm
Location: Syria-Latakia

Postby domozo » Thu Dec 01, 2011 11:09 pm

juhuwoorps wrote:
domozo wrote:I am using AM 4.5.2
sorry
domozo


So if you want to publish the game you should warn your users that the game is not WIN7 compatible


OK and thank you I will repair this
domozo
User avatar
domozo
Frequent Poster
 
Posts: 147
Joined: Mon Jan 24, 2011 9:40 pm
Location: Syria-Latakia

Postby Candle » Fri Dec 02, 2011 3:00 am

Zip file of the rar file .
Unrar it and made a zip out of the folder for mercedes.
http://www.mediafire.com/?acwvo9cin81f410
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3055
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby domozo » Sat Dec 03, 2011 4:43 pm

I haven't the project here in the coffee net...
Last edited by domozo on Sun May 03, 2015 4:36 pm, edited 3 times in total.
User avatar
domozo
Frequent Poster
 
Posts: 147
Joined: Mon Jan 24, 2011 9:40 pm
Location: Syria-Latakia

Postby domozo » Sat Dec 03, 2011 4:56 pm

IMPORTANT NOTES:
NOTE1: you can open the advanced tap of the slots hotspots of
the inventory (all)
and delete the line of the code (taking an item)
Code: Select all
Action.CreateTimEdevent?.catch1=1
and write in the last line in this part of code (before End If)
Code: Select all
catch1=1

so whatever the player was fast in taking an item , he will not be faster than
the code,
(because in some cases the player take the item very fast so the pointer
turn to the item icon put catch1 value stay 0)
NOTE2: don?t do this in the mixing slot hotspot to avoid receiving the
message (no) after taking any item from it.
NOTE3: I discovered that when the transparent button of the inventory that I make
(Button_Modern2.gif) is not exist, that the inventory original button pops up
When the player mix tow items in the inventory frame (I did not notice this before)
so make a transparent one instead of it (just in case) and open the "VBScript Global
Procedures" window and go to the sub mixitem and write this line of code :
Code: Select all
Action.GoToFrame Action.GetCurrentFrameName
in the end of every mix operation code (the mixing of batteries), that mean
you need to write it three times, and the inventory button will not pop up
and you will stay in the inventory frame whatever it was (1,2,3?), above all
the items will not be arranged automatically and the player will not notice
this, finally you must do this in the end of every similar code.
NOTE4: there is many many variables in the project, those are of my game
(The Arabic Adventure), I suggest you delete any variable you don?t need
(I was too lazy to do this), and notice that the project was uploaded for
tutorial purpose only and all its copy rights are reserved.
NOTE5: any mistake in the work of the inventory could be repaired, I am sure
that you can do it.

GOD LUCK
DOMOZO
Last edited by domozo on Sat Dec 03, 2011 11:51 pm, edited 1 time in total.
User avatar
domozo
Frequent Poster
 
Posts: 147
Joined: Mon Jan 24, 2011 9:40 pm
Location: Syria-Latakia

Postby reneuend » Sat Dec 03, 2011 6:18 pm

mercedes wrote:This looks excellent!~ Sadly..I can't download it though..cause i don't have .rar....I can see alot of work went into this...Nice pictures too!~..:)


You can download a free and very good compression tool that handles both rar and zip files. It's called, 7zip. I can't believe yall haven't thought of this! :wink:

http://www.7-zip.org/download.html



Domozo! I'm am very impressed!!!!!! Especially with your graphics. If you haven't already, I'm surprised you haven't tried selling your games. What a lot of work you have put into them! Thank you very much for sharing!

Also, conversion to make it work in Wndows 7 is not difficult. So, don't give up on the Windows 7 users because their are many of them! If you need help, let me know.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2690
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Sun Dec 04, 2011 12:15 am

Candle wrote:Zip file of the rar file .
Unrar it and made a zip out of the folder for mercedes.
http://www.mediafire.com/?acwvo9cin81f410


Awesome!~..Thanks Candle :D..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby domozo » Sun Dec 04, 2011 1:31 am

reneuend..
I am honored, thank you very match, now I am finishing the wanted procedures to begin
the act of selling , and I will try to make it work with Window7 , that is very important,
thank you for note.
domozo
User avatar
domozo
Frequent Poster
 
Posts: 147
Joined: Mon Jan 24, 2011 9:40 pm
Location: Syria-Latakia

Postby domozo » Sun Dec 04, 2011 1:39 am

I uploaded the project again zipped and this is the URL:
http://www.crocko.com/C7D5A2A79CA040ECBBAB6A5E60D87C99/unleashing_inventory.zip
but please please if this web site make any problem with downloading it for free just tell me...
good luck- domozo
Last edited by domozo on Sun May 03, 2015 4:35 pm, edited 4 times in total.
User avatar
domozo
Frequent Poster
 
Posts: 147
Joined: Mon Jan 24, 2011 9:40 pm
Location: Syria-Latakia

Postby reneuend » Sun Dec 04, 2011 7:18 am

I'm downloading it now. I'll convert it to work with Windows7 and try it out. Thanks again!
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2690
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby domozo » Mon Dec 12, 2011 3:40 pm

reneuend wrote:I'm downloading it now. I'll convert it to work with Windows7 and try it out. Thanks again!


well..I hope that will work
domozo
User avatar
domozo
Frequent Poster
 
Posts: 147
Joined: Mon Jan 24, 2011 9:40 pm
Location: Syria-Latakia


Return to Post Your Own Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron