Creating a Credits System in Source

Hey all. For a map I’m making I wanted to make a system where you can earn credits for getting kills and can buy guns from a credit shop. I know it sounds far fetched, but I know Source can do a lot of things. Is it possible to create a system like this? If so, what would I need to create it? Thanks.

Nope.

[editline]1st July 2014[/editline]

Unless you make your own mod of course

EDIT: How is this dumb? I stated the reality of the situation that doing this with map entities would be near impossible

This would be something very advanced and maybe not even possible, but look into targetnames, filters, and the math_counter entity.

It is possible and actually is pretty easy to do through code but through map entities alone I’m not sure since you would need to take into account players joining and leaving.

What game/mod is this for? If it’s for L4D2 or a later Valve game, I would seriously, seriously recommend looking into VScript.

Also, a system like this will be monumentally easier to implement if it’s singleplayer.

Check out the Obsidian Conflict mod at www.obsidianconflict.net , and check out their documentation or forums for info on their points system. I don’t know if you would want to make a map with the system yourself that would work everywhere or not, but I know OC has a functional enough points system that several maps take advantage of in almost precisely in the way that you described. There’s also creative uses of it like a re-imagining of Harvest Moon in the Source engine. There’s several maps in that game where you kill NPCs, get points for doing so and then come to a merchant where you can exchange your points for guns, ammo / HP and AP powerups and some other items. Oh, and I almost forgot to mention that this is all multiplayer compatible.

It’s for CS:GO, if that’s any help. Thanks for the link, I’ll check it out.

[editline]1st July 2014[/editline]

Sounds great, I’ll take a look at it, thanks.

Checkout https://developer.valvesoftware.com/wiki/CSGO_Custom_Game_Mode
Vscript would really help aswell

Oh if it’s for CSGO then it’s definitely possible using vscripts. I would look at some of the stuff people have done with L4D2 for examples.

If you were to have a team based scoring, you could do it via source entities alone – per player would be much harder

The way I would do it:

  • Have two trigger_multiple that covers the entire map, have it filtered to only trigger for players (one for each team also)
  • Have a maths counter for each team, attach the OnEndTouch event to the maths counter – so when a player dies, they will stop touching the trigger, and add a point to the enemy team

You can have score counters (and change them) using env_texturetoggle, 4 for each team – one for each digit

For a simple version, have a button for each weapon, when you press the button, it checks if there are enough points (logic_compare), if so, it removes the points needed, then spawns the gun