Counter-Strike 2

Counter-Strike 2

Not enough ratings
How to make a Rock Fight map
By Keplyx
In this guide, I'll show you how to make a map for the rock fight gamemode. Some knowledge of hammer is needed to follow this guide, and it will be illustrated by images and an example/demo map.

I'll cover the basics, then it's up to you to decide your map theme, layout...

I would love to see more maps for this gamemode on the workshop, and if you make one, please give me credit in the description, put a link to this guide, and post your map here, in the comments!!


I made a demo map you can download (.vmf and .bsp, see the download section), so if you are too lazy to read the guide, just load the map in Hammer and in csgo to see how things work. You can also use the map as a complement, to help you understand better the guide.

Anyway, let's start!
   
Award
Favorite
Favorited
Unfavorite
What's Rock Fight?
Rock fight is a gamemode in which your only weapons are rocks, that you can throw at your enemies. The rocks are in fact decoys and smokes, for which the model is changed to a rock, and destroyed before they can activate. Everything is done by 2 scripts, one for the decoy, and one for the smoke.



Why do you have a decoy and a smoke? Because the player doesn't have any weapons, not even a knife, that way, with 2 grenades, he can just spam left click and he will always throw a "rock", he doesn't have to bother about switching weapons.

Those 2 grenades are the only ones that activates themsleves only when they are stoped, so these were a good choice to simulate a rock.

When you make a map for this gamemode, call it rf_"map name". rf -> Rock Fight obviously.

Here is a map I made for this gamemode
"Install" and use the scripts
First, download the scripts: (remove space after "mega.nz")
mega.nz /#!s8VxETID!vfvYrws2FGUw-p-eEWQUkSWrEpZmyDsBYUiZ2KMqLSo
Please credit me if you use those scripts for whatever reason.

You should now have those inside a rock_fight folder 2 scripts: decoycontrol and smoke control.
Move this folder to [counter-strike:go folder]/csgo/scripts/vscripts.

There, you can now use them in hammer, but how?

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=790872702
Demo map in .vmf: (remove space after "mega.nz")
mega.nz /#!hgUm0QzR!hVMgREHF2dd6TkAkaTCSO58WANxBQ6tURQ-4xsX4iHY

In hammer, create 2 logic_script entities. Open the first one and under Entity Script, write rock_fight/decoycontrol, and under script think function, write Think. Do the same for the other entity but with rock_fight/smokecontrol.



That's it!
How they work
To understand how they work, open them, there's comments to help you.

But basically, the script precache the rock model to prevent the game from crashing (an other way to do that would be to place the rock as a prop inside the map), then the Think function is called every 0.1 by the logic_script (I'm not sure if this is exactly 0.1s, maybe this is every tick).
In the Think function, the script tries to find the thrown decoy/smoke, if he finds it, he will change it's model to the rock, then, he checks his speed.
If it's slower than a value, it will get destroyed. The value is not 0, because the Think function doesn't get called enough to destroy the grendes before they can activate. By setting a value higher, we leave anough time to the game to check and destroy the grenades.

This is not perfect, because the grenades can still activates themselves at rare occasions, and if your grenade falls too slowly, it will get destroyed (if you right click by looking right above you, the grenade will get destroyed before going back down).
Pack the scripts
See this guide on how to pack your vscript into your map

This is really important, you will need to do this each time you want to update your map!
Map basics
Now we have the script working in our map. But we still need to remove all the weapons, set infinite ammo and set the players to 1hp.

1hp

Create a trigger around each spawn


Open their properties, and under the output tab, add a new one like this



Now, when the players will spawn, their health will be set to 1.


Remove all weapons

Create a new entity, game_player_equip, and under the flag tab, check Strip all weapons first

Now, go back in the properties tab and disable smart edit (button on the top right corner), and click add
Under key, put weapon_smokegrenade, and under value 1. CLick ok



Click add again and do the same but with weapon_decoy


Now, the player will spawn with only a smoke and a decoy!


Enable infinite ammo

Create 2 new entities: a logic_auto and a point_servercommands. Give a name to the servercommands.

Open the logic_auto properties, go to the output tab, and add a new one like this:
On map spawn, "your servercommands", Comand, sv_infinite_ammo 1.



You now have infinite ammo in your map without enabling cheats!


Advices
I]
You will want to stop the players from shouting everywere "Throwing a grenade!!!". To do that create a custom config file (if you don't know about them, see here) and add the line :
sv_ignoregrenaderadio 1

II]
Remove fall damage. Create a new entity filter_damage_type, give it a name, open it's properties. In filter mode, set disallow.... and in damage type, set FALL.



Now create a trigger around the spawn points (or use the one for the health), and add the output:



!activator and SetDamage filter will be in red, but this is not important.


III]
Try to make the map open, with some walls you can bounce grenades of, and with also some narrow passageways, this will make the map a lot better!
Downloads
Remove space after "mega.nz" (steam is removing the links otherwise)

The scripts:
mega.nz /#!s8VxETID!vfvYrws2FGUw-p-eEWQUkSWrEpZmyDsBYUiZ2KMqLSo

Demo map in .vmf: (remove space after "mega.nz")
mega.nz /#!hgUm0QzR!hVMgREHF2dd6TkAkaTCSO58WANxBQ6tURQ-4xsX4iHY

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=790872702

VIDE[www.tophattwaffle.com]


1 Comments
Furiosa 1 Nov, 2016 @ 4:58am 
Thanks for tutorial, helpful! :steammocking: :steambored: