Notifications
Clear all

[Closed] Matching Mesh rotation to Particle Rotation

Thanks bobo, once I get my new computer working, i’ll be able to look at that asteroids script. For now, i’m hosed with max 6 for the time being. I’m sure i’ll have questions when i try to assimilate it into my space battle.

Alright, i finally got max 7 up and running on my new computer…

This scene helps alot bobo, I’m still confused about a bit of the scripting, but I haven’t had a chance to look at it in-depth yet. I’m sure i’ll have lots of question soon enough. Thanks for the script!

Ok i’ve been working on making the script support multiple ships. This is what I changed in the Script Operator for generating the ships’ TM’s

on Proceed pCont do
(
Asteroids_Ship = #()
count = pCont.numParticles()
for i in 1 to count do
(
pCont.particleIndex = i
if pCont.particleTM.row4 != [0,0,0] do
Asteroids_Ship[i] = pCont.particleTM
–print Asteroids_Ship TM’s
)
)

The area i’m having problems with is looping the bullets through each ship, like you said. This is what I have so far for the bullets’ birth script:
on Proceed pCont do

(
t1 = pCont.getTimeStart() as float
t2 = pCont.getTimeEnd() as float
for i in asteroids_Rocks do
(
theCount = pCont.NumParticles()
if theCount < 10 then
(
theShipTM = copy Asteroids_Ship[i]
theShipTM.row4 = [0,0,0]
theShipLookVector = normalize ([0,1,0] * theShipTM)
theShipToRockVector = normalize (i.row4 – asteroids_ship.row4)
theAngle = acos (dot theShipLookVector theShipToRockVector)
if theAngle < 10.0 do
(
pCont.AddParticle()
pCont.particleIndex = theCount + 1
pCont.particleTime = t1/TicksPerFrame
pCont.particleAge = 0
pCont.particleTM = asteroids_ship
–pCont.particlePosition = asteroids_ship.row4
–print pCont.particleTM
pCont.particleSpeed = [0,0.05,0] * theShipTM
)
)
)
)

…I gather that somehow I need to run theShipTM through for each ship-particle, but I’m not entirely sure how to do that… In any case, the problem seems easily fixable, then having multiple ships should be no big thing…

Any help would be greatly appreciated, guys. I’m anxious to be able to implement this into my PFDSB

Page 2 / 2