Flashlight mod + extras

Try not to have multiple edited pk4 files(mods) at the same time. It will probably cause init errors.

I like that you edited the pistol. Hopefully we can put all this into a unified mod(s). I hope you added commends on the code you changed for the pistol.
 
i think the smaller/dimmer weapon light can be changed simply by the following:

Code:
void weapon_pistol::updateLightIntensity() {
	if ( global_flashlight_intensity != intensity ) {
		intensity = global_flashlight_intensity;
		setLightParm( 2, intensity );
		setShaderParm( 3, intensity ); //changed 3 -> 2 to make slightly smaller
		UpdateSkin();
	}
}

void weapon_pistol::init() {
	next_attack = 0;
	spread		= getFloatKey( "spread" );
	weaponState( "Raise", 0 );
	
	global_flashlight_intensity = 1.0;
	intensity = 0.7;	//changed 1.0 -> 0.7 to turn down the light intensity
	setLightParm( 3, 1.0 );
	setShaderParm( 3, 1.0 );
}

EDIT:

and i'm noticing that in your semi-auto pistol you've added the whole "on" bool; are you on the track of the on-off feature?
 
shaocaholica said:
I think it would be fun to tweak the plasma gun so that the muzzle flash lighting shader is much more intense and the projectiles cast their own light too.

HAH. they already have this coded in but commented out:

Code:
//	"mtr_light_shader"			""
//	"light_color"				"0 0 0.8"
//	"light_radius"				"160"
//	"light_offset"				"-8 0 0"

//	"mtr_explode_light_shader"	"muzzleflash"
//	"explode_light_color"		"0 0 1"
//	"explode_light_radius"		"160"
//	"explode_light_fadetime"	"0.25"
just uncomment this stuff and you're good to go!
 
^^^ Thanks ^^^

FYI if you start tweaking the default shotgun def/script, there is a var called reloadrate which for some reason is set to 2. I think the game sets this to 1 when you play the harder difficulties but it reverts to 2 if you use it in a extra pk4 file. If its set to 2, for evey shotshell you see being loaded, the magazine grows by 2 instead of 1. I though I broke the code when I made my first shotgun mod but it just turned out to be this. I don't think it should ever be set to anything other than 1 on any difficulty.
 
shaocaholica said:
^^^ Thanks ^^^

FYI if you start tweaking the default shotgun def/script, there is a var called reloadrate which for some reason is set to 2. I think the game sets this to 1 when you play the harder difficulties but it reverts to 2 if you use it in a extra pk4 file. If its set to 2, for evey shotshell you see being loaded, the magazine grows by 2 instead of 1. I though I broke the code when I made my first shotgun mod but it just turned out to be this. I don't think it should ever be set to anything other than 1 on any difficulty.

i'm playing it on "Veteran" right now with default, and it's loading 2 every time, not 1.

that, and i don't quite get what you mean: it's still loading 2 at a time, even when you change it in the mod?
 
another little thing is for some reason installing the light mods makes your saves go back to the start of the level, so beware it did on me but I just uninstalled it again, i'll wait till I clear it first ;)
 
Neural Interface said:
another little thing is for some reason installing the light mods makes your saves go back to the start of the level, so beware it did on me but I just uninstalled it again, i'll wait till I clear it first ;)

Quicksaves or normal saves?
 
milling_hordesman said:
i'm playing it on "Veteran" right now with default, and it's loading 2 every time, not 1.

that, and i don't quite get what you mean: it's still loading 2 at a time, even when you change it in the mod?
Oh, I thought it was loading 1 at a time when I was playing the game on "marine". I just never bothered to count. Well, my mod sets it to 1. I don't see why they would do that. It would be like giving the rocket launcher 10 rockets when you can clearly see theres not 10.
 
milling_hordesman said:
i think the smaller/dimmer weapon light can be changed simply by the following:

Code:
void weapon_pistol::updateLightIntensity() {
	if ( global_flashlight_intensity != intensity ) {
		intensity = global_flashlight_intensity;
		setLightParm( 2, intensity );
		setShaderParm( 3, intensity ); //changed 3 -> 2 to make slightly smaller
		UpdateSkin();
	}
}

