Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
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? |
||||
|
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 |
||||
|
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 |
||||
|
"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 :) |
||||
|
When imported Coppercube changes the name of the model to AnimatedMesh3 so I'll try that or the actual name. Thanks |
||||
|
|
||||
|
https://ibb.co/RYSV9kZ |
||||
|
Yup, just remove the space between hashtag and AnimatedMesh3 and put semicolon at the end of each command ccbSetCopperCubeVariable("[hashtag]AnimatedMesh3.health", 100); |
||||
|
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 ! |
||||
|
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? |
||||
|
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 |
||||
|
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.... |
||||
|
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. |
|