Page 1 of 1

Lighting Atached To Unit CTD

Posted: Tue Jan 06, 2009 10:38 pm
by Tygr
I have been playing around with trying to attach a light to a unit, and I saw the videos of a BFII flashlight here and here. So far all of my attempts to make my own have CTDed.

I looked at PsychoFred's lighting docs, but I still can't get it to work. Here is my code so far.

helmet_light.fx

Code: Select all

LightBeam(“helmet_light”)
{
	Color(255, 255, 255, 255);
	Length(20.0);
	Position(0.05, 0, 0.05);
	Direction(1.0, 0, 0);
	InitialWidth(0.3, 0.3);	// elliptical start
	FinalWidth(10.0, 10.0);	// elliptical end
	FlareIntensity(0.1);
	FlareAngle(10);	
}
And here is the code I used to attach it to a unit:

Code: Select all

AttachEffect = "helmet_light"
AttachToHardpoint = "bone_head"
Can anyone help me? Does anyone have the effect from the video that I could look at and figure out how to make my own?


EDIT:

Okay, slight success, I think. It will only light up some things, and only a tiny bit. Then again, it might be the way the map is lit. Here's the code:

Helmet_Light.odf:

Code: Select all

[GameObjectClass]		
ClassLabel			= "Light"

[Properties]
Color				= "200 200 200 250"
ConeLength			= 20
ConeWidth			= "4.0"
ConeInitialWidth		= "0.8 0.8"
ConeFadeFactor			= 0.2
ConeFadeLength			= 0.1
BeamIntensity			= 0.8
DrawDistance			= 20

FlareIntensity			= 0
FlickerType			= "None"
OmniRadius			= 0
Added to unit with this:

Code: Select all

AttachDynamic = "1"

AttachOdf = "Helmet_Light"
AttachToHardpoint = "bone_head"

Re: Lighting Atached To Unit CTD

Posted: Wed Jan 07, 2009 9:19 am
by FragMe!
I can save you a lot of grief, if you want, the problem with attaching lights to units is a) as you found out it doesn't really light up anything
b)when the unit dies the effect tends to stay so you get a lot of lights left on the battlefield. Closest I have come is to have it as a beam weapon
with a very long (30 to 60 second) life even then it doesn't move with the player on things like a roll, it stays where it eminated from.

That is just some of my results from my way too many attempts at trying to do it but you are welcome to continue on :D