How to Make Reflective Weapon

This is a moderated forum that collects tutorials, guides, and references for creating Transcendence extensions and scripts.
Post Reply
User avatar
DigaRW
Militia Commander
Militia Commander
Posts: 332
Joined: Thu Jul 30, 2015 3:10 pm
Location: Deep dark space/Indonesia

Mon Jun 19, 2017 12:39 pm

I finally has found solution for my CM1 blaster. This weapon now has reflective effect.
To make the weapon with reflective effect (Reflect but still damage armor), use "OnDamageArmor" events on the weapon.
Like this:

Code: Select all

<Events>
	<OnDamageArmor>
		(block (direction)
			; Randomize direction degrees for its basic reflection nature
			(setq direction (random 0 359))
					
			; Create weapon fire so makes them looks like reflected
			(sysCreateWeaponFire 
			
				; We use same UNID with the weapon, but you can use additional virtual weapon as well
				&itUNIDWeapon;
				
				; Spawn from gSource
				gSource
				
				; Use sysVectorPolarOffset so the beam will not trapped inside ship
				(sysVectorPolarOffset gSource direction 1)
				
				; Use direction along with above so the beam will not reflect into odd direction
				direction
						
				; 100 is normal beam speed
				100
						
				; Set Nil as it should not have target
				Nil
				)
						
			; Return full damage, if not, they may trigger a bug
			aDamageHP
			)
	</OnDamageArmor>
</Events>
For example, see Semesta I.G.C about CM1 weapon.

Note: If the weapon has passthrough ability, they may trigger more reflection.
Download Transcendence mods from Reinvented Workbench Project!
Semesta I.G.C v1.34
Great corporate that feature a new items and challenges!
YourCORP v1.11
Build your very own corporation!
Trade Item Extension v1.14
New misc items, foods and resources!
StrongBox v1.4
Open it up to get a random equipments!
Flare Weapons v1.3
New weapons that have very unique abilities!
Click this link!

Post Reply