Glitch with inventory

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

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

Glitch with inventory

Postby crimsonthread » Sun Oct 12, 2008 6:28 pm

I have a question about loading a saved game:
I have an item in the inventory that I use to examine other items that can be collected. I used Action.AddItem "nameofimage" (where name of image has been replaced with the real image name of course) and it all works fine.
But when I use the default save feature and load the saved game I get TWO images instead of just the one.
I have tried some solutions such as "if" variables with little luck. Also searched the forums for answers and the help pages with no luck. How can I solve this?
crimsonthread
Junior Member
 
Posts: 6
Joined: Sat Aug 02, 2008 10:44 pm

Postby Lyberodoggy » Sun Oct 12, 2008 6:41 pm

Hmmm... You could solve it. By adding this code in the Execute some code every time a game is loaded:

Code: Select all
If HasItemInstances("Itemsname")>1 Then Action.RemoveItem "itemsname"



Then add this to VBS Procedures:
Code: Select all
Function HasItemInstances(ItemName)

 HasItemInstances = 0
 For Each X in InventoryItemObject
  If X.Tag = ItemName Then
  HasItemInstances=HasItemInstances+1
  End If
 Next

End Function
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Sun Oct 12, 2008 9:02 pm

Just wanted to add..you can also put this in the frame..the first frame that loads..This worked for me in my last project, but the user has to go to the frame to retrieve it though..[for it to automatically appear in inventory].If the game is loaded already being the first frame..If they hit save..and go back..I assume it should still be there..and only one item..

Code: Select all
If Magnifier = 0 Then
  Action.AddItem "Magnifier"
  Magnifier = 1
End If


Just replace the Magnifier with what u want..

Peace
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby crimsonthread » Sun Oct 12, 2008 11:02 pm

Thanks for the tips! Lyberodoggy's solution seems to work. :)

However, now a new problem has come up--if you try to examine one item right after you examine another one, you are stuck. The game will only toggle back and forth between the two items displayed when you try to exit the screen. The game uses the GoBackToaAPreviousFrame V1 plugin--some items have multiple frames to examine. Any ideas for this one?
crimsonthread
Junior Member
 
Posts: 6
Joined: Sat Aug 02, 2008 10:44 pm

Postby Mystery » Mon Oct 13, 2008 12:11 am

Hi Crimson,

Indeed it doesn't work well with 2 items as point out in this thread:
http://www.adventuremaker.com/phpBB2/vi ... php?t=3082

Since - to my knowledge - the plugin has not been modified yet to solve this problem as mentioned by GM-Support, the game creator will probably need to use GM-Support's first suggestion for the time being.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby mercedes » Mon Oct 13, 2008 3:10 am

Actually, u can do this method if you like......I used Hotspots to make this happen..but u can also use frames ..:)

Create a variable for each item description image.
and a VARIANT variable called FRAMEVAR

Create 2 hotspots on the FRame..One for IMAGE Description..---Make it transparent..

One for X that is already on the image..--drawn on it..
You draw an X to look like they can close each image description....at the top right corner..on each one.--Is just one way..

Make sure each image description..is exactly the same size as the hotspot.
Does't matter what size..just make sure hotspot.move is the size of image..it looks better. For example mine is 395 x 324

Put this in the Manage Inventory items..with using items on each other..

So if its magnifying glass..being used on the Key lets say..

Put this..in the Advanced

Code: Select all

ShowKey=1

If ShowKey = 1 Then

Action.LoadAPicture Hotspot(1),"Key.jpg"
Hotspot(1).move 237*15,148*15,395*15,324*15
Framevar = Action.GetCurrentFrameName
End If


THen put in the using items on each other..Magnifying glass on say the Light ...

Put this in the Advanced.

Code: Select all

ShowLight=1
If Showlight = 1 Then

Action.LoadAPicture Hotspot(1),"Light.jpg"
Hotspot(1).move 237*15,148*15,395*15,324*15
Framevar = Action.GetCurrentFrameName
End If



In the X hotspot put this..

Code: Select all
Action.GoToFrame Framevar


That should do it...:D

With this..they can keep dragging the magnifyier on each item..and for whatever item.---A picture will load-- and it won't matter the order , nor the frame they choose to examine the items..and they can do it right after the last one..so it won't matter if they keep doing so.
They can close the image..when they choose..:)--Only one image description appears at at time..and they close the image when done viewing it..Or not..the next one will load either way..when they drag an item onto the next one..In this case magifer..

Peace~
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron