Doom3 world Forum Index Doom3 world
Doom3world.org - the world is yours!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

locking g_armorprotection

 
Post new topic   Reply to topic    Doom3 world Forum Index -> Doom3 scripting
View previous topic :: View next topic  
Author Message
Your Imaginary Enemy
is connecting to Doom3world.org


Joined: 19 Dec 2004
Posts: 23

PostPosted: Sun Mar 06, 2005 3:55 pm    Post subject: locking g_armorprotection Reply with quote

I want to change the amount of damage that armor absorbs.

I have modified doom_main.script by adding the following line:

void doom_main() {
sys.print( "Entering doom_main()\n");

//
// Do any script setup here
//
sys.setcvar( "g_armorprotection", "0.65" );
sys.print( "Exiting doom_main()\n" );
}

This does a fine job of locking g_armorprotection on skill levels 0 and 1. Unfortunately, when I set the skill to 2 or 3 and load a new level the g_armorprotection drops to 0.2. I need to know how to lock g_armorprotection at 0.65 on all skill levels.

I also read somewhere that on skill 0 the player takes 0.8x damage, on skill 2 the player takes 1.8x damage, and on skill 3 the player takes 3.5x damage. Does anybody know how I can change these numbers for my mod?

By the way, the mod I am finishing up is called Infernal Death Orgy and I will submit it to d3files.com real soon!
Back to top
View user's profile Send private message  
rich_is_bored
a gun & a nice word
a gun & a nice word


Joined: 11 Jan 2003
Posts: 4792
Location: Orlando, FL

PostPosted: Sun Mar 06, 2005 5:16 pm    Post subject: Reply with quote

This value is set when a player is spawned...

line 1543 player.cpp...

Code:
if ( !gameLocal.isMultiplayer ) {
      if ( g_skill.GetInteger() < 2 ) {
         if ( health < 25 ) {
            health = 25;
         }
         if ( g_useDynamicProtection.GetBool() ) {
            g_damageScale.SetFloat( 1.0f );
         }
      } else {
         g_damageScale.SetFloat( 1.0f );
         g_armorProtection.SetFloat( ( g_skill.GetInteger() < 2 ) ? 0.4f : 0.2f );
#ifndef ID_DEMO_BUILD
         if ( g_skill.GetInteger() == 3 ) {
            healthTake = true;
            nextHealthTake = gameLocal.time + g_healthTakeTime.GetInteger() * 1000;
         }
#endif
      }
   }

_________________
Staff
Learn something today? Why not write an article about it on D3 Wiki?
Back to top
View user's profile Send private message Send e-mail  
Your Imaginary Enemy
is connecting to Doom3world.org


Joined: 19 Dec 2004
Posts: 23

PostPosted: Mon Mar 07, 2005 7:00 am    Post subject: Reply with quote

I downloaded the sdk and opened src/game/player.cpp.

I changed the following line:

g_armorProtection.SetFloat( ( g_skill.GetInteger() < 2 ) ? 0.4f : 0.2f );
into
g_armorProtection.SetFloat( ( g_skill.GetInteger() < 2 ) ? 0.65f : 0.65f );
then I put my modified player.cpp file into C:\Doom 3\mymod\src\game folder. I was uncertain if this would work because C:\Doom 3\base does not contain a src folder. But I tried it anyway. This did not fix the problem. I looked around iddevnet.com/doom3 and think I found something interesting that might be related to what I am trying to do. The following is from The Code section.

COMPILING

The first thing you're going to need to do is make sure you can build and run the code. We developed it using Visual Studio.Net, it may or may not work in 6.0. Ideally all you have to do is double-click the solution file and hit build. It will create a gamex86.dll in the output folder. You're going to want to move this to your mod folder with either a batch file, a post build step, or just by changing the linker output directory.

Since I am making this mod mostly through trial and error and reading these forums, I don't know about programming. So I don't know how to do this compiling, solution file and gamex86.dll making.

I hope there is a simple solution to this because all I am after is a small but very important change.
Back to top
View user's profile Send private message  
Primal_Freeze
picked up 75 health


Joined: 23 Feb 2005
Posts: 87
Location: Brisbane - Australia

PostPosted: Mon Mar 07, 2005 12:57 pm    Post subject: Reply with quote

Unfortunately you WILL need to get a programmer to compile this for you. If i knew where my unedited src was, i would chuck it in, edit and give you the DLL, but alas, i do not. Email me in 12 hours and i'll see what i can do. U can find my addy at www.skumindustries.com
_________________
Metroid : Evolved - The Doom3 Mod - http://www.skumindustries.com
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
Display posts from previous:   
Post new topic   Reply to topic    Doom3 world Forum Index -> Doom3 scripting All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group