personal inventory and hotspot problem.

This forum is meant for requesting technical support or reporting bugs.

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

personal inventory and hotspot problem.

Postby Giuseppe » Sat Feb 21, 2015 5:25 pm

Hi I have a problem.
I created the custom inventory. When I click an object it appears in the inventory using variables.
when I click the item in inventory, the cursor takes its form.
There is a chair in the image and I want to only use the hammer on the chair. All other objects must not be run on the chair.
if the player chooses the different objects in the inventory should be work only hammer the hotspot of the chair.
is it possible?

Image
Giuseppe
Frequent Poster
 
Posts: 147
Joined: Wed Mar 12, 2008 12:01 pm

Re: personal inventory and hotspot problem.

Postby reneuend » Sat Feb 21, 2015 6:41 pm

I am out shoveling snow. I will answer later today. :mrgreen:
---


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

Re: personal inventory and hotspot problem.

Postby Giuseppe » Sat Feb 21, 2015 8:41 pm

ahahaha reneuend.... :lol:
No problem...thanks
Giuseppe
Frequent Poster
 
Posts: 147
Joined: Wed Mar 12, 2008 12:01 pm

Re: personal inventory and hotspot problem.

Postby reneuend » Sat Feb 21, 2015 9:21 pm

I'm here now!

I have some questions about the custom inventory.
Is this something you built or is it a plugin or something else? The reason I'm asking is that the solution I present may not work when its a tool that someone else built.

How do you identify the items in the inventory? In other words, if I drag the hammer to the chair, how do I know its the hammer?

For now, I'm going to make a couple assumptions:
- when you click an item in the inventory, you set a variable that tells you it is the hammer. lets call it InventoryObject = 4 (where 4 is the setting for a hammer)
- when you don't have an inventory item, then InventoryObject = 0

After selecting the hammer from the inventory, you click on the Chair hotspot.
From the Advanced tab of the chair hotspot, you would check the InventoryObject variable.

Code: Select all
if InventoryObject = 0 then
    message = "You examine the chair. It is in need of repair"
elseif InventoryObject = 4 then
    message = "You use the hammer on the chair
    'do other actions, like change the image of the chair hotspot to show a fixed chair
else
    message = "The object you are using on the chair is useless."
end if


I don't know if this helps you. It really depends on how the custom inventory was written. I'm sure the way I would have built the inventory would be entirely different than how this one was done. Not that I would do better, just different.
Let me know if this helps or not. If not, maybe you can explain how the inventory works.

Thanks and good luck.
By the way, I like your drawing! :mrgreen:
---


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

Re: personal inventory and hotspot problem.

Postby Giuseppe » Sun Feb 22, 2015 4:27 pm

maybe I did. I send the project so the look and tell me. Its easy Because They are two frame only.

there are only 2 frame so it is easy to see. With the right mouse button disappears from the object pointer.

http://www.puntaeclicca.com/prova/prova.zip
Giuseppe
Frequent Poster
 
Posts: 147
Joined: Wed Mar 12, 2008 12:01 pm

Re: personal inventory and hotspot problem.

Postby reneuend » Sun Feb 22, 2015 6:33 pm

Looking at your project, I noticed you haven't done anything with scripting. Do you have the Full version of Adventure Maker?
For me to come up with a solution, you'll need to be able to add some scripting, and that requires the full version.
---


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

Re: personal inventory and hotspot problem.

Postby Giuseppe » Mon Feb 23, 2015 9:39 am

I've full version
Giuseppe
Frequent Poster
 
Posts: 147
Joined: Wed Mar 12, 2008 12:01 pm

Re: personal inventory and hotspot problem.

Postby reneuend » Mon Feb 23, 2015 1:05 pm

That's great. I'll build you a solution in the next few days and send you the project files.
---


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

Re: personal inventory and hotspot problem.

Postby Giuseppe » Mon Feb 23, 2015 8:05 pm

OK, thanks.
Giuseppe
Frequent Poster
 
Posts: 147
Joined: Wed Mar 12, 2008 12:01 pm

Re: personal inventory and hotspot problem.

Postby reneuend » Sat Feb 28, 2015 3:02 am

Here is a tutorial for building a custom inventory using Giusppe's layout.

http://amforums.cloudapp.net/phpbb/viewtopic.php?f=10&t=6808&sid=2408c634af94f28ea7221907c0a0403f
---


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

Re: personal inventory and hotspot problem.

