Making pointshop taunts work :)

Hello i am trying to make taunts work in my pointshop like a player buys a taunt and if they press a key say T it would play the taunt

i know lua i just need to know how to do this i can do the code just need an example. but help would be great

What have you tried so far?

oh hey acecool i lost the scripts but it checked for if the player had the item then used a keypress function then when the key is pressed it would play the sound

Well… Since I did write one to give out…

This is the “bloated” version:
https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/simple_pointshop_taunt_system/item_taunt_oh_no.lua.html
https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/simple_pointshop_taunt_system/sh_taunt_system.lua.html
https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/simple_pointshop_taunt_system/sv_taunt_system.lua.html

And this is the simplified version:
https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/simple_pointshop_taunt_system/item_taunt_oh_no_simplification_solution.lua.html
https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/simple_pointshop_taunt_system/sh_taunt_system.lua.html
https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/simple_pointshop_taunt_system/sv_taunt_system_simplification_solution.lua.html

how would i use this?

The first in the list is the “item”. The second is a shared file where you declare the enumeration for each taunt item you want to use so that the item can see the id. The third file is the back-end ( in the simplified version, everything goes through it ).

It’d need to be put into the pointshop folder, and includes would need to be added so the shared file gets loaded as one of the first, the sv file should be next. The items can just be dropped in.

Hopefully these tutorials and information helps. As always, to view the Lua from any of my tutorials to enable copy/pasting ( HTML doesn’t copy/paste well in terms of HTML / CSS Highlighted Lua ), remove .html from the url.

i dont understand how to use it but?

[editline]20th September 2014[/editline]

well acecool is currently afk so if anyone has any other ways for taunts please do tell lol

Bump

Check out how the Pointshop handles detecting what the player has equipped and then look into the various KeyPress/KeyDown related functions

Niandra but im not good in putting it all together thats why i came here… so u peeps can help

Link me to the pointshop git and I’ll tell you where to add the includes, and AddCSLuaFile. The item just drops into the items folder / nested folder and the system only allows one taunt to be equipped at a time. It forces the user to unequip before equipping another. If I was familiar with pointshop, I’d change it to auto unequip the previous taunt.

Just a note: I have told CertifiedCode where to put the includes in Steam about 3 times now ( the file that pointshop has the includes in, which I am pretty sure it does have an includer file )… I am unsure how you wanted to create a taunt system when you’re unable to look through the files yourself to find where the includes are happening. I am happy to teach those willing to learn, but if you won’t help yourself then there’s nothing more I can do.

https://github.com/adamdburton/pointshop there ace cool

Ok…

Create a new folder inside of pointshop/lua/ called pointshopmods.

so: addons/pointshop/lua/pointshopmods/ exists.

Drop these two Lua files into that folder.
https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/simple_pointshop_taunt_system/sh_taunt_system.lua
https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/simple_pointshop_taunt_system/sv_taunt_system_simplification_solution.lua

Next, modify: addons/pointshop/lua/autorun/pointshop.lua

FROM:


if SERVER then AddCSLuaFile() include "pointshop/sv_init.lua" end
if CLIENT then include "pointshop/cl_init.lua" end
PS:Initialize()

TO:



if SERVER then
	// Must load before pointshop because the items use this code... - Acecool
	AddCSLuaFile( "pointshopmods/sh_taunt_system.lua" );
	include( "pointshopmods/sh_taunt_system.lua" );
	include( "pointshopmods/sv_taunt_system_simplification_solution.lua" );

	AddCSLuaFile( );
	include( "pointshop/sv_init.lua" );
else
	// Must load before pointshop because the items use this code... - Acecool
	include( "pointshopmods/sh_taunt_system.lua" );

	include( "pointshop/cl_init.lua" );
end

PS:Initialize( );

Next… put the following file into addons/pointshop/lua/pointshop/items/taunts/

https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/simple_pointshop_taunt_system/item_taunt_oh_no_simplification_solution.lua

You’ll notice that there are 2 taunts declared inside of sh_taunt_system.lua BUT I only included 1 taunt example…-- ANY TAUNTS YOU ADD… Add the same structure, just follow the pattern…

To add a new taunt, make sure the enumeration exists in the sh_ file…

Change: ITEM.TauntID = TAUNT_OH_NO; – to the new enumeration you used such as TAUNT_OH_NO2
Change: ITEM.Price = 50000; – to whatever you want it to cost.
Change: ITEM.Model = “”; – to include a valid model

Everything below the Model line should be filled in dynamically using the data inside the sh_ file.

Pointshop should take care of the rest.