Lightning.tbl

From FreeSpace Wiki
Revision as of 03:32, 27 September 2011 by IssMneur (talk | contribs) (Add +flash_to_bang_percent: to the .tbl)
Jump to: navigation, search

Revision information.....

FSO Revision: 4879
Note: Please update the version when the page is updated. If your edit had nothing to do with new code entries then please do not edit the version


Revision information.....

SVN revision: 7814
Note: Please update the version number when the page is updated. If your edit had nothing to do with new code entries then please do not edit the version numbers


Lightning.tbl is used to define the different storms seen in game (such as nebula conditions).


FS2 Open, 3.6.14:
  • The hardcoded limit of a maximum of 10 different bolts and storm types has been removed in favour of a dynamic system. This allows the creation of a wider range of nebula lightning and storm types within a campaign.


Format

  • Lightning.tbl consists of two sections #Bolts begin that defines the various lightning bolt types used and the #Storms begin that defines the method how the different lightning bolts are used in the storms. Bolts sections ends with #Bolts end and storm section with #Storms end.


Bolts

$Bolt:

  • Used to define the name of the bolt.
  • Syntax: String


+b_scale:

  • Defines the 'spread' of the child forks. Smaller values cause tighter bolts.
  • Syntax: Float


+b_shrink:

  • Defines the percentual value (from 0 to 1) that is for the lenght of the 'child' forks
  • Syntax: Float


+b_poly_pct:

  • Defines the width of the lightning compared to the lenght of the lightning in percents. Large values are not recommended, retail values are from 0.002 to 0.0075.
  • Syntax: Float


+b_rand:

  • Sets the probability (from 0 to 1) of generating 'child lightnings' for the 'nodes' of the main lightning. High values may cause the game to run out of lightning nodes.
  • Syntax: Float


+b_add:

  • Sets the drawing distance (in meters) of the lightning glow from the actual lightning towards the viewpoint, same as the z_add used with beams. Changing this value with lightnings is not recommended.
  • Syntax: Float


+b_strikes:

  • Defines the number of times the bolt strikes
  • Syntax: Integer


+b_lifetime:

  • Defines the total lifetime of the bolt in milliseconds. Lenght of invidual strikes is +b_lifetime: divided by +b_strikes:
  • Syntax: Integer


+b_noise:

  • Defines the 'noise' of a multi striking lightning (from 0 to 1). Cause the lightning to 'imitate' movement. Large values are not recommended.
  • Syntax: Float


+b_emp:

  • Sets the EMP effect caused by the lightning. First the EMP intensity followed by time the EMP affects the ships in seconds.
  • Syntax: Float Float


+b_texture:

  • Defines the texture used for the main bolt texture
  • Syntax: String


+b_glow:

  • Defines the texture used for the main bolt glow
  • Syntax: String


+b_bright:

  • Defines the brightness of the bolts. Higher values cause screen to flash brighter
  • Syntax: Float


Storms

$Storm:

  • Defines the name of the storm
  • Syntax: String


+bolt:

  • Each storm may have up to 10 bolts defined. One bolt type may be listed under a same storm more than once to change the odds of that lightnings appearance.
  • Type of the lightning is randomly determined from the listed bolts.
  • Syntax: String


+flavor:

  • Flavor defines a vector that is added to the lightnings. So it forces the lightnings to be aligned along the vector. Smaller values have lesser effect while extremely large values (longer vector) cause linear lightning bolts.
  • Syntax: Float Float Float


+random_freq:

  • Defines the minimum and maximum for the random lightning 'firings' in milliseconds
  • Syntax: Integer Integer


+random_count:

Defines the minimum and maximum number of lightnings fired at each timestamp

  • Syntax: Integer Integer


+flash_to_bang_percent:

FS2 Open, 3.6.14:

Defines the percentage of nebula flashes that get turned into bangs. Max 100. Min 0 (effectively turn off thunder).

  • Syntax: Integer

Sample

  • Retail FreeSpace 2 table
;  Man, do I like this table :)

; individual bolt definitions. can have up to 10 different bolt types
#Bolts begin

;; individual lightning bolt types
$Bolt:		b_standard
	; this is a percentage of the length of a given beam. envision a circle in the plane of where the bolt
	; strikes. the radius of this circle is the length of the beam * b_scale. when generating child forks on the
	; bolt, a point is picked randomly within ths circle and that's where thr fork "aims". smaller values produce a
	; tighter bolt
	+b_scale:					0.5
	
	; when generating the child forks, this is % of the distance from the start of the fork to the point its aiming at
	; that will be its endpoint. So if you had a value of 0.25, each child fork would be 25% the distance to the strike plane
	+b_shrink:					0.3			

	; this is the thickness of the main trunk of a bolt relative to the length of the bolt. so 0.003 means the bolt is 0.3% as
	; wide as it is long
	+b_poly_pct:				0.002	

	; this is the % chance that any given node on the main trunk will spawn a child node. BE CAREFUL WITH THIS! too high of
	; a percentage will generate mega-lightning bolts which will run out of nodes. =o
	+b_rand:						0.24

	; this should probably never be messed with. its just a fudge factor which ensures that the glow of a beam is drawn closer
	; to the eye that the bolt itself (so its always "over" the bolt). in meters.
	+b_add:						2.0

	; the # of times the bolt "strikes" 
	+b_strikes:					2

	; the total lifetime of the bolt (in ms). the length of an individual strike is b_lifetime / b_strikes
	+b_lifetime:				280

	; the "noise" in a multi-strike bolt. each of the nodes in the bolt is perturbed a bit between strikes to make it seem
	; like its moving. large values don't look too good
	+b_noise:					0.015

	; the EMP effect caused by proximity to this lightning bolt. max intensity is 500.0. max time is 30 seconds
	+b_emp:						0.0 0.0

	; main bolt texture
	+b_texture:					lightning

	; main bolt glow
	+b_glow:						beam-dblue			

	; brightness of the bolt. 0.0 to 1.0. higher values result in brighter screen flashes
	+b_bright:					0.3

$Bolt:		b_red
	+b_scale:					0.2	
	+b_shrink:					0.3				
	+b_poly_pct:				0.0075		
	+b_rand:						0.45
	+b_add:						2.0	
	+b_strikes:					4	
	+b_lifetime:				200	
	+b_noise:					0.04	
	+b_emp:						0.0	0.0	
	+b_texture:					lightning	
	+b_glow:						beam-red				
	+b_bright:					0.2


$Bolt:		b_green
	+b_scale:					0.3	
	+b_shrink:					0.3				
	+b_poly_pct:				0.0075		
	+b_rand:					0.2
	+b_add:						2.0	
	+b_strikes:					3	
	+b_lifetime:				240	
	+b_noise:					0.03	
	+b_emp:						0.0	0.0	
	+b_texture:					lightning	
	+b_glow:						beam-green3		
	+b_bright:					0.14


$Bolt:		b_emp
	+b_scale:					0.6	
	+b_shrink:					0.3				
	+b_poly_pct:				0.0075		
	+b_rand:						0.3
	+b_add:						2.0	
	+b_strikes:					5	
	+b_lifetime:				300	
	+b_noise:					0.04	
	+b_emp:						350.0	5.0	
	+b_texture:					lightning	
	+b_glow:						beam-dblue		
	+b_bright:					0.4


#Bolts end


; storm types
#Storms begin

; this is what the mission designers will choose in fred. can have up to 10 different storm varieties
$Storm:							s_standard
	; can have a max of 10 different bolt types. one will be randomly chosen. if you want to make bolts happen more or 
	; less often, add them multiple times. So if you had 4 b_standard bolts and 1 b_red bolt, the b_red bolt would happen
	; 1/5 as often as the b_standard
	+bolt:						b_standard	
	+bolt:						b_standard	
	+bolt:						b_red
	+bolt:						b_green

	; direction vector value. flavor of the storm. if all 3 values are 0, its completely random. otherwise lightning bolts will tend to
	; align themselves to the vector. the longer the flavor vector, the more tightly aligned the bolts will be
	+flavor:						0.0 0.0 0.0

	; how often random bolts are fired, min-max range, in ms
	+random_freq:				1500 1750

	; min/max. how many bolts are spewed each random timestamp
	+random_count:				1 2

$Storm:							s_active
	; can have a max of 10 different bolt types. one will be randomly chosen. if you want to make bolts happen more or 
	; less often, add them multiple times. So if you had 4 b_standard bolts and 1 b_red bolt, the b_red bolt would happen
	; 1/5 as often as the b_standard
	+bolt:						b_standard	
	+bolt:						b_standard	
	+bolt:						b_standard	
	+bolt:						b_standard		
	+bolt:						b_red

	; direction vector value. flavor of the storm. if all 3 values are 0, its completely random. otherwise lightning bolts will tend to
	; align themselves to the vector. the longer the flavor vector, the more tightly aligned the bolts will be
	+flavor:						0.0 500.0 0.0

	; how often random bolts are fired, min-max range, in ms
	+random_freq:				200 400

	; min/max. how many bolts are spewed each random timestamp
	+random_count:				1 4


$Storm:							s_emp
	+bolt:						b_standard	
	+bolt:						b_standard	
	+bolt:						b_standard	
	+bolt:						b_red	
	+bolt:						b_red
	+bolt:						b_emp
	+bolt:						b_red	
	+bolt:						b_red	
	
	+flavor:						0.0 500.0 0.0

	; how often random bolts are fired, min-max range, in ms
	+random_freq:				300 700

	; min/max. how many bolts are spewed each random timestamp
	+random_count:				1 4

$Storm:							s_medium
	+bolt:						b_standard	
	+bolt:						b_standard	
	+bolt:						b_red	
	+bolt:						b_red
	+bolt:						b_standard	
	+bolt:						b_standard	
	+bolt:						b_green

	+flavor:						0.1 1.0 0.2

	; how often random bolts are fired, min-max range, in ms
	+random_freq:				900 1850

	; min/max. how many bolts are spewed each random timestamp
	+random_count:				1 3


#Storms end