How to obtain weapon range and projectile lifetime in TLISP

This is a moderated forum that collects tutorials, guides, and references for creating Transcendence extensions and scripts.
Post Reply
TVR
Militia Commander
Militia Commander
Posts: 334
Joined: Sat Sep 08, 2012 3:26 am

Just discovered it is possible to get weapon range and shot lifetime in TLISP!

Weapon range (in light-seconds) = (typGetDataField weaponUNID "range")

Example (Laser Cannon, pointer):

Code: Select all

(typGetDataField &itLaserCannon; "range")
Returns "60"

Example 2 (Fusionfire Howitzer, UNID):

Code: Select all

(typGetDataField 0x0000412C "range")
Returns "120"

These are indeed correct, the laser cannon does has a range of 60 ls, and the FF has a range of 120 ls.

Basic algebra can be used to obtain lifetime:

Weapon range in ls / (Weapon speed in %c / (50 %c / (ls/tick))) = lifetime in ticks

Example (Laser Cannon, pointer):

Code: Select all

(divide (typGetDataField &itLaserCannon; "range") (divide (typGetDataField &itLaserCannon; "speed") 50)) 
Returns "30", which means 30 ticks (1 second real-time)
Fiction is reality, simplified for mass consumption.
PGP: 0x940707ED, 5DB8 4CB4 1EF5 E987 18A0 CD99 3554 3C13 9407 07ED
Bitcoin: 1LLDr7pnZDjXVT5mMDrkqRKkAPByPCQiXQ
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

range is a nice discovery because it seems that it was undocumented/not found before. :D

Here is all the data fields that are known until know:
http://transcendence.kronosaur.com/wiki ... ata_fields
http://transcendence.kronosaur.com/wiki ... tdatafield

we should update by adding "range" :)


thanks TVR ! :D
Post Reply