ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Programming and Scripting
forum topic indicator clone enemy share the same health as the original
person icon
mark221
Registered User
Quote
2023-01-07 16:28:56

I try try to figure out why my cloned enemy share the same health as the original, because when I kill a clone, the original and all other clones die at the same time. I searched on the forum, but I'm not sure I understand. Although I'm sure this subject was brought many time before.
I'm sure the solution is with javascript.

Edit: I solved my problem. Needed to change delete node in my original node to current scene node instead of enemy.

Well , nobody answered. Too bad for me. Still happy I could solve this. Good day to everyone.

person icon
VP
Guest
Quote
2023-02-08 09:06:24

Glad you found a solution. People need time to respond to posts on the forum, we weren't ignoring you.

Whenever I clone an enemy, I have the original node "hidden" and placed at position "0,-1000,0", below the map/terrain and can't be shot or collided with during game-play.

When I clone it, I then make the cloned nodes visible (but keep the original untouched and hidden) -so all clones are new and fresh. This way, new clones will always have full health and coppercube automatically calculates any new damage to health and implements death animation etc for each clone.

If you decide to clone a game character after it's been killed, the new node will also have zero health - you can replenish health using the special vaiable (hash)nodename.health. This would probably become confusing if you're using script/code - but I think you can get the clones unique node ID and then set it's health that way.


Create reply:










 

  

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


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






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