Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
how to add interval between Enemy shots/ bullets so they dont just shoot you five times in 1 second

faith_254
Registered User
Quote
2018-08-20 10:00:09

plz help
i want to add an interval between the ai/ enemy bot shots


just_in_case
Moderator
Quote
2018-08-20 20:02:16

You can use every few seconds do something...and do something later action together...
For example
Every 1000 ms execute a javascript

Var enemy =ccbGetSceneNodeFromName("enemynode")
ccbAiCommand(enemy,cancel)

Then add an action to this behavior do somwthing later 1000ms then use restart behaviour of a scene node action and slect the enemy scenenode...


The javascript command will stop the enemy to shoot every 1 second and after that enemy will start shooting again after 1 second... You can play with the value of ms...for making the enemy shoot according to your game needs...

Hope this works for you


faith_254
Registered User
Quote
2018-08-20 23:29:49

thanks
so basically create a every few seconds execute java then reset behavior of scene node
ps do i have to replace enemy node in the code to my actual ai name?


faith_254
Registered User
Quote
2018-08-20 23:51:26

the dubug console keeps saying syntax error mising arguement
i used this code
var enemy = ccbGetSceneNodeFromName("Animated Mesh2")
ccbAiCommand(Animated Mesh2,cancel)



just_in_case
Moderator
Quote
2018-08-21 02:54:12

Your code.... Doesn't make sense....
The code should be...


Var enemy= ccbGeSceneNodeFromName("Animated Mesh2")
ccbAiCommand(enemy,cancel)
here you have to use enemy not aninated mesh.. As animated mesh2 is not defined...


Create reply:


Posted by: (you are not logged in)


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