So 1.2beta's laser effects.....

This is a moderated forum that collects tutorials, guides, and references for creating Transcendence extensions and scripts.
Post Reply
Jay2Jay
Militia Commander
Militia Commander
Posts: 283
Joined: Fri Jan 11, 2013 12:57 am

I cant find them in the xml. When I look at a weapon's xml there is nothing there that tells me what the shot will look like except for the standard "beam" attribute, but there is nothing to distinguish a turbolaser from a bolide or a normal laser shot in the xml, however they are obviously different in game.

This is the code for the turbolaser's weapon attribute

Code: Select all

<Weapon
	type=				"beam"

	damage=				"laser:3d4"
	fireRate=			"12"
	lifetime=			"30"
	powerUse=			"60"

	effect=				"&efLaserBeamDefault;"
	hitEffect=			"&efGreenLaserHitEffect;" 
	sound=				"&snLaserCannon;"
	>
</Weapon>

and this is the laser cannon's

Code: Select all

<Weapon
	type=				"beam"

	damage=				"laser:1d4"
	fireRate=			"10"
	lifetime=			"30"
	powerUse=			"10"

	effect=				"&efLaserBeamDefault;"
	sound=				"&snLaserCannon;"
	>
</Weapon>
Can you see my dilemma?
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Each weapon damage effect has an effect that looks something like this:

Code: Select all

<EffectType UNID="&efLaserBeamDefault;"
			instance=			"owner"
			>
		<Effect>
			<Ray
					style=			"smooth"
					shape=			"tapered"
					/>
		</Effect>

		<Events>
			<GetParameters>
				;	This event allows us to initialize effect parameters based 
				;	on weapon properties. In particular, we adjust the size of 
				;	the effect based on the amount of average damage.
				;
				;	For weapon effects, gData has the following fields:
				;
				;	damageHP: The average number of hit points of damage.
				;	speed: The speed of the shot (as a percent of lightspeed).
				;
				;	The event must return a structure with each field representing
				;	a parameter for the effect. For Ray effects, valid fields are:
				;	intensity, length, width, primaryColor, and secondaryColor.

				(block (damageHP primaryColor secondaryColor)
					(setq damageHP (@ gData 'damageHP))

					;	Color depends on damage

					(switch
						(geq damageHP 15)
							(block Nil
								(setq primaryColor "#D500FF")
								(setq secondaryColor "#6A00FF")
								)

						(geq damageHP 7)
							(block Nil
								(setq primaryColor "#55FF00")
								(setq secondaryColor "#2A8000")
								)

						(geq damageHP 4)
							(block Nil
								(setq primaryColor "#FF5500")
								(setq secondaryColor "#802A00")
								)

						(block Nil
							(setq primaryColor "#FF0000")
							(setq secondaryColor "#800000")
							)
						)
					
					{
						length:
							(mathScale 
								damageHP						; average damage of weapon
								1								; min damage
								30								; max damage
								60								; min beam length
								220								; max beam length
								50								; scale gamma
								)
						width: (mathScale damageHP 1 30 12 28 50)
						intensity: 35

						primaryColor: primaryColor
						secondaryColor: secondaryColor
						}
					)
			</GetParameters>
		</Events>
	</EffectType>
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
Jay2Jay
Militia Commander
Militia Commander
Posts: 283
Joined: Fri Jan 11, 2013 12:57 am

dafuq..... :shock:
Jay2Jay
Militia Commander
Militia Commander
Posts: 283
Joined: Fri Jan 11, 2013 12:57 am

I should clarify, I meant the shot itself, not the actual hit effect.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

In 1.2 beta the laser and kinetic weapon effects (the actual shot) is generated dynamically by efLaserBeamDefault.

In fact, in every weapon there is an effect (the shot graphics) and a hiteffect (graphics when the weapon hits something)
effect= "&efLaserBeamDefault;"
So, you have to search for efLaserBeamDefault. RPC posted exactly that.
Jay2Jay
Militia Commander
Militia Commander
Posts: 283
Joined: Fri Jan 11, 2013 12:57 am

What do you mean by "generated dynamically"?
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

read the efLaserBeamDefault code:
lasers will have different colours depending on the average damage of the weapon. Also the size length and width of the beam effect changes depending on the average damage.
Jay2Jay
Militia Commander
Militia Commander
Posts: 283
Joined: Fri Jan 11, 2013 12:57 am

I get it now thanks digdug-sensei.
Post Reply