void weapon_pistol::init() {
	next_attack = 0;
	spread		= getFloatKey( "spread" );
	weaponState( "Raise", 0 );
	
	global_flashlight_intensity = 1.0;
	intensity = 0.7;	//changed 1.0 -> 0.7 to turn down the light intensity
	setLightParm( 3, 1.0 );
	setShaderParm( 3, 1.0 );
}

EDIT:

and i'm noticing that in your semi-auto pistol you've added the whole "on" bool; are you on the track of the on-off feature?


the light is changed in the def file, give me an IM on aim, ill show you

the on was for having the light on-off...i took it out for the moment. wanted to concentrate on getting the other stuff working first ;)
 
ehZn said:
So this link is the whole mod? Or just the changes? I love that you changed the pistol...that slow firing sucks. Can someone see if this works without installing the original mod and just the renamed one posted above?


renaming will definitly work, you dont need sha's mod for mine to work, in fact as he points out that might cause problems. mine can be standalone if you want that instead
 
Neural Interface said:
tbh I havent used quick saves so I cant say for sure but normal saves are effected i know that much :)


it only normally saves when youre at the start of a level...
 
kronchev said:
renaming will definitly work, you dont need sha's mod for mine to work, in fact as he points out that might cause problems. mine can be standalone if you want that instead

So all I gotta do is dl the file in this link http://www.spatula-city.us/upload/u...iles/pak006.pk4
at the end of the first page of this thread, rename it to pak005.pk4, and unzip it to Doom3/base?

Sorry if I keep asking but I hate having to reinstall stuff because of an avoidable error.
 
kronchev said:
the light is changed in the def file, give me an IM on aim, ill show you

the on was for having the light on-off...i took it out for the moment. wanted to concentrate on getting the other stuff working first ;)

oh, wait, i understand: the muzzle flash is actually changed to the flashlight, is that it? so what that bit of structured text at the end is for is to add the flashlight without removing the muzzle flash? i think i'm starting to kind of understand... (maybe)
 
milling_hordesman said:
oh, wait, i understand: the muzzle flash is actually changed to the flashlight, is that it? so what that bit of structured text at the end is for is to add the flashlight without removing the muzzle flash? i think i'm starting to kind of understand... (maybe)

he took out the muzzle flash, i'm not too sure why (guess we CAN ask him i guess :D). you can have both, it just involves removing the // (comment) markings off the lines

in fact i think ill do that now, and make the muzzle flash a lot brighter, so its useful. a big problem is muzzle flash is only on at high or ultra settings, and i and many others play at medium. i dont know why it gets turned off.

/edit: allright i think you can only have one or the other. poo.
 
kronchev said:
he took out the muzzle flash, i'm not too sure why (guess we CAN ask him i guess :D). you can have both, it just involves removing the // (comment) markings off the lines

in fact i think ill do that now, and make the muzzle flash a lot brighter, so its useful. a big problem is muzzle flash is only on at high or ultra settings, and i and many others play at medium. i dont know why it gets turned off.

so you mean that if you take out the comments in this section:
Code:
	//"mtr_flashShader"			"muzzleflash"
	//"flashColor"				"1 0.8 0.4"
	//"flashRadius"				"120"

you'll get both the muzzle flash and the flashlight? and the Radius indicates not only the radius but the intensity as well?
 
milling_hordesman said:
so you mean that if you take out the comments in this section:
Code:
	//"mtr_flashShader"			"muzzleflash"
	//"flashColor"				"1 0.8 0.4"
	//"flashRadius"				"120"

you'll get both the muzzle flash and the flashlight? and the Radius indicates not only the radius but the intensity as well?

read what i put...you can only have one or the other. those are from the def file, which declairs these variables for use other places in the code, and it seems a weapon can only have one kind of light. ill try to find a workaround.
 
Crycet the original modder who added the flashlight effect replaced the muzzleflash with the flashlight effect which is like a constantly on muzzleflash. Don't mistake the muzzleflash for the muzzle sprite which is that little puff of fire at the business end of the barrel. If you wanted to have both the muzzleflash and a flashlight, you'd have to define 2 muzzle flashes.
 
well, that makes a lot more sense, though it is a bit disappointing.

