Growlith1223 Posted January 9, 2012 Share Posted January 9, 2012 ok so i added in your code but when i tried using it, it highlighted:``` Call SetPlayerInvItemValue(index, b, Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerInvItemValue(index, b) + GetPlayerY(index)).data2)```any thing that can fix that? Link to comment Share on other sites More sharing options...
Joyce Posted January 9, 2012 Share Posted January 9, 2012 If you tell me what error it gives, I can look into it.. If you report an issue, at least hand me some debug info! Link to comment Share on other sites More sharing options...
Growlith1223 Posted January 9, 2012 Share Posted January 9, 2012 it said something about a runtime error 9 subscript out of range.if you need a screen shot i can make a screen shot of it. Link to comment Share on other sites More sharing options...
Joyce Posted January 9, 2012 Share Posted January 9, 2012 Whoops, I see what I missed there.. I wrote the + portion in the middle of an array.```Sub HandleMapGetItem(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddR As Long, ByVal ExtraVar As Long) Dim b As Long If Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Type = TILE_TYPE_CHEST Then If Val(GetVar("data\chests\" & Trim(GetPlayerName(index)) & ".ini", "Chests_Map_" & Trim(STR(GetPlayerMap(index))), Trim(STR(GetPlayerX(index))) & "_" & Trim(STR(GetPlayerY(index))))) = 0 Then b = FindOpenInvSlot(index, Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).data1) Call PlayerMsg(index, "You opened the chest and found " & Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).data2 & " " & Item(Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).data1).Name, White) Call SetPlayerInvItemNum(index, b, Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).data1) Call SetPlayerInvItemValue(index, b, GetPlayerInvItemValue(index, b) + Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).data2) Call PutVar("data\chests\" & Trim(GetPlayerName(index)) & ".ini", "Chests_Map_" & Trim(STR(GetPlayerMap(index))), Trim(STR(GetPlayerX(index))) & "_" & Trim(STR(GetPlayerY(index))), "1") Call SendInventoryUpdate(index, b) Else Call PlayerMsg(index, "You have already looted this chest!", BrightRed) End If Else Call PlayerMapGetItem(index) End IfEnd Sub```Try this instead. Link to comment Share on other sites More sharing options...
Growlith1223 Posted January 9, 2012 Share Posted January 9, 2012 ok now it's saying Compile error: Expected variable or procedure, not project.and then it's highlightingCall SetPlayerInvItemValue(index, VB, GetPlayerInvItemValue(index, b) + Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Data2) Link to comment Share on other sites More sharing options...
Joyce Posted January 9, 2012 Share Posted January 9, 2012 Because VB is supposed to say b ;] Link to comment Share on other sites More sharing options...
Murdoc Posted January 9, 2012 Share Posted January 9, 2012 @Growlith1223:> ok now it's saying Compile error: Expected variable or procedure, not project.> and then it's highlighting> Call SetPlayerInvItemValue(index, VB, GetPlayerInvItemValue(index, b) + Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Data2)Same thing happened here. I just changed VB to b. Link to comment Share on other sites More sharing options...
Joyce Posted January 9, 2012 Share Posted January 9, 2012 I'm sorting out four or five things at once, and I was working with projects in another screen, so I blindly wrote down vb over there instead of b. :PBut if you can't figure that out, how on earth are you going to make your entire game? :confused: Link to comment Share on other sites More sharing options...
Growlith1223 Posted January 9, 2012 Share Posted January 9, 2012 omg it works!no errors at all, and it fixed the Currency problem!!!Thank you soooo much!EDIT:I thought you meant to put VB sorry XD Link to comment Share on other sites More sharing options...
Joyce Posted January 9, 2012 Share Posted January 9, 2012 Just make sure to make a new folder in Data\ called Chests so your chest data gets stored ;]edit: Updated the original post with my new sub, and removed the useless INI commands. Seriously, GetVar does NOT error unless you're an idiot and screwed it over. Link to comment Share on other sites More sharing options...
Justn Posted January 9, 2012 Share Posted January 9, 2012 Hey thanks yami can't wait to get home and use it!! Link to comment Share on other sites More sharing options...
hisherwin Posted May 25, 2012 Share Posted May 25, 2012 I got a Problem on your Chest system , It worked great but it give unlimited item D: how to fix that? Link to comment Share on other sites More sharing options...
Stein Posted May 25, 2012 Share Posted May 25, 2012 Why are you using this old one anyway? Joyce wrote one that's a lot better. Link to comment Share on other sites More sharing options...
hisherwin Posted May 25, 2012 Share Posted May 25, 2012 Eh i use it , I thought joyce chest system never work on 1.1 but it did :) Link to comment Share on other sites More sharing options...
Alerd Posted October 25, 2012 Share Posted October 25, 2012 It should not be so with time can be drawn from the box and not the subject all the time? Link to comment Share on other sites More sharing options...
Joyce Posted October 25, 2012 Share Posted October 25, 2012 I don't think bumping a 5 month old topic is really appropriate. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now