Jump to content

Another Entity modding tutorial


Ghost

Recommended Posts

What you will need for this tutorial

  • Q3Map2 (This will be used for compiling your bsp)
  • the bsp you wish to modify (duh!)
  • notepad++ (You will need some sort of text editing program for doing the actual modding. You could use notepad but it sucks)
  • Jedi academy

In order to get q3map2 the easiest way is to install gtkradiant then go to the install folder and copy the q3map2 exe file and all the dll's to the folder where you will be working.

You can get notepad++ from here.

If you dont know how to get jedi academy, i cant help you. Switch off your computer and go think about your life for a while.

How entity modding works

Ok so basically maps in jedi academy are stored as bsp files. A map is made up of what are basically building blocks (called brushes) and entities. Entities are associated with a brush meaning that if, for instance, you make a door you have a brush in the shape of a door and you will then have a door entity which will point to that brush and basically the brush will give the shape and texture and the entity will control where it is, how it behaves e.t.c.

It is possible for for multiple entities to use the same brush. Think of brushes as like a selection of different shapes bricks. You have your selection of different shaped bricks then you have your list of entities which shows which brick to use where and how it should behave.

Entities are always read from the bsp on the server side. Brushes on the other hand are read from the client side. This means that once a map is compiled in radiant, you cannot add any more brushes, any more "shapes" as it where without re-compiling the whole map. You can however re-compile the entities using the brushes already in the bsp. If you do this and put it on a server when a client joins the brushes will be read from their machine but the entities will be read from the server. This allows you to modify a map without a client having to install it.

Coming up in the next post

  • Setting up your system for modding the bsp.

-----------------------------

Setting up your system for modding the bsp

To set up your system for entity modding, first create a folder somewhere that you will work in. Next place the q3map2 files in the folder.

Next we are going to make a batch file which when ran will re-compile a list of entities into an existing bsp file. To make this batch file we should first make a batch file called "compile.bat" or something so you know what it is, then open it in notepad++ and paste the following code into it:
 

@[member='Echo'] off
echo.
echo ============================================
echo ==== Ghosts q3map2 batch file compiler ====
echo ==== That realistically is just a batch ====
echo ==== file that runs a command so really ====
echo ==== dosent warrant so much padding ====
echo ==== And anyone with any computer ====
echo ==== skills whatsoever will probably ====
echo ==== remove this notice ====
echo ============================================
echo.
echo This script requires windows 2000 or newer
echo If you dont meet these requirement then
echo get the hell out, we dont NEED your kind here
echo.
pause
cls
echo.
echo ============================================
echo ==== Ghosts q3map2 batch file compiler ====
echo ==== That realistically is just a batch ====
echo ==== file that runs a command so really ====
echo ==== dosent warrant so much padding ====
echo ==== And anyone with any computer ====
echo ==== skills whatsoever will probably ====
echo ==== remove this notice ====
echo ============================================
echo.
echo Type in the name of your maps ent file
echo without any file extensions then
echo press enter
echo.
SET /P map=ent file name:
cls
echo.
echo ============================================
echo ==== Ghosts q3map2 batch file compiler ====
echo ==== That realistically is just a batch ====
echo ==== file that runs a command so really ====
echo ==== dosent warrant so much padding ====
echo ==== And anyone with any computer ====
echo ==== skills whatsoever will probably ====
echo ==== remove this notice ====
echo ============================================
echo.
echo compiling map: %map%.bsp
echo with ent file: %map%.ent
echo -------------------------------------------------
echo.
q3map2.exe -v -game ja -fs_game base -onlyents %map%.ent
echo.
echo -------------------------------------------------
echo please review the above text for errors to ensure
echo your entities have compiled correctly.
echo.
pause
cls
echo.
echo ============================================
echo ==== Ghosts q3map2 batch file compiler ====
echo ==== That realistically is just a batch ====
echo ==== file that runs a command so really ====
echo ==== dosent warrant so much padding ====
echo ==== And anyone with any computer ====
echo ==== skills whatsoever will probably ====
echo ==== remove this notice ====
echo ============================================
echo.
echo Thank you for using Ghosts q3map2 batch file
echo compiler. For support visit: kas-clan.tk
echo.
pause

save this file and you are now ready to edit the entities of a bsp file! To check you have this setup correctly, run your compile batch file, press enter on the welcome screen then enter "test" as the ent file name and press enter. You should then get a screen up like this:

compilercheck.png

If you have Q3map2 come up complaining that your bsp file dosent exist that means it is working correctly and you have it installed ok.

Coming up in the next post

  • Editing existing entities in a map.

-------------------------------------------
Ok so now we have our environment set up we are going to try editing the properties of an entity already in a bsp file. The first step is to get our bsp file and extract the entity information from it.