If you wanted to have both the muzzleflash and a flashlight, you'd have to define 2 muzzle flashes.

...could we actually do that?
 
right now i'm working on getting the shotgun to give a lot more throwback, as in you shoot someone, and they dont keep standing there, they fly back.
 
Is there an upper bound on the fire rate of the pistol mod? I think there is an upper bound in other games like CS because you can't fire them infinitely fast.
 
no, there is not. instead of waiting for the pistol firing anim to stop playing, it instead just waits for the 'attack' command to stop (basically, the next frame/refresh cycle), so you could technically only ever fire 60 shots/second (if id was telling the truth about that 60hz command cap).

EDIT: which, I will note, is almost infinitely fast as for our purposes
 
shaocaholica said:
Is there an upper bound on the fire rate of the pistol mod? I think there is an upper bound in other games like CS because you can't fire them infinitely fast.


you pretty much cant click enough to hit the bound, but its there. 100hz :p

it doenst matter because its not overpowered at all, ive been testing it and its still the crappy little pistol.

im having a hell of a time getting the shotgun to throw enemies though. from what ive seen no weapon throws guys unless theyre dead. thats pretty lame since the player can be thrown by any force.
 
kronchev said:
im having a hell of a time getting the shotgun to throw enemies though. from what ive seen no weapon throws guys unless theyre dead. thats pretty lame since the player can be thrown by any force.

so, tell me what you know from experience. I was just assuming that it might be this:

Code:
entityDef	damage_shotgun {
	"damage"			"6"
	"kickDir"			"1 0 0"

	"mtr_blob"			"genericDamage"
	"blob_time"			"300"
	"blob_size"			"400"
	"blob_offset_x"		"400"

	[b]"knockback"			"30"[/b]
	
	"gib"				"1"
	"smoke_wound_flesh"	"burstysquirt.prt"
	
	"mtr_wound_flesh"	"textures/decals/hurt02"
	"mtr_wound_metal"	"textures/decals/hurtmetal"
	"mtr_splat_flesh"	"textures/decals/dsplat2"
	"mtr_splat_flesh2"	"textures/decals/dsplat5"
	"mtr_splat_flesh3"	"textures/decals/dsplat7"
	"mtr_splat_flesh4"	"textures/decals/dsplat11"
	"snd_flesh"			"shotgun_impact_flesh"

	"kick_time"			"400"
	"kick_amplitude"	"1"

	"dv_time"			"100"
}

or is that part how much the shooter gets knocked back?

or are you saying that it doesn't use that variable until the enemy is killed? because that would be pretty lame...
 
milling_hordesman said:
so, tell me what you know from experience. I was just assuming that it might be this:

Code:
entityDef	damage_shotgun {
	"damage"			"6"
	"kickDir"			"1 0 0"

	"mtr_blob"			"genericDamage"
	"blob_time"			"300"
	"blob_size"			"400"
	"blob_offset_x"		"400"

	[b]"knockback"			"30"[/b]
	
	"gib"				"1"
	"smoke_wound_flesh"	"burstysquirt.prt"
	
	"mtr_wound_flesh"	"textures/decals/hurt02"
	"mtr_wound_metal"	"textures/decals/hurtmetal"
	"mtr_splat_flesh"	"textures/decals/dsplat2"
	"mtr_splat_flesh2"	"textures/decals/dsplat5"
	"mtr_splat_flesh3"	"textures/decals/dsplat7"
	"mtr_splat_flesh4"	"textures/decals/dsplat11"
	"snd_flesh"			"shotgun_impact_flesh"

	"kick_time"			"400"
	"kick_amplitude"	"1"

	"dv_time"			"100"
}

or is that part how much the shooter gets knocked back?

or are you saying that it doesn't use that variable until the enemy is killed? because that would be pretty lame...

its actually in a later part, but thats what im saying. try it with a rocket launcher on a guy who can take a few hits, like the one with the rocket launcher pack. shoot him head on with a rocket once, nothing at all. hit him again, hell die, and fly backwards.
 
how about in the projectile definition. i noticed for plasma rifles they have this extra variable:

