Hello Mathuzzz,
Great news, that you managed to compile your map
You mentioned that you found fitting Hexen2 models.
Could you please share the link, where you found them ?
Because I always search for these kind of models too.
Thank you.
Regarding the question to bring new models into H2:
I am a bloody beginner with .hc
But I also was playing around with .hc recently and I think I can help you.
Of course, if Spike can jump in and explain it, it would even be better
1.) It all starts with calling the models via its specific function in your .bsp:
Let us follow the procedure with the regular model:
chair.mdl
This is how it could look in the mapīs ent file:
2.) With that, your map calls the specific entity function (in our case the regular chair)
It is inside object.hc:
3.) The CreateEntityNew line calls the universal "entity-Spawner" function together with all necessary arguments for that special entity (in your case the chair).
The function CreateEntityNew is inside spawn.hc
4.) Inside the universal CreateEntityNew function, the given arguments are used to call the 2 important functions:
- entity_spawnvalues
- entity_box
(both are also inside spawn.hc)
Several other things are also done, but that is not so important in our case.
5.) The entity_spawnvalues function contains the necessary values for the chair.
There are 6 spawn-value fields for each entity !
The function knows (because of the given arguments), that it is ENT_CHAIR, so it uses this line (with its given values) for the chair.
6.) The entity_box function contains the necessary values for the chairīs bbox size.
There are 2 fields for each entityīs bbox !
The function knows (because of the given arguments), that it is ENT_CHAIR, so it uses this line for its values.
That is the regular precedure from .bsp to in-game spawning of entities.
If you want to add new entities, you have to create new functions and lines where necessary.
ATTENTION:
Hexen 1.11 has theses values for its functions:
Hexen 1.12a has theses values for its functions:
The mission pack uses more models and needs therefore more values in both spawn functions !
There is a comment in HC source 1.12a that tells you the formular for these values.
You MUST modify the values, if you add additional models into your map/hc:
Formulars are:
- for entity_spawnvalues: 6 * (float of your highest ENT + 1)
- for entity_box: 2 * (float of your highest ENT + 1)
Original Hexen2 uses 75 models + world = 76
Portals uses 91 models + world = 92
Example:
If you want to add 2 new models into original Hexen2, your function must look like this:
Dont forget to add the 2 new lines with the models values in both functions.
Beside the extension of these 2 functions inside spawn.hc, you must also add the specific model functions in object.hc.
Remember, the one for the chair was: void obj_chair ()
These new functions for your model will be used/called inside your map (.bsp).
You have to bring them somehow into your mapping tool (or add it via .ent files is a dirty solution), because the mapping tools doesnt know your new models...
As mentioned before, I am a bloody beginner with .hc, but I think that is what you need to edit when you want to put new models into your map.
Cant wait to see some screenshots of your map
All the best,
Seven
Great news, that you managed to compile your map
You mentioned that you found fitting Hexen2 models.
Could you please share the link, where you found them ?
Because I always search for these kind of models too.
Thank you.
Regarding the question to bring new models into H2:
I am a bloody beginner with .hc
But I also was playing around with .hc recently and I think I can help you.
Of course, if Spike can jump in and explain it, it would even be better
1.) It all starts with calling the models via its specific function in your .bsp:
Let us follow the procedure with the regular model:
chair.mdl
This is how it could look in the mapīs ent file:
{
"classname" "obj_chair"
"origin" "1050 1722 144"
"scale" "1.4"
}
"classname" "obj_chair"
"origin" "1050 1722 144"
"scale" "1.4"
}
2.) With that, your map calls the specific entity function (in our case the regular chair)
It is inside object.hc:
Code:
void obj_chair() { precache_model("models/chair.mdl"); CreateEntityNew(self,ENT_CHAIR,"models/chair.mdl",chunk_death); self.touch = obj_push; self.flags = self.flags | FL_PUSH; }
3.) The CreateEntityNew line calls the universal "entity-Spawner" function together with all necessary arguments for that special entity (in your case the chair).
The function CreateEntityNew is inside spawn.hc
4.) Inside the universal CreateEntityNew function, the given arguments are used to call the 2 important functions:
- entity_spawnvalues
- entity_box
(both are also inside spawn.hc)
Several other things are also done, but that is not so important in our case.
5.) The entity_spawnvalues function contains the necessary values for the chair.
There are 6 spawn-value fields for each entity !
The function knows (because of the given arguments), that it is ENT_CHAIR, so it uses this line (with its given values) for the chair.
6.) The entity_box function contains the necessary values for the chairīs bbox size.
There are 2 fields for each entityīs bbox !
The function knows (because of the given arguments), that it is ENT_CHAIR, so it uses this line for its values.
That is the regular precedure from .bsp to in-game spawning of entities.
If you want to add new entities, you have to create new functions and lines where necessary.
ATTENTION:
Hexen 1.11 has theses values for its functions:
float entity_spawnvalues[456] =
vector entity_box[152] =
vector entity_box[152] =
float entity_spawnvalues[552] =
vector entity_box[184] =
vector entity_box[184] =
There is a comment in HC source 1.12a that tells you the formular for these values.
You MUST modify the values, if you add additional models into your map/hc:
Formulars are:
- for entity_spawnvalues: 6 * (float of your highest ENT + 1)
- for entity_box: 2 * (float of your highest ENT + 1)
Original Hexen2 uses 75 models + world = 76
Portals uses 91 models + world = 92
Example:
If you want to add 2 new models into original Hexen2, your function must look like this:
float entity_spawnvalues[468] =
vector entity_box[156] =
vector entity_box[156] =
Beside the extension of these 2 functions inside spawn.hc, you must also add the specific model functions in object.hc.
Remember, the one for the chair was: void obj_chair ()
These new functions for your model will be used/called inside your map (.bsp).
You have to bring them somehow into your mapping tool (or add it via .ent files is a dirty solution), because the mapping tools doesnt know your new models...
As mentioned before, I am a bloody beginner with .hc, but I think that is what you need to edit when you want to put new models into your map.
Cant wait to see some screenshots of your map
All the best,
Seven
Comment