dhewm3-sdk/documents/thirdperson tutorial 2.txt
revility 5917d607ce dev documents
All the old development documents I found on my back up drives.
2018-10-21 04:31:15 +02:00

56 lines
5.3 KiB
Text

Greetings and welcome to a different kind of tutorial. When you look at the main site for TheRuiner mod, you will notice we have many people listed in thanks for helping us. This is one of the greatest things about mod developing and one of its main strengths, helping other amature developers out.
When we started to plan out Ruiner, we wanted to make sure the mod was possible without the need of a programmer for putting in the main game features. We scoured the community, searched through message boards and asked questions when needed. In the end we have been able to put in all the major features we wanted without a real programmer.
Below is a list of topics found on the popular www.doom3world.org modding forums. With the info from each of these topics, one can easily create a thirdperson Doom3 complete with crosshairs, and hud. People reading this from outside the Doom3 scene might wonder why this information is important. Its interest is related to the fact that when you try to set Doom3 in thirdperson, the hud, camera settings, and cross aren't there by default. You need to do some SDK, script and Def related work to get it working.
Please remember, this is written for a Doom3 modder who is already familar with the basics of Doom3 modding and working with the SDK, scripts and Def files. Some information written below will sound like greek to anybody else. There are many places to find info on getting started with Doom3 modding basics.
How to enable the Thirdperson hud:
http://www.doom3world.org/phpbb2/viewtopic.php?f=56&t=19964&hilit=thirdperson+hud
Check the very last post by port666 for how to do it. Just remember that if done this way, Many hud effects, such as damage effects, won't be seen.
Alternate way to enable the Thirdperson hud:
http://www.doom3world.org/phpbb2/viewtopic.php?f=67&t=16624
Look halfway through the thread, you will see a post by RPRaiden. This explains a more complicated way to enable the hud.
AFter enabling the Hud, you will notice something is wrong with the crosshairs. They are very inacurate. In order to bypass this hurdle, we need to create a new cross hair code.
Tutorial by Deavile is found here:
http://www.doom3world.org/phpbb2/viewtopic.php?f=56&t=16783&view=next
Special notes about this tutorial:
When compiling, don't forget to include the files in your build or it won't work.
Almost at the very bottom of the thread is a post by Deus231. In his post he has a little code that is useful.
What his code does is make the cross hair always move around when you move the mouse. If you don't add this code in, the crosshair doesn't update its position after the player attacks.
Once the new crosshair is implanted, the old one needs to be removed. After doing the cross hair tutorial, you might wind up with two cross hairs on the screen, one old and the other the new more acurate one.
To remove the old cursor, open up the gui file "cursor.gui" in the guis folder. Comment out the "windowDef crosshairParent" section and your good to go.
Another note on the crosshairs are physical projectiles, such as the plasma gun's plasma balls, and rockets from the rocket launcher. If "launchfrombarrel" is set to "1" in a weapon's projectile def, the projectile will not be acurate with the crosshair. It will fire from the weapon's barrel when not moving. Setting launchfrombarrel to 0 will have it launch from the default position, player's eyes, and be acurate.
At the moment, I do not have the solution to fix this bug.
The final part of this tutorial list belongs to camera settings. You can set the default height, range and angle of the thirdperson camera in doom3.
This can be done in the sdk, and in the Player.def file. Doing it both ways is the most effective way to make sure it always works and is never overwritten. The most important thing to set in the SDK is pm_thirdperson to 1 instead of 0 in the SysCvar.cpp file. This will make the mod start off in thirdperson by default. All other camera settings are set in there as well.
In the Player.def file, you can add the console commands to change the default camera position without use of the sdk. Setting it in the sdk is optional.
To add in the camera info, go in the Player.def file and under entityDef player_base. As you look through the player_base, you see some of the default settings and information on what weapons the player carries, ammo, etc. Halfway through it, are many settings with the "pm_" prefix such as pm_jumpheight.
Now add in:
////START thirdpersoncamsettings
"pm_thirdperson" "1" //enables thirdperson view
"pm_thirdpersonheight" "0" //Sets the vertical position of the camera. Use negative numbers to move it down even further
"pm_thirdpersonangle" "0" //rotates the camera around the player from 0-360
"pm_thirdpersonrange" "100" //sets how far away the camera is from the player
"pm_thirdpersonclip" "1" //Sets whether or not the camera can clip through brushes. if set to "0", it will move through brushes.
////END thirdpersoncamsettings
Set them to whatever you feel is best for your mod. If the angle is changed to any amount besides 0, then freelooking with the mouse no longer works. If the thirdpersonclip is set to 0, the camera will clip through walls, and objects in the map. This leads to a wealth of performance and visual problems.