Custom pixel version of (sysVectorPolarOffset ...)

This is a moderated forum that collects tutorials, guides, and references for creating Transcendence extensions and scripts.
Post Reply
PM
Fleet Admiral
Fleet Admiral
Posts: 2570
Joined: Wed Sep 01, 2010 12:54 am

Want a function that works like (sysVectorPolarOffset center angle radius), but uses pixels instead of range for radius? Try this function below! Copy-and-paste it to within the <Globals> of your mod, or wherever your code can access it.

Code: Select all

(setq ex912VectorPolarPixelOffset (lambda (theCenter theAngle thePixels)
	; range 1 = 24 pixels.
	(sysVectorAdd
		theCenter
		(sysVectorDivide
			(sysVectorSubtract
				(sysVectorPolarOffset theCenter theAngle thePixels)
				theCenter
			)
			24
		)
	)
))
Download and Play in 1.9 beta 1...
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Play a classic arcade game adventure, with or without more features (like powerups)!
Playership Drones: Buy or restore exotic ships to command!

Other playable mods from 1.8 and 1.7, waiting to be updated...
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.
Jeoshua
Militia Lieutenant
Militia Lieutenant
Posts: 163
Joined: Sat Sep 06, 2008 3:48 pm

I've made a utility function for the next version of Parallax Worlds very similar to this. If only the game gave us a normal pixel offset function, or kilometer offset, or any other offset than the 22-some-odd pixel offset that we have now.

You listening George? How about adding a parameter to SysVectorPolarOffset that declares the units to use, defaulting to lightseconds, but able to be any actual unit?
Post Reply