Postby Giuseppe » Sun Mar 01, 2015 12:31 pm

ok, i'll try!
Giuseppe
Frequent Poster
 
Posts: 147
Joined: Wed Mar 12, 2008 12:01 pm

Re: personal inventory and hotspot problem.

Postby Giuseppe » Sun Mar 01, 2015 1:57 pm

It gives me a lot of mistakes, but maybe I'm wrong something.
I tried but I can not figure out what is wrong.
can you do a project AM so I can see better?
is not important to have many responses, for example on a chair or any other object, can also appear the same phrase, for example: "does not work with this item".. and when the player uses the right item appears another hotspot with the chair adjusted.

thanks for your patience.
Giuseppe
Frequent Poster
 
Posts: 147
Joined: Wed Mar 12, 2008 12:01 pm

Re: personal inventory and hotspot problem.

Postby reneuend » Sun Mar 01, 2015 11:08 pm

Sorry for not answering in a timely manner. I was out of town driving through a snow storm. I'm glad to be back and out of that mess.
I have nothing against your code, but I think it is making it too hard to use along side what I have written. I am going to remove the entries you have in the Variables tab for the inventory hotspots and rewrite this part.
I'll let you know when its done.
---


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

Re: personal inventory and hotspot problem.

Postby Giuseppe » Mon Mar 02, 2015 1:06 pm

Don't worry.
if you can get me an AM project instead pdf, it's easy for me.
another question about inventory object: when the player selects an item from the inventory, must not operate on 'hotspot forward or rotation', but only in the right one.
Thanks
Giuseppe
Frequent Poster
 
Posts: 147
Joined: Wed Mar 12, 2008 12:01 pm

Re: personal inventory and hotspot problem.

Postby reneuend » Thu Mar 05, 2015 4:09 am

Status (March 15th):
Now you can add an item to the inventory. The only thing left is getting an item from inventory and some fixes.


Status (March 11th):
I'm getting closer. But I'm NOT using merged frames. Instead, I used Hotspot magic to setup the hotspots for each frame. Each frame will have the copy of the Inventory menu and hotspots for the inventory objects. If you have 20 objects that can be picked up and added to the inventory, then you will need 20 hotspots for each frame just for these objects. Hotspot Magic makes this very easy to do.

What I have done thus far:
Now, I can pick up a hammer and then while still holding the hammer, I click on a key that I find, it will automatically drop the hammer to the screen and pick up the key. If I right-click while holding any object, such as the key, It will drop to the screen. I can also carry an object to a different frame and drop it there by right-clicking. Of course, you can use the objects on other objects on the screen.

Next, I will work on adding an object to the inventory and then getting an object from the inventory.
Unless I'm missing something, this should complete the custom inventory after I finish this part.


Status (March 8th):
I'm still working on it.
Hotspots on merged frames is acting very quirky.
My code works. I can drop an item and the hotspot for that item is registered on that location for that particular frame. The problem is that since it is a merged frame, Adventure Maker allows me to move the Hotspot image anywhere I want, but the actual clickable area doesn't move from its original position.

What does this mean? I'm going to have to recode this to use 2 hotspots for each item. A hotspot in the inventory menu bar and a hotspot to hold where the item is dropped on the screen.
I'm going to use Hotspot Magic to create all the hotspots I need.

I'm sorry it is taking so long. Please be patient.


[old status]
I wrote some routines to support my design idea. I don't normally work with merged frames, so I hope this works.

Left-click on an object that can be picked up:
-If you don't have an item in your hand, then the item you click on becomes your mouse pointer
-If you have an item in your hand, then you drop the item in your hand and pick up the object you clicked on, which is now in your hand

Left-click on the Inventory Menu area (not on an inventory object):
-If you don't have an item, then nothing happens
-if you have an item in your hand, the item is placed in the inventory and your hand is empty

Left-click on an object in the inventory Menu area:
-If you don't have an item, then you pick up the inventory object you clicked on and it is now your mouse pointer
-if you have an item, the item in hand is placed in the inventory and the inventory object you clicked on is now your mouse pointer

Right-click anywhere:
-if you don't have an item, nothing happens
-if you have an item in hand, then the item is dropped to the screen and your hand is empty (mouse pointer is empty hand)


Of course, using an object that you are holding on another object is part of this also.


------------------------
I'm hoping to have this completed by this weekend.
------------------------
---


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


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron