• WIP: PointShop
    528 replies, posted
I agree.
Is it working for anyone else? I am unable to buy items.
I've got a suggestion -- although there is an inventory, you can't specify which item you would like to use for each category.
[QUOTE=samm5506;25925701]I've got a suggestion -- although there is an inventory, you can't specify which item you would like to use for each category.[/QUOTE] I think what he's saying is that you should be able to toggle, I.E, what player model you want to use after you've bought it. Although I could be wrong, I haven't used this in awhile :\
[QUOTE=Crap-Head;25924692]-Suggestion- Add an option in the config where you Can sellect how many points the player shuld start with.[/QUOTE] Will add this. [QUOTE=samm5506;25925701]I've got a suggestion -- although there is an inventory, you can't specify which item you would like to use for each category.[/QUOTE] This does not make sense. If you don't want an item to be active, sell it.
Did you add Q, to the available buttons?
[QUOTE=_Undefined;25929624] This does not make sense. If you don't want an item to be active, sell it.[/QUOTE] But then you loose the difference of buying it and selling it back again.
[QUOTE=quacles;25931510]Did you add Q, to the available buttons?[/QUOTE] Not yet. I'll have to modify a few bits to make it work. [QUOTE=tgp1994;25932043]But then you loose the difference of buying it and selling it back again.[/QUOTE] No other shop does this. Don't buy it if you don't want it active.
For the player model items, it might make it easier (and set a good example) if, when the SetModel function is called, it uses the ITEM.Model variable, rather than the same string typed over again. (That will work, won't it?)
[QUOTE=tgp1994;25942021]For the player model items, it might make it easier (and set a good example) if, when the SetModel function is called, it uses the ITEM.Model variable, rather than the same string typed over again. (That will work, won't it?)[/QUOTE] Good point, thanks. Updated. I think I created them before I was passing the item data to the function.
[QUOTE=_Undefined;25945727]Good point, thanks. Updated. I think I created them before I was passing the item data to the function.[/QUOTE] Ooh, is it possible through LUA to detect what materials and model files a player model depends on, so you can include them? I want to add specific player models to the shop, and right now it's looking like I'll have to write my own lua download scripts :\ [editline]8th November 2010[/editline] I also noticed that I've been getting a glon.lua error with the new PointShop, seemingly every time someone joins (although I could be wrong there). The exact error reads: [b]Timer Error: [@lua\includes\modules\glon.lua:381] Expected string to decode! (Got type table)[/b] Methinks a decode/encode function was perhaps misplaced somewhere? (This happens with and without the pdatamysql addon.) [editline]8th November 2010[/editline] Oh, cool, nevermind :D Apparently, using the [b][url=http://wiki.garrysmod.com/?title=Resource.AddFile]Resource.AddFile [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] function, when you only use it to add the .mdl file, it will automagically include the relative model and material files! So I think you'd be able to pull this one off no sweat, if we specify so in the playermodel file. [editline]8th November 2010[/editline] Also, I seem to be having haydenbinkley's problem now. I cannot purchase anything, despite having adequate funds. No errors pop up clientside or serverside, despite the one I mentioned that appears seemingly when a player joins (on serverside).
It works fine in SP, but now datastream and glon (and RunConsoleCommand) just don't seem to be working in multiplayer... I'll look into it later.
[QUOTE=_Undefined;25950982]It works fine in SP, but now datastream and glon (and RunConsoleCommand) just don't seem to be working in multiplayer... I'll look into it later.[/QUOTE] Are you sure it wasn't a simple misteak of using the encode function where you should be using the decode function, or vise versa? It seems like you're trying to pass an already decoded table to the decode function. [editline]9th November 2010[/editline] Line 120 of sv_player_extension.lua seems to be the only place this error can occur on, so it must be somewhere there :\
ValidateItems takes a decoded table, which glon.decode is passing to it. All I can think is that the PointShop_Items PData isn't returning a glon encoded string...
[QUOTE=_Undefined;25961430]ValidateItems takes a decoded table, which glon.decode is passing to it. All I can think is that the PointShop_Items PData isn't returning a glon encoded string...[/QUOTE] print() debugging time :\
I just installed the SVN version and now i cant buy anything. No errors or anything i click the item and it just goes back to the selection, any help?
[lua]ITEM.Name = "Plasma Trail" ITEM.Enabled = true ITEM.Description = "Gives you a team colored plasma trail." ITEM.Cost = 200 ITEM.Material = "trails/plasma" ITEM.Functions = { OnGive = function(ply, item) item.Hooks.PlayerSpawn(ply, item) end, OnTake = function(ply, item) SafeRemoveEntity(ply.Trail) end } ITEM.Hooks = { PlayerSpawn = function(ply, item) if not ply.Trail then ply.Trail = util.SpriteTrail(ply, 0, team.GetColor(ply:Team()), false, 15, 1, 4, 0.125, "trails/plasma.vmt") end end }[/lua] What's the point of ITEM.Material if it's never used? [editline]10th November 2010[/editline] Where the second "trails/plasma.vmt" is, the item should be. right? [editline]10th November 2010[/editline] I know it was reported, not sure if you updated anything in the SVN though. Anyway, still getting "Timer Error: [@lua\includes\modules\glon.lua:381] Expected string to decode! (Got type table)"
[QUOTE=Banana Lord.;25982170] What's the point of ITEM.Material if it's never used? Where the second "trails/plasma.vmt" is, the item should be. right? [/QUOTE] Sounds just like a fix that was applied earlier to the model files. You can replace the second occurrence of the string with item.Material, rather than typing it out again. [QUOTE=Banana Lord.;25982170] I know it was reported, not sure if you updated anything in the SVN though. Anyway, still getting "Timer Error: [@lua\includes\modules\glon.lua:381] Expected string to decode! (Got type table)" [/quote] Yup, that's the bug that's disabling us from buying anything.
[QUOTE=tgp1994;25985702]Yup, that's the bug that's disabling us from buying anything.[/QUOTE] Well buying items works for me. I have 2 problems/bug reports. 1. When you sell the gravity it doesent dissapears befor you restart your game. 2. When you buy something and restarts the game you cant see ANYTHING in your inventory befor you kill yourself.
[QUOTE=Crap-Head;25991924]Well buying items works for me. I have 2 problems/bug reports. 1. When you sell the gravity it doesent dissapears befor you restart your game. 2. When you buy something and restarts the game you cant see ANYTHING in your inventory befor you kill yourself.[/QUOTE] After running SVN Update, what version are you at? The problem is still there for me, and seemingly everyone else. Speaking of which, any updates on that fix, _Undefined?
Social life has taken over my life, so no. If someone can provide a fix I'll add it to the SVN, but I don't have time right now or in the foreseeable future...
[QUOTE=_Undefined;26001443]Social life has taken over my life, so no. If someone can provide a fix I'll add it to the SVN, but I don't have time right now or in the foreseeable future...[/QUOTE] Dang (In some sort of way). This project was and is amazing. I will be working on this and implanting it for my gamemode. If thats okay with you. Hopefully it is. I dont want to see this die :/
it wasnt even around for a week :(
Does anyone have a few versions before hand? Back when you could buy stuff?
[QUOTE=ryanfilps;26002519]Does anyone have a few versions before hand? Back when you could buy stuff?[/QUOTE] Is your problem buying stuff in singleplayer or is it in multiplayer we are speaking? EDIT: Ahh FUUU! Just tryed it in multiplayer and i have the same problem as everyone else. Cant buy anything. _Undefined could you take a few minuts to fix this problem? Or put your SVN back to when it worked. It would be amazing if you could.
[QUOTE=Crap-Head;26002704] EDIT: Ahh FUUU! Just tryed it in multiplayer and i have the same problem as everyone else. Cant buy anything. [/QUOTE] Yeeeeuuup :) [editline]11th November 2010[/editline] I'll be poking around it, looking for a fix.
[QUOTE=tgp1994;26003170]Yeeeeuuup :) [editline]11th November 2010[/editline] I'll be poking around it, looking for a fix.[/QUOTE] If you find a fix are you whiling to post it here? Or are you gonna keep it for you yourself?
Just revert your SVN revision...
[QUOTE=Crap-Head;26003463]If you find a fix are you whiling to post it here? Or are you gonna keep it for you yourself?[/QUOTE] Oh, I'll definitely post it here. What kind of a jerk would keep it to himself :( [editline]11th November 2010[/editline] Ok, I've been able to debug it up to a specific spot: The function POINTSHOP.FindItemByID() seems to constantly fail, no matter what the item is. I'll continue to look into that... [editline]11th November 2010[/editline] A[i]hah[/i]! I believe I have found the source of the problem :D It seems like, at some point, the item names are converted to all [I]lowercase.[/I] However, the table POINTSHOP.Items retains those items in their original casing. Thus, in sh_pointshop.lua on line 8, when it tries to compare name to item_id, it will come back false, unless the original item name happened to be in lower case already. I [I]think[/I] all we have to do is add a string.tolower() function (I think that's it, I'll go rtfm and come back) I'll be back with the fix :) [editline]11th November 2010[/editline] Also found a bug on line 22 of sh_pointshop.lua, similar concept to the above one: item names are all lowercase'd, but it attempts to compare them to a normal, mixed case name. I seem to have fixed that by string.lower()'ing the name variable. Patch will be posted in a sec, still testing it :) [editline]11th November 2010[/editline] [B]Find[/B] in sh_pointshop.lua on [I]lines 8-10[/I] [lua] if name == item_id then return item end [/lua] [B]replace with[/B] [lua] if string.lower(name) == item_id then return item end [/lua] [B]Find[/B] in sh_pointshop.lua on [I]lines 22-24[/I] [lua] if name == item_id then return category end [/lua] [B]replace with[/B] [lua] if string.lower(name) == item_id then return category end [/lua] Just noticed that, despite items being purchased, they still do not function. I'll continue looking into that. Hope this can be committed to the repo soon :)
Your fix, fixed buying for my server. [editline]11th November 2010[/editline] Wearing hats doesn't work, and needs an option to put on a certain trail or hat.
Sorry, you need to Log In to post a reply to this thread.