Is there a script available to turn particles off and on by clicking on the object?
-Soleil
These forums are CLOSED. Please visit the new forums HERE
ON/OFF Particle Switch |
|
Soleil Samiam
Registered User
Join date: 17 Mar 2005
Posts: 2
|
03-20-2005 02:35
Is there a script available to turn particles off and on by clicking on the object?
-Soleil |
Fuzzy Duck
Out Of Focus
![]() Join date: 19 Feb 2005
Posts: 48
|
03-20-2005 04:01
something along the lines of ......
CODE
Insert your own particle system at "// particles system stuff" and that should do it. _____________________
Buy my Emoti-Buddy's Available at
Out of Time in Sage, Out of Time in Albion, Cyrus Designs in Sido, Gigas Supermall in Garrison and on secondserver.net ![]() ![]() ![]() ![]() |
Sorin Rubio
Registered User
Join date: 26 Mar 2004
Posts: 8
|
03-20-2005 04:29
Fuzzy's method will work, but if you want to avoid using state changes:
CODE
|
Fuzzy Duck
Out Of Focus
![]() Join date: 19 Feb 2005
Posts: 48
|
03-20-2005 05:03
The Wiki says States are a good programming practice ..
States vs. Global variables A state and a set of global variables can serve the same purpose, and each can be expressed in terms of the other. In general, you should prefer the use of states over global variables since states allow you to immediately assume script state without making comparisons. The less comparisons a script makes, the more regular code statements it can run. _____________________
Buy my Emoti-Buddy's Available at
Out of Time in Sage, Out of Time in Albion, Cyrus Designs in Sido, Gigas Supermall in Garrison and on secondserver.net ![]() ![]() ![]() ![]() |
Sorin Rubio
Registered User
Join date: 26 Mar 2004
Posts: 8
|
03-20-2005 05:57
Ah, I'll keep that in mind, thank you.
|
Catherine Omega
Geometry Ninja
![]() Join date: 10 Jan 2003
Posts: 2,053
|
03-20-2005 06:26
Eggy was trying to explain the reasons for choosing states over global variables in this thread. I have to admit, I wasn't totally clear on his point, as it didn't seem nearly as important as he was making it out to be. I freely admit that while I certainly know more than most people, I still don't understand anywhere near as much as I'd like to. Fortunately, I eventually figured out what he was getting at, and surprise, surprise, he's right.
![]() By comparing Jillian's and Jeffrey's scripts in this thread, we can immediately see the advantages of using states over variables. In Jillian's example, not only must the script check a variable every time it's clicked, it also still processes clicks while it would otherwise be sleeping. Compare that with Jeffrey's states example, where there's no checking necessary, ever, and the script doesn't even do any processing while it's sleeping. There isn't even a touch_start event in the "wait" state. Both methods accomplish the same task, but Jeffrey's is more efficient. _____________________
|