This article's documentation is for the "GoldSrc" engine. Click here for more information.

Porting maps without decompilation

From Valve Developer Community
Jump to: navigation, search
English (en)Translate (Translate)
Wikipedia - Letter.png
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)
Icon-essay.png
This is an essay.
It contains the advice or opinions of one or more of the Valve Developer Community's contributors.
This page is not an encyclopedia article, nor is it one of the Valve Developer Community's policies or guidelines, as it has not been thoroughly vetted by the community.
Some essays represent widespread norms; others only represent minority viewpoints.


This article is about porting maps to Half-Life Half-Life from other GoldSrc GoldSrc games (Counter-Strike Counter-Strike, Team Fortress Classic Team Fortress Classic, Day of Defeat Day of Defeat and others). The process of porting will not be boring and monotonous. Porting one map approximately takes from 10 minutes to one hour.
Required tools:

  • RipEnt - CMD application from Zoner's Halflife Tools (ZHLT) compiler set.
  • Half-Life Half-Life game with configured AmxModX and "Weapon Factory" plugin, for convenient and fast scattering of items on the map.
  • EntConverter

Introduction

The process of porting is creating Half-Life Half-Life items on the map - weapons, spawn points, and removing items from another game. All information about the objects on the map is stored in text form. We just need to export this information to a text file, edit it and import it back into the map. Creating objects on the map we will be in the game itself, it is very convenient to fly around the map and in suitable places to insert weapons. We will do it with the help of AMX plugin from GordonFreeman'a -- Weapon Factory. Rename the file liblist.gam to liblist_backup.gam, it is located in the directory valve. Now download the archive below and copy all the contents into the valve directory, on all suggestions about substitutions click "Yes". The porting process itself I will demonstrate on the map for Counter-Strike -- fy_kano, the author of which is Burner. Go into the archive, see there the directory cstrike, go into it and unpack all the contents into the directory valve, it is located in the directory with the Half-Life game.

PlacementTip.pngExample:D:\Games\Steam\steam\steamapps\common\Half-Life)

Unpack the contents, but not the cstrike directory itself.

At the first launch of the map in Half-Life game I got the error "Mod_NumForName: models/winebottle.mdl not found".

Such errors occur when a resource (model, sound, sprite) was not found. There are two ways to solve this problem:

Note.pngFix:The first way is to copy used map resources from Counter-Strike game to Half-Life.
Note.pngFix:The second way -- remove or replace information about objects from ent file, in this case we will delete an object on the map or simply replace the object properties, and the game will not search for it, or load another file. With this method you need to be careful and take into account the peculiarities of the map, because some objects can be very important. If there is a helicopter, a tree, a bottle, a person on the map, it can disappear.

Let's consider the second way, because we will have to export information about objects anyway. For this we will use the RipEnt. There are two bat files in the archive I gave, you need to open them and correct the map name to your own, save and run ripent_export.bat

After launching, we will have a new ent file with the name of our map. We open this file and delete unnecessary objects, each object starts with an opening curly brace "{" and ends with "}", between the braces are various directives with properties. The "classname" directive is the name of the object, we will only work with a few: cycler_sprite env_sprite info_player_deathmatch info_player_start game_player_equip ambient_generic

On the map fy_kano we removed all cycler_sprite, game_player_equip, and left one info_player_deathmatch and info_player_start, the rest of the spavens will be placed throughout the map. I also moved some standard files from cstrike to valve. After editing ent file, it must be imported back, for this purpose in the archive there is ripent_import.bat. Import the properties of objects, throw the map in the valve/maps folder and try to run it in the game.

After launching, you may notice the absence of various weapons and items.

Now let's use the Weapon Factory plugin. Type "wp_spawn" in the console and see the menu that appears on the left.

Choose what weapon or item we want to spawn. You can specify the rotation angle of our item. Until the map reloads, all added items will have a holographic effect.

In addition to weapons and ammunition, do not forget to set up a place to spawn players. In the plugin "Weapon Factory" object info_player_deathmatch does not exist, or rather it is there, but it does not work. I usually use the mount as a spawn point, in the text file entity then you can fix weapon_crowbar to info_player_deathmatch.

After we have placed all the items and spawn points, we reload the map ("restart" in the console) and see that our map is full of items. But the porting is not finished, all these items are stored in the database of the plugin "Weapon Factory", and we need to implement all the items in the map itself.

Now we need to convert "Weapon Factory" data into data that can be safely imported into the map. Go to the valve\addons\amxmodx\configs\weapon_factory directory, there should be an ini file with the name of our map, in my case fy_kano.ini. For conversion let's use my EntConverter, copy ent_converter.exe file to the directory with ini files valve\addons\amxmodx\configs\weapon_factory and run it. After that an ent-file with the name of our map should appear, in my case it's fy_kano.ent, all the contents of this file should be added to the ent-file that we exported with RipEnt.


We need to replace weapon_crowbar with info_player_deathmatch. In some cases players can appear in the ground, so we need to increase z-coordinate (height) of the object, don't forget that numbers can be negative.

After saving the final ent-file, it must be imported into the map, to do this, run the file "ripent_import.bat". The map is successfully ported from Counter-Strike to Half-Life. You can check if everything works. Before that, don't forget to delete liblist.gam and rename liblist_backup.gam back to liblist.gam, This way we will disable AmxModx and plugin "Weapon Factory", if you do not do this, then all the items we created will be duplicated. In a similar way you can port absolutely all GoldSource maps. Besides porting, you can add some items to existing Half-Life maps, fix some map problems, etc.

External links


Stub

This article or section is a stub. You can help by adding to it.