CS2D Spacebuild Mod

YouTube video
Space. The final frontier. Is it not the greatest adventure, to build your own ship the way you want and to then fly it into the unknown, exploring strange new worlds? I think so, too.

That is why I’ve started working on an adaptation of Spacebuild for Garry’s Mod. It is a major mod, allowing players to construct their own ships out of building blocks and later pilot them. All parts are pure images and code, no walls shenanigans. The mod has a multitude of tools and settings to facilitate the construction process.

The mod is, of course, in early beta, so many features are still missing or bugged. That state hopefully won’t last long, and I intend to host a public beta testing server so you could experience the mod firsthand.

Much kudos to DannyDeth for helping me with the mod, I truly appreciate it.

In other news, I will be less active throughout January and for some time in the beginning of February for personal reasons. We are sorry for the inconvenience and appreciate your patience.

CS2D’s Most Wanted: Part I

After having received a plethora of messages asking to teach Lua and either declining the offer or disregarding those messages completely (sorry :c), I now have some info about the most demanded scripts and functions for Counter-Strike 2D.

In this episode, we will make a simple virtual money script. I will show how to make the core for the script, that is the money variable itself and things connected to it, like displaying it on the players’ screens. After the explanation of the core module in collapsible boxes will follow different modules that you may require for your script, like sending money to other players or storing them in a bank.

Plan

Let us begin by making a plan of what our script should have.

Plan:

  • A money ‘wallet’ for every player
  • A way to add and subtract money from a player
  • Displaying the amount of money a player has to them

Side features:

  • A way for players to give money to other players
  • A way to store money in ‘bank vaults’

Implementation

Before we start, I’d like to point out that there are two main ways in which you can store variables in a table – first is to store them per player ID in game, and second is to store them per player US ID. Lately, I prefer the latter, because it makes it easier to save things.

So, let us begin with the first point of our plan – making a ‘wallet’ variable.

Now that that’s set, we should make a module that would give a player their starter money once they’ve joined.

This will be extended later. Now, onto some simple money management functions.

Now, there are also two ways to display the money to a player. You could make a function that would update the money on a player’s screen and execute it when the money is changed, or you could make that function and add a hook to it – always, ms100, second, whichever you like the most. For this tutorial I’m going to go with the second way and use the ms100 hook, so it’s not too laggy, and so that there wouldn’t be lots of lines that call the same function. Here’s how:

I use tostring on the money variable so that even if it’s nil or something else that will cause problems when trying to concatenate, it will be turned into a string and eliminate all problems.

Full code:

Additional features

That was the core, now onto some additional features from our side features list that may come in useful.

Transferring money to others

There’s a plethora of ways to make a money exchange system. You could use a chat function, you could drop items on the ground and exchange them for virtual money, et al. I’ll use the chat function way.

Storing money in a bank

Note: If you’ll be using the previous module as well, you’ll have to merge them manually.

Please do leave feedback and let me know what you’d like to see done or redone by posting in the Unreal Software thread, here in the comments or contacting me personally if you like.

UPDATE: I’ve included maxasmg’s suggestion for additional security. Thank you!

Custom Weapons

So I had this nice idea a while ago about making a custom weapons script, but at the time I lacked the skill and the knowledge. Now I took on that project again, and it turned out to be pretty nice actually. Right now I’m working on visual effects and the ammunition system – it’s going to be displayed with real number sprites from CS2D. Quite cool, quite cool indeed. The progress so far can be seen here.

Freelancer 2D in development

Developing just the TF2 mod is pretty boring, so I decided to make a couple of new ones. First one in the series – Freelancer 2D.

There is such a great game called Freelancer, developed by Digital Anvil and published by Microsoft. So I thought – why not make it in 2 dimensions? Well, I started to work on it. Fully editable trading, factions, bases are already done. Missions and other stuff are coming soon. Just have patience – the mod will be awesome, I guarantee you!