Lets start with an easy one, ffa3. Take the ffa3.bsp file and put it in your modding folder. Now open the bsp file with notepad++ and have a look at it. You should see it is mostly gobbldeygook. Press CTRL+f to open the find window and type "worldspawn" then press enter. You should find this take you to something like this:

entfilestart.png

This is the start of your list of entities. entities are stored in the following format:
 

 

{
"key" "value"
}


You want to select everything from the first curly bracket of the first entity to the last curly bracket of the last entity. Now make a new file in notepad++ and paste the text in. Have a look over it to make sure there arent any errors and save this file as "ffa3.ent".

IMPORTANT! it is very important that your .ent file is named exactly the same as your .bsp file.

We now have an entity file which contains all the entities from ffa3. What we do now is compile the entities in this file into ffa3.bsp. This will overwrite all entities that where previously in the ffa3.bsp so if you delete an entity from your entity file then compile it into the bsp the entity will be removed from the bsp.

to check you have made your entity file correctly, lets try compiling the ffa3.bsp with your new entity file. In theory this should remove all entities from the bsp then insert all the ones in your ent file. Since we havent modified anything yet this should appear to have no effect in game.

So with your ffa3.bsp and ffa3.ent files in your modding folder, run your compile.bat file. When asked to enter the name of your .ent file, type in "ffa3" and press enter. If you have done everything right you should then see a screen like this:

compilesuccess.png

But if you screwed something up, you will probably see something like this:

compilefail.png

Take a note of what line number the error occurred on and open your ent file and see whats up.

To doubly make sure everything worked ok, put your new ffa3.bsp into a pk3 so it is in the same location as the ffa3 in the assets files. Make sure it loads after the assets files by calling your pk3 something like "Z_newffa3.pk3" and obviously you want it located at: "maps/mp/ffa3.bsp".

IMPORTANT When i say to "put your new ffa3.bsp into a pk3 so it is in the same location as the ffa3 in the assets files" I do not mean to put your modified bsp file into the assets.pk3 file and overwrite the original, i mean put it into its own pk3 file in the same folder structure as the original bsp. DO NOT PUT ANYTHING IN OR IN ANY WAY MODIFY THE FILES IN YOUR ASSETS PK3's

Assuming everything worked fine you now have a clean ent file which you know works ok. You can now try editing the entities. To start with lets do something simple, find this line in your ent file:
 

{
"soundSet" "city_outdoor"
"music" "music/t1_sour/dealsour_action.mp3"
"classname" "worldspawn"
"message" "Tatooine FFA"
}

This is the worldspawn entity of the map. change the "message" keys value to some thing like this:
 

{
"soundSet" "city_outdoor"
"music" "music/t1_sour/dealsour_action.mp3"
"classname" "worldspawn"
"message" "I AR MODDER OMGWTFHAXOR"
}

You can also put in a comment by starting a line with //, i find this is usefull for keeping trrck of what i have changed in a ent file, so you can do something like this:
 

{
"soundSet" "city_outdoor"
"music" "music/t1_sour/dealsour_action.mp3"
"classname" "worldspawn"
// message changed by ghost because i am awesome.
"message" "I AR MODDER OMGWTFHAXOR"
}

Now follow the steps tyou used before to compile the entities back into the bsp. When you start up ffa3 now you should see your message instead of "Tatooine FFA"!

This is the basics of modding entities. You may be thinking hey there are so many entities how do i know what i can do with them? well if you open up gtkradiant and press "N" to get up the entity window and you can see all the information on the keys and values for all the entities in JKA, neat huh? So for example if we look at the entry for "worldspawn" we get this:
 

Every map should have exactly one worldspawn.
"music" music wav file
"gravity" 800 is default gravity
"message" Text to print during connection process

BSP Options
"gridsize" size of lighting grid to "X Y Z". default="64 64 128"
"ambient" scale of global light (from _color)
"fog" shader name of the global fog texture - must include the full path, such as "textures/rj/fog1"
"distancecull" value for vis for the maximum viewing distance
"chopsize" value for bsp on the maximum polygon / portal size
"ls_Xr" override lightstyle X with this pattern for Red.
"ls_Xg" green (valid patterns are "a-z")
"ls_Xb" blue (a is OFF, z is ON)

"fogstart" override fog start distance and force linear
"radarrange" for Siege/Vehicle radar - default range is 2500

So if we wanted to mod ffa3 so that the map has half gravity, we would just add this into the worldspawn entity in our ent file:
 

"gravity" "400"

Look around, experiment with stuff and learn what entities correspond to what part of the map and you will soon be creating weird and wonderfull maps!

mairontai and Nardja like this
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...