Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Specific enemy behavior

j9907
Registered User
Quote
2018-11-07 07:59:47

I'm guessing this would be doable, but I'm not too much of a wizard:

I want to have enemies who will follow a path and, when the character is within a certain proximity, he breaks out of that path and chases the character and, when you collide with him, it does a set of actions and respawns you (changes the position of the character).

Would I need the C++ code to do something this sophisticated? I'm thinking I could have the enemy run on a path and, on proximity, hide that version and move a different version of the enemy who is OOB (so he can't target the player) to the position of the path-following version.


behroz-khan
Registered User
Quote
2018-11-07 11:25:56

Well... As for making enemy follow a path, you can use the existing behavior of Game Actor (With AI, Player, Health etc...) and set the first property as "Follow a Path" but it won't terminate the path, won't shoot you and even chases you... So that behavior is useless... I will answer you whenever I found the solution...


just_in_case
Moderator
Quote
2018-11-07 23:19:35

Maybe something like this can work..

Use the behavior game actoe with health and ai to follow a path and also add an on proximity behavior to the player...

And execute a javscript code on proximity...

Var enemy = ccbGetSceneNodeFromName("enemy");
CcbAiCommand(enemy,"Cancel")
CcbSetCoppercubeVariable("follow",1);

Something like the above code should be executed...

Now add another behavior every few seconds do something then if a variable has a value...
Varianle name = "follow"
Value =1

Action to execute will change position on a scenenode, position type should set relative to a scenenode and then change which scenenode should be enemy and relative to which scenenode should be player...

So that it will follow thw player once it stops following path..

For cheking the collision you can add another proximity behavior the radius of this proximity sphere and then you can execute another action to respawn your character...

Hope that works...😊


Aarav
Guest
Quote
2021-06-04 14:11:17




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