Modding, Mission Design, and Coding > The Scripting Workshop

Turrets, Orientation, and Vectors

<< < (2/2)

Nuke:
well i guess rotate and unrotate have alot of uses and can do some of what i need. be nice if i could create a matrix from scratch (without a masters in calculus). i think my big problem is i cant do my remote turret stuff. im curious if its a bug or just that i suck at math. would be nice if i could get direct acces to the gun normal, rather than deal with matrix based aiming.

WMCoolmon:
Split the thread. :p I also added a getOrientation() function to CVS, to the vector object. It'll take the vector as an fvec and pass it along to FS2's builtin function. It will create an internal normalized version of the vector regardless of whether it's actually normalized or not.

Nuke:
cool, im sure i can find many ways to use it.

Nuke:
well my turret code is getting pretty complicated. it works well but if im to command more that 5 turrets at once im gonna need to simplify my math. i  have a problem distinguishing between single part and multipart turrets. also setting the subsystem.Orientation and subsystem.GunOrientation will never guarantee that your turret will fire properly when commanded.

now i currently use mn.createWeapon() to kinda get around this. then i relized that you could kill all 3 birds with one stone by adding just one more turret var. along with Orientation and GunOrientation, i propose you add subsystem.Normal. it would be the actual firing normal of the turret at the time (not the static normal from the model, but rather the rotated vector the turret will fire along).

how does it kill 3 birds. well make it so that if the turret is a singlepart, GunOrientation comes up nil. then i can check to see if theres a gun object there before i start rotating submodels. it would reduce the math required a great deal if i didnt have to plot a normal for mn.createWeapon() to create a whole new gun. rather could simply use fireWeapon() to have the engine handle firing. also im not sure if mn.createWeapon()  allows me to use beams, flaks, or missiles, which would be usefull for capship command missions.

Navigation

[0] Message Index

[*] Previous page

Go to full version