Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Particles

dynamogames
Registered User
Quote
2022-06-04 11:59:41

Is there an action for particles in CopperCube. For example, like if I want a particle effect to start when an player shoots an enemy or when the player shoots an object.
I'll like to know if this is possible in CopperCube


coa
Registered User
Quote
2022-06-04 12:34:36

you could use this option.. child the fire with the object and when the object is hit ... show fire and then you can use do later hide fire. hope this helps


dynamogames
Registered User
Quote
2022-06-04 16:24:41

Yhh very nice idea but when I make the particle a child node and I publish the game(.exe), the particle does not show in the published version but when I don't make the particle a child node of the object, the particle shows in the published version. I really don't know how I can fix that.
Note that there's no behaviour on the particle to make it disappear


just_in_case
Moderator
Quote
2022-06-04 16:34:36

There is an option in the shoot action that is action on impact. you can simply change unhide the particle and change the position of the particle relative to the position of the bullet.

There is inbuilt example of particles in the engine, if you open that example project you will get to know that the clerk shoots a bullet and wherever that bullet collides it shows up the fire particle.
Check out that example demo and you will be able to figure that out. Hope that helps.


dynamogames
Registered User
Quote
2022-06-04 19:34:03

Wow thanks @ just_in_case


b3_studio
Registered User
Quote
2022-06-11 22:22:42

It is possible to make a continuous particle, where there are no interruptions, I need to make a fire for a rocket.


veganpete
Registered User
Quote
2022-06-13 11:23:47

Continuous? Do you mean fire from the back of the rocket?- Or continuous fire/explosion on the map, after the rocket hits the target?....

For smoke following a rocket - instead of attaching/childing the fire particles directly to the rocket, it's better to use the "follow" plugin instead - to make the fire particle-effect follow the rocket's-node. This will prevent the interruptions and make the particle effect look a lot better when it moves around and also allow you to move/hide/scale the rocket without affecting the direction/visibility/scale of the particles.

Also, instead of using show/hide for particle effects, use "change scale" or "animate scale" instead. Changing the scale from (1 to zero) instead of simply hiding the particle effect, will make the animation smooth, instead of immediately clipping it short.

Also, in the particle effect itself, select the "fade" option and set it to 1000ms or more and set the fade-target-value to be transparent (not opaque). This also smoothes out the fade transition when the particle effect is scaled to zero - instead of just instantly disappearing.

Use all 3 for a perfect rocket trail -
1= Follow rocket (instead of child)
2= Scale node (instead of hide)
3= Use particle Fade for 1000ms

If you just need a fire effect when the rocket hits the target (an explosion), do exactly the same thing described above - but instead of using "follow" in step 1, just use "change position" (of the particle effect) relative (0,0,0) to the target node when it hits the target node (using either "on proximity" for static nodes, or "action when hit" if using a node equipped with a game-character-behaviour).


b3_studio
Registered User
Quote
2022-06-13 18:08:14

And that's exactly what I need, where can I find this Follow plugin?


veganpete
Registered User
Quote
2022-06-13 19:36:22

Hi b3_studio I can't remember where I got it from but here's the code (I modified it slightly) - to make it work, simply copy&paste the text into a text document - save it and rename it as "follow2.js" (make sure replace the .txt extension with.js), it must be named exactly correctly orcoppercube wont accept it - then place it in your "My Documents>Coppercube>Plugins>Actions" folder - back up your project and then restart coppercube. It would then be available as a script in Coppercube>Actions>ScriptedBehaviours>Follow2....


/*
<behavior jsname="behavior_follow2" description="Follow2">
<property name="NodeToFollow" type="scenenode" />

</behavior>
*/

behavior_follow2 = function(){
}
behavior_follow2.prototype.onAnimate = function(currentNode){



var curPos=ccbGetSceneNodeProperty(this.NodeToFollow,"Position");
ccbSetSceneNodeProperty(currentNode,"Position",curPos.x+3,curPos.y+4,curPos.z+0
);

}


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "I?ternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact