.
This tutorial is dedicated to Jeff "gdiddy62".
(I am sorry that it took me so long to make it)
Dear all,
I will try to create a tutorial that shows how to add these things into a map via .ent files:
- particle effects
- models
- sounds
This tutorial will focus on the DarkPlaces engine, because it makes use of dpextensions.
First of all, we need a tiny QC modification to be able to do this.
It is already implemented into the "small mod compilation", but you can of course use the tiny extra code in your mod as well (QC-Download see below) if you do not use the "small mod compilation".
Now we must create the map�s .ent file, which we will modify later on.
You can create an .ent file for every map (custom or stock ID1).
Start your map (example e4m3) and open the console. Then type:
sv_saveentfile
The e4m3.ent file is now in your maps folder.
Be careful, existing files will be overwritten !!
1.) Add sounds into maps
I want to start with adding sounds in maps, because it is the easiest thing.
We will make use of the dpextension DP_SV_POINTSOUND here.
Lets say, you want to add ambience lava sound to lava pools in Quake.
You only need the sound file in .wav format.
(there are very nice free sound files available on the internet)
Put it into you subfolder: ID1\sound\ambience
Lets say it is called: lava_ambience.wav
(you will find this file in the "small mod compilation")
Next thing you need to know is the map-coordinate where it shall be.
In this case it should be the center of the lava pool.
To find the coordinates, DarkPlaces helps you with a build in function:
RTLIGHTS Editor
So start your map of choice, which you want to modify (example the start map).
Then type: r_editlights 1 in the console.
A cursor will appear which will tell you exactly the X/Y/Z coordinates of everything you want.
Now walk over to the "Hard" difficulty entrance of the start map and find the lava pool.
The best thing is to use noclip, to be able to go everywhere.
The rtlights Editor tells us that the center of the pool is at:
X/Y/Z: 860/1000/-96
The last thing we need to know is the length of our .wav file.
I implemented a QC-function that lets us play a loop.
The length of our lava_ambience.wav file is: 3.5 seconds
Now we have all informations we need and can modify the .ent file:
Open it with notepad or a similar program.
Add this block right after the 1st block and save it.
Adjust the volume to your personal likings (1= max, 0= min).
So it will look like this for our example (start map):
Next time we start the start map, we will hear a nice lava ambience sound near the lava pool. The further we go away from the lava pool, the more silence the sound will become.
The loop time is the same as the .wav file length, as you noticed !
So we will hear the sound in an endless infinite loop.
If you want to play a short sound file every 10 seconds (like a drop sound in a stalactite cave for example), simply put "count" "10" into the block.
This will play the stalactite drop sound every 10 seconds.
You an also have random sound loop times with a few more code lines.
2.) Add models into maps
Now we will talk about adding models into maps, because it is also very easy.
Lets say you want to add a wooden barrel into a map.
You only need the model itself.
(there are very nice free models available on the internet)
Put it into you subfolder: ID1\progs
Lets say it is called: ton.mdl
Next thing you need to know is the map-coordinate where it shall be.
To find the coordinates, DarkPlaces helps you with a build in function:
RTLIGHTS Editor
So start your map of choice, which you want to modify (example e4m3 map).
Then type: r_editlights 1 in the console.
A cursor will appear which will tell you exactly the X/Y/Z coordinates of everything you want.
The best thing is to use noclip, to be able to go everywhere.
In our example we want to place the wooden barrel into the middle of the room:

The rtlights Editor tells us that the center of the room is at:
X/Y/Z: 80/256/4
That is all we need to create our .ent file modification now.
These following features/properties can be set/adjusted in addition:
A) transparency
B) scale (= size)
C) angle
D) solid / non-solid
E) bbox size (hit size)
Open the .ent file with notepad or a similar program.
Add this block right after the 1st block and save it.
So it will look like this for our example (e4m3 map):
If you want to be able to walk right through a model, it must be "non-solid",
if you want the model to block your way (or makes grenades bounce on it)
it must be "solid".
If you want it "solid" you also have to set a "bbox size".
That is the size of the model that interacts with the game mechanics !
You can see the bbox size in DarkPlaces when you use this cvar:
It colors the bbox and makes it visible for your convenience:
without bbox-display:
with bbox-display:
In the above example the bbox size is just low enough to be able to jump on it:

This way you can put interactive or non-interactive models into your maps.
With a few QC-lines more you can also decide to make them use GYRO or not.
The "small mod compilation" uses this feature.
So you can make them even more "interactive"
Character limit almost reached !
Please continue to read in next post how to add particle effects into maps.
.
This tutorial is dedicated to Jeff "gdiddy62".

(I am sorry that it took me so long to make it)
Dear all,
I will try to create a tutorial that shows how to add these things into a map via .ent files:
- particle effects
- models
- sounds
This tutorial will focus on the DarkPlaces engine, because it makes use of dpextensions.
First of all, we need a tiny QC modification to be able to do this.
It is already implemented into the "small mod compilation", but you can of course use the tiny extra code in your mod as well (QC-Download see below) if you do not use the "small mod compilation".
Now we must create the map�s .ent file, which we will modify later on.
You can create an .ent file for every map (custom or stock ID1).
Start your map (example e4m3) and open the console. Then type:
sv_saveentfile
The e4m3.ent file is now in your maps folder.
Be careful, existing files will be overwritten !!
1.) Add sounds into maps
I want to start with adding sounds in maps, because it is the easiest thing.
We will make use of the dpextension DP_SV_POINTSOUND here.
Lets say, you want to add ambience lava sound to lava pools in Quake.
You only need the sound file in .wav format.
(there are very nice free sound files available on the internet)
Put it into you subfolder: ID1\sound\ambience
Lets say it is called: lava_ambience.wav
(you will find this file in the "small mod compilation")
Next thing you need to know is the map-coordinate where it shall be.
In this case it should be the center of the lava pool.

To find the coordinates, DarkPlaces helps you with a build in function:
RTLIGHTS Editor
So start your map of choice, which you want to modify (example the start map).
Then type: r_editlights 1 in the console.
A cursor will appear which will tell you exactly the X/Y/Z coordinates of everything you want.
Now walk over to the "Hard" difficulty entrance of the start map and find the lava pool.
The best thing is to use noclip, to be able to go everywhere.


The rtlights Editor tells us that the center of the pool is at:
X/Y/Z: 860/1000/-96
The last thing we need to know is the length of our .wav file.
I implemented a QC-function that lets us play a loop.
The length of our lava_ambience.wav file is: 3.5 seconds
Now we have all informations we need and can modify the .ent file:
Open it with notepad or a similar program.
Add this block right after the 1st block and save it.
Adjust the volume to your personal likings (1= max, 0= min).
So it will look like this for our example (start map):
Code:
{ // this is the original 1st block of start map "sounds" "4" "classname" "worldspawn" "wad" "gfx/start.wad" "message" "Introduction" "worldtype" "0" } { // this is OUR new block "classname" "info_notnull" "origin" "860 1000 -96" // represents coordination "nextthink" "0.1" // must always be like this "alpha" "0.9" // represents volume (1= max, 0= min) "count" "3.5" // represents time loop (in seconds) "think" "sound_think" // must always be like this "model" "sound/ambience/lava_ambience.wav" // file path }
The loop time is the same as the .wav file length, as you noticed !
So we will hear the sound in an endless infinite loop.

If you want to play a short sound file every 10 seconds (like a drop sound in a stalactite cave for example), simply put "count" "10" into the block.
This will play the stalactite drop sound every 10 seconds.
You an also have random sound loop times with a few more code lines.
2.) Add models into maps
Now we will talk about adding models into maps, because it is also very easy.
Lets say you want to add a wooden barrel into a map.
You only need the model itself.
(there are very nice free models available on the internet)
Put it into you subfolder: ID1\progs
Lets say it is called: ton.mdl
Next thing you need to know is the map-coordinate where it shall be.
To find the coordinates, DarkPlaces helps you with a build in function:
RTLIGHTS Editor
So start your map of choice, which you want to modify (example e4m3 map).
Then type: r_editlights 1 in the console.
A cursor will appear which will tell you exactly the X/Y/Z coordinates of everything you want.
The best thing is to use noclip, to be able to go everywhere.
In our example we want to place the wooden barrel into the middle of the room:

The rtlights Editor tells us that the center of the room is at:
X/Y/Z: 80/256/4
That is all we need to create our .ent file modification now.
These following features/properties can be set/adjusted in addition:
A) transparency
B) scale (= size)
C) angle
D) solid / non-solid
E) bbox size (hit size)
Open the .ent file with notepad or a similar program.
Add this block right after the 1st block and save it.
So it will look like this for our example (e4m3 map):
Code:
{ // this is the original 1st block of e4m3 map "sounds" "9" "worldtype" "0" "wad" "gfx/medieval.wad" "classname" "worldspawn" "message" "The Elder God Shrine" } { // this is OUR new block "classname" "place_model" "origin" "80 256 4" // represents coordination "model" "progs/ton.mdl" // file path "alpha" "1" // represents transparency (0= max, 1= min) "count" "1.1" // represents scale/size (bigger value = bigger size) "angles" "0 40 0" // represents angle (X Y Z) "sold" "1" // model is solid (=1) or non-solid (=0) "sizemin" "-15 -15 -2" // represents min bbox size "sizemax" "15 15 35" // represents max bbox size }
if you want the model to block your way (or makes grenades bounce on it)
it must be "solid".
If you want it "solid" you also have to set a "bbox size".
That is the size of the model that interacts with the game mechanics !
You can see the bbox size in DarkPlaces when you use this cvar:
r_showbboxes 1
without bbox-display:


In the above example the bbox size is just low enough to be able to jump on it:

This way you can put interactive or non-interactive models into your maps.
With a few QC-lines more you can also decide to make them use GYRO or not.
The "small mod compilation" uses this feature.
So you can make them even more "interactive"

Character limit almost reached !
Please continue to read in next post how to add particle effects into maps.
.
Comment