I am not sure I understand the maxscript refrence. It just makes a statement with no backup, and I seem to have proved it wrong. Anyways, I will be reading that discussion as soon as I have a password. Thanks!
Wahooney, you can email that scene to me instead… cryptite@hotmail.com is my address.
Flipped, don’t get me wrong, I appreciate the help. The script seems to be working for the most part. As boa said, i’d love to bring amckay or bobo, or oleg in here to see what they think about your script…
Don’t worry (either of you), I’m not offended or anything. It takes a lot to offend me .
I posted it on the discreet thread, so we will see what they say (I am Eric_Burnett there if you visit that forum too). Both Bobo and Oleg are there, so I should get a good response one way or another. Its always good to hear what they say, even if they are telling you you are wrong ;).
Now, as a mind problem, I have to figure another way to do something like that without creating lights within an on proceed method. They could be created at the start, but you would need to create as many lights as particles…kind of wasteful in my mind. Anyone have any thoughts?
Maybe it is enough to create say 5 lights because not all shots hit a the same time. Creating these in advance, setting their positon and the other properties in a proceed handler plus cycling through them.
Boa
Could you have it perform like “recyclable” lights? Like boa said, have it create 5 lights but instead, take those 5 and have the script move them to where the new particles die and then just redo their intensity, rinse and repeat if you catch what i’m saying. Sounds a bit difficult, if not near impossible…
Should be possible, but that means that there would be an upper limit of lights at any given frame. I think it would just require two global arrays, a 1d one with the objects, and a 2d one with the active and inactive status at any given frame. It would just have to check each light at the given frame and the next 10 or so, and if they were free, it could be used.
I think I could do it, but I will have to sort out global variables first (they don’t seem to work quite right for me), and learn better how the different methods work (on proceed, init, etc). I might try that, depending on the response from the discreet forum.
Before I get started on that, just wanted to give you an update. I can see what you mean about flakey script. I did a test sequence, and it 1) only creates 1 particle per frame max, and 2) had trouble figuring out where to put that one. I have redone the script, so it should work better now. It is http://ericburnett.homeip.net/explosions02.max if you want the scene again.
on Proceed pCont do
(
if sliderTime.frame != 0.0 do (
for i=1 to pCont.numParticles() do
(
pcont.particleIndex = i
str = "ExpLight" + (pcont.getParticleID(i) as string)
try (
x = execute( ("$" + str) )
delete x
)
catch (
print "no previous ExpLight found"
)
x = omnilight name:str multiplier:0.0 pos:
(pCont.getParticlePosition(i)) rgb:
(color 255 255 255) excludeList: #($Sphere01, $Target_Proxies)
y = currentTime.frame
animate on (
at time (y-1) x.multiplier = 0.0
at time y x.multiplier = 0.6
at time (y+10) x.multiplier = 0.0
)
z = "light created at "
z += (currentTime.frame as string)
z += "From particle "
z += (pCont.getParticleID(i) as string)
print z
)
)
)
And thanks for all the feedback guys! Makes everything much easier (and more fun!)
Eric, I couldn’t download your second scene. I’ll try it later again, maybe your server will be up again.
I see that you haven’t got an answer on the discreet board. To get the attention of Oleg or Bobo it could be better to start a new thread.
Boa
Sorry, I am switching servers now, so I accidentally screwed up the port forwarding. Thats the trouble when you run your own stuff…no one else to blame. It should work now.
And I may have to make another thread, but I think I will give it a bit longer. Bobo had said he would return with an example to someone else in the thread, so hopefully he will :shrug:. If he does not, then I will create a new one, yeah.
Hi Eric,
the lights are not positioned properly in your script. Therefore they are all created at 0,0,0. Use “pCont.ParticlePosition” instead of “pCont.getParticlePosition(i)”. Besides that your script functions well.
There is one thing I saw in the listener that I can’t explain: Most lights (not all) are created twice. Do you know why?
Boa