Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: Mikael on March 25, 2008, 09:25:34 PM
-
I know that I'm completely hopeless, but I've been trying to implement an effect from wme_particles into my test project, but without success.
This is how I've done:
1) Copied the whole particles folder to my project.
2) Attached "particles script" to my test scene.
3) Added this script to "scene_init script" in my test scene:
var Ent = Scene.GetNode("Emitter");
Ent.MakeRain();
What happens is that I get the message "Call to undefined method 'MakeRain'" when I try to run the scene.
I'm probably missing something very fundemental here.
Thanks in advance!
Mikael
-
you have to attach the script to the entity/region not to the scene
first create a region called "Emitter" in SceneEdit
Attach the particles script to it in SceneEdit
Add like you have done to scene_init:
var Ent = Scene.GetNode("Emitter");
Ent.MakeRain();
i am not sure if MakeRain(); needs some parameters - just look in the particles script for this
it should work ..
stucki
-
That makes absolute sense.
However, error messages are now all over the place:
22:46: Runtime error. Script 'particles\particles.script', line 130
22:46: Call to undefined method 'DeleteParticleEmitter'. Ignored.
22:46: Runtime error. Script 'particles\particles.script', line 131
22:46: Call to undefined method 'CreateParticleEmitter'. Ignored.
22:46: Runtime error. Script 'particles\particles.script', line 135
22:46: Call to undefined method 'AddSprite'. Ignored.
22:46: Runtime error. Script 'particles\particles.script', line 140
22:46: Call to undefined method 'SetBorder'. Ignored.
22:46: Runtime error. Script 'particles\particles.script', line 141
22:46: Call to undefined method 'SetBorderThickness'. Ignored.
22:46: Runtime error. Script 'particles\particles.script', line 168
22:46: Call to undefined method 'Start'. Ignored.
Am I missing the blindingly obvious here?
Thanks,
Mikael
-
Forget the last post! I created a sprite entity instead of a region entity, that was the problem.
It works now, thank you very much.
Mikael
-
sorry if i mislead you .. but i meant the green region entity. this is even better than the yellow sprite entity becuase you can set it as a mask for the particles. just adjust its borders in sceneedit and
set the .UseRegion attribute to true.