Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Resurrecting the dead

floydness
Registered User
Quote
2021-03-19 01:43:27

I've tried everything I can think of. I shoot the enemy. He falls down dead. I goto ondie and add change position to random spot and also restart behavior of node. I can get the enemy to go to the random spot but not come back to life.
I tried to add which anim to play after the restart command with no luck. Seems like these pick and choose actions should work but they don't or there is something I'm missing. Trying to do more or less a 1 on 1 deathmatch. I can clone the animmesh so there's a body where he went down even though the actual player has moved but I just cant get him to come back to life.
I feel like a failed Dr Frankenstein.... your thoughts?


smnmhmdy
Registered User
Quote
2021-03-19 14:59:53

You have to reset his health
ccbSetCopperCubeVariable("[hashtag]NAME.health", 100)

and cancel his active task (which is playing dead) by using
ccbAICommand(ccbGetSceneNodeFromName("NAME"), "cancel")

You don't have to restart his behaviors


floydness
Registered User
Quote
2021-03-19 15:47:16

Bear with me but what goes in ":hashtag"
and "NAME" and do I add that as execute JS?

This is all new to me and I REALLY appreciate you taking time
to help. Thanks


smnmhmdy
Registered User
Quote
2021-03-19 16:51:21

"NAME" is just the name of the node which you want to resurrect, for example if it's name is "soldier", replace NAME with soldier.
The forum doesn't allow putting hashtags (shift + 3) that's why I wrote it as [hashtag], just replace it with the actual symbol and execute it as javascript :)


floydness
Registered User
Quote
2021-03-19 17:48:14

When imported Coppercube changes the name of the model to AnimatedMesh3 so I'll try that or the actual name.
Thanks


floydness
Registered User
Quote
2021-03-19 17:56:15

🔎︎



floydness
Registered User
Quote
2021-03-19 18:00:06

https://ibb.co/RYSV9kZ


smnmhmdy
Registered User
Quote
2021-03-19 18:29:27

Yup, just remove the space between hashtag and AnimatedMesh3 and put semicolon at the end of each command
ccbSetCopperCubeVariable("[hashtag]AnimatedMesh3.health", 100);
ccbAICommand(ccbGetSceneNodeFromName("AnimatedMesh3"), "cancel");



floydness
Registered User
Quote
2021-03-19 19:59:18

Well, it still isn't working so I'm concluding that it has to do with the model. A shame because there aren't too many free animated wolf models out there. Here's the link to the one I'm using.
https://www.cgtrader.com/free-3d...

If anyone has a working model of a wolf,coyote,fox or other suitable varmint let me know where I can get it.
I hate to change the theme of my game...

Thanks again smnmhmdy !


smnmhmdy
Registered User
Quote
2021-03-19 20:36:59

Are you using "Game Actor with Health" for the enemy? I'm pretty sure it has nothing to do with the model... Have you tried to execute the code inside of a "When a key is pressed do something" action?


floydness
Registered User
Quote
2021-03-19 20:53:22

Yes I'm using Game Actor and Collision
No, I haven't tried using When a Key is pressed
since this action can only occur when the wolf is dead.
so I'm putting it in ActiononDie


floydness
Registered User
Quote
2021-03-19 22:56:09

Worked it out. What I'm doing is every so many seconds clone the wolf and change the clones position.

Easy solution. Don't know why I didn't think of it sooner
Now the gameplay will involve multiple wolf attacks rather than just one at a time. Hopefully....


floydness
Registered User
Quote
2021-03-20 02:37:59

Works except for the fact that each clone also clones itself every loop and it doesn't take too long before there's hundreds of wolves.
I know the JS code can be fixed except don't know JS so
it's going to be some figuring out. If I were using basic
it would simply be at the start of the function add
spawn=rnd(10)
if spawn<>1 then return

No matter what I do I can only buy more time before the inevitable but that will be the game. If you can kill as many as possible as fast as possible you can survive. So I can keep track of time and give a high score for time survived.

Simple little game.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internatio?al" (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