Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Increase enemy shooting range

hex_maze
Registered User
Quote
2020-08-02 03:05:45

Hey there

For my game, i'd prefer my enemies to be able to shoot at a bit of a longer range. They move right up to each other and shoot ppint blank. I've tried fiddling with the activation and shoot range, it doesn't change.

Are there any scripts or anything that can allow them to at least stop and fire from a few metres away??


Robo
Guest
Quote
2020-08-04 16:55:39

Sounds like you have selected for "Shoot" to directly hit instead of using the "use scene node clone as bullet". The enemy will then shoot from a distance.


hex_maze
Registered User
Quote
2020-08-08 20:13:02

I have been using only 3d nodes for bullets, they still don't fire from a distance, i don't understand what's going on.

Proximity based shooting seems to work, but they only target the player camera and not other nodes.


count2rfeit
Registered User
Quote
2020-08-09 16:39:18

you can try this (from CC documentation)

ccbAICommand(sceneNode, command, param)

Note: This function is not available in the editor.

Sends a command to an object with the behavior 'Game Actor with Health'. In this way, it is possible to make the object move somewhere, attack something, or similar.
Paramers are:

sceneNode: Node where this is applied to. The node has to have a Game Actor with Health behavior attached to it.
command: String with the command. See below.
param, Parameter for the command. See below.


Possible commands and parameters for the AI are:

"cancel" - AI will cancel the current action it is doing (shooting, walking etc) and start doing nothing, or start the next action which makes sense to it in the current situation (like attacking a nearby enemy). The parameter will be ignored and can be null.
"moveto" - AI will move to a 3d position. The parameter needs to be a vector3d() with the 3d position where to move to.
"attack" - AI will attack the enemy which is supplied as parameter. The ai will attack the enemy even if it is outside of the range of its weapon.


Examples:

var s = ccbGetSceneNodeFromName("man");
var otherNode = ccbGetSceneNodeFromName("soldier");
ccbAICommand(s, "attack", otherNode);

Lets an AI with the name "man" attack another node with the name "soldier".



hex_maze
Registered User
Quote
2020-08-14 09:02:13

So does that go into a blank .js file? I'm not that good with scripts yet so i'm a little confused.


count2rfeit
Registered User
Quote
2020-08-14 16:08:52

[URL=http://www.mediafire.com/view/27r4b6hmqzo3e6h/execute_java_script.png/file]
🔎︎
[/URL]

under the behaviors tab choose a behavior to use (before first drawing do something - or a behavior triggered by event) then go to 'special' and then to 'Execute Java Script'

there you can copy and paste the script you want to use


hex_maze
Registered User
Quote
2020-08-14 19:57:40

Ohh so THAT'S how it works. That's really useful. Thank you!


Create reply:


Posted by: (you are not logged in)


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