Code:
entityDef projectile_plasmablast {
...
	"mass"	"50"
[b]	"push"	"4000"	// additional impulse when projectile collides [/b]
	"gravity"	"0"	// how much gravity affects the trajectory.  gravity direction is same as the entity that fired it.
	"fuse"	"10"	// how long before the projectile is removed or self-detonates.  Use 0 for beam weapons (velocity == distance).
...
}
 
milling_hordesman said:
how about in the projectile definition. i noticed for plasma rifles they have this extra variable:

Code:
entityDef projectile_plasmablast {
...
	"mass"	"50"
[b]	"push"	"4000"	// additional impulse when projectile collides [/b]
	"gravity"	"0"	// how much gravity affects the trajectory.  gravity direction is same as the entity that fired it.
	"fuse"	"10"	// how long before the projectile is removed or self-detonates.  Use 0 for beam weapons (velocity == distance).
...
}


thats what affects when things are dead.
 
my experience with fooling around with the plasma gun suggests that kickback is based on real physics models....mass * velocity. when I was screwing around with an uber-plasma gun, i found that increasing the velocity of the projectile was knocking bad guys around like origami.

entityDef projectile_plasmablast {
"velocity" "4000 0 0" (way jacked up)
"mass" "50" (default)

so on the case of you guys messing with other weapons, either increase the velocity or the mass of the projectile, and you should get the desired effect. after seeing reveants & archivilles tossed around like rag dolls (even while alive!!) i think there is something to this.

I would add that I agree, demon or not, if you gota shotgun going off in your chest your gonna fly back a little, LOL
 
do u guy think u could write a mod to increases the amount of gore as well as removing the vaporization effect and leaving bodies where they r killed........ :D
 
Put all the mods into one mod and cleaned up the flashlight code a lot. I turned the plasma guns lighting effects on too:

plasma_unlit.jpg


plasma_lit.jpg


Semi auto pistol is fun. I think I'll increase the magazine size while Iam at it.
 
So the flashlight effect replaces the muzzle flash? Damn...I was hoping someone could come up with a way to add a helmet-light. I think that'd be damn cool.
 
Torn said:
So the flashlight effect replaces the muzzle flash? Damn...I was hoping someone could come up with a way to add a helmet-light. I think that'd be damn cool.
How would you tell the difference? The light is always pointing a the spot you are looking at.
 
I'll probably try out this mod. I think its stupid that the guns dont have lights to begin with. The year is suppost to be 2145.....guns would probably have lights then, since there are guns that have lights on them now...


A question.....is one of the files listed on the original post the flashlight mod only? I dont want any of the weapon mods, just the flashlight part. Is this possible?

thanks
 
shaocaholica said:
How would you tell the difference? The light is always pointing a the spot you are looking at.

well he means that you still get the muzzle flash and it doesnt dissappear when you switch weapons or reload. personally i like the light following where the gun is pointing because when you reload you lose all sight and its pretty scary. ive gone around corners, ran out of clip, reloaded the shotgun, and when it was in place there was an imp RIGHT in my face.


also i wouldnt increase the size since that makes it a little too unrealistic. 14 at the max.
 
shaocaholica said:
^^^ Thanks ^^^

FYI if you start tweaking the default shotgun def/script, there is a var called reloadrate which for some reason is set to 2. I think the game sets this to 1 when you play the harder difficulties but it reverts to 2 if you use it in a extra pk4 file. If its set to 2, for evey shotshell you see being loaded, the magazine grows by 2 instead of 1. I though I broke the code when I made my first shotgun mod but it just turned out to be this. I don't think it should ever be set to anything other than 1 on any difficulty.

maybe its a double barrel shotgun.
 
shaocaholica said:
Put all the mods into one mod and cleaned up the flashlight code a lot. I turned the plasma guns lighting effects on too:

[]http://www.andrew.cmu.edu/user/sjzhang/images/Misc/plasma_unlit.jpg[/img]

[]http://www.andrew.cmu.edu/user/sjzhang/images/Misc/plasma_lit.jpg[/img]

Semi auto pistol is fun. I think I'll increase the magazine size while Iam at it.

make the mass of the shotgun hits 10.

then give me a copy :p

http://www.spatula-city.us/upload/upload.php

if you need hosting ^^^
 
Back
Top