Entitiy Editing Tutorial - Instances [Beginner]

kawa

Member
Hello everyone,
This will be a tutorial on how to add entities to existing maps with 1fx mod (works for most server mods).
I will assume you have no prior knowledge about the topic. I am making this quick guide to help recover some of the lost content after the forum's server incident.



Quick setup:
(Skip if you already have 1fx mod installed and you know how to setup the maps)

Download 1fx mod here, I will be showing examples on windows 10, for sof2 full v1.00 (while it is possible to run 1fx mod on a variety of operating systems, to see your edits, you will have to go in-game which only works on windows as far as I know).
1616000473964.png
Open the .zip file and extract everything in the "Server files" folder into your game-folder, where your sof2mp.exe is located (you can use 7zip to open compressed files), the release I am using (0.82) includes a clean executable and a folder called "1fx".
1616000847395.png
now just open the server by clicking the "Start Server" batch file and type g_gametype [game type] and devmap [map name]
or combined:
1616001605969.png



Entity Files:

Now that you have everything setup, we can procceed to the entity files.
in your game folder, go to 1fx>maps>[gamemode] (my exmaple: 1fx>maps>h&s)
1616001338572.png
open the .ent file you wish to edit with a text editor (I will be using inf.ent for this example).
1616001370820.png
Here you can find all the filtered .ent files in a compressed zip.

In these files you will see entities wrapped in curley brackets "{ }" each opening and closing brackets represents an entity.

Every entity is constructed via keys and values in the following order: "Key" "Value".

The entity's name would have the "classname" key assigned to it, for example in the inf.ent file we can see the first entity's classname is "worldspawn", it has two attributes associated with it, "redteam" and "blueteam" which values specify the character skins each team will be assigned (note that h&s mode in this case bypasses this in 1fx mod), There are a lot of different attributes you could attach to a certain entity, I will not go into depth on the different options in this tutorial though.

The first entity you should know how to add is the "gametype_player" entity, which represent a spawn point, without spawn points you and others will not be able to spawn in the map. the code for it would be (red text will be the description for important values):
{
"classname" "gametype_player" // The name of the entity
"spawnflags" "2" // Which team would this spawn point be used for (0/1/2 - deathmatch / red / blue)
"count" "0"
"origin" "0 0 0" // Where will this spawn point be created in the map
"angles" "0 0 0" // Which angles will the entity be rotated to

}
I will not go into depth on what each attribute does if it is not important for the understanding of the basic functionality of the entity.
To know the position of your character in-game you can use the cvar /viewpos



Adding static models:

Now that we know how to find the position in-game and how to edit the .ent file, we can experiment with some static objects.
the entity we will be working with is called "misc_bsp":
{
"classname" "misc_bsp"
"bspmodel" "instances/colombia/npc_jump1"
"origin" ""
"angles" "0 0 0"

}
Now lets try to place a box in the map, head to your .ent file and add the code above, go in-game and enter your server (could be under "Local"), get in and stand where you want to place the box, type in console (~) "/viewpos" and edit the origin to the first 3 numbers you see on screen (in my case: 99 -978 609) so your origin attribute should look like this: "origin" "99 -978 609"
1615999681847.png
Save the file (ctrl + s) and restart your map with the cvar "map_restart 0" in the server console (or in game after making yourself S-admin "addsadmin [id]")
and the box should appear where you were standing:
1616000121697.png
for a full list of instances you can use go here.
Note that each time you save the edits on the .ent file, you will have to restart the map to see the changes.
With simple math and a little practice you can edit larger areas at once, I recommend an advanced text editor for serious map editors such as Notepad++, Vs Code, Atom etc... but any text editor will do for simple tasks like the example above.
 
Last edited:
Top