Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Question about RPG Project

kuuhaku
Registered User
Quote
2017-08-07 07:29:39

So...
1: How to make a Lock On system?
2: How to make a health bar?
3: How to make actor finish their animation? For some reason when my character walk out of the enemy attack range while the enemy is attacking they cancelled their animation and then they follow me until im in range again then they do the attack animation again. And when my character doing attack or dead animation, if i press a movement key the animation will get overwritten and my character return to his normal animation.
4:Set animation to a specific area? i add an action that when you press the button you will do an animation in a specific spot and i used move by a vector but the character wont move to that area. I know this is a dumb question but i dont have time to think.
And im new to javascript so if i need to add javascript please give me a reference. Thank you.


erik
Registered User
Quote
2017-08-07 17:22:20

Not sure what a lock on system is?

About a health bar: see this thread: http://www.ambiera.com/forum.php...

Not sure about that animation. If you are dead, you shouldn't be able to move anymore, no? What behavior is it you are using?


kuuhaku
Registered User
Quote
2017-08-08 06:47:33

It's kinda like the Dark Souls Lock-on system when you lock the target you will alway face torwards the enemy like a duel or something. And about health bar, can 2d image overlap eachother? My idea is to set a variable so that when the enemy take damage there will be a transparent 2d image go and hide part of the health. And when the variable equal 0 the enemy will play a death animation, give player money and disappear.


remo
Registered User
Quote
2017-08-08 12:38:29

1: How to make a Lock On system?


http://necromanthus.com/Test/htm...

Get close to the dog and see its behaviour.
So in this case it's about dog.lookAt(camera)
Obviously, the inverted behaviour is
camera.lookAt(enemy)
That's what you need.
Just study the source of this demo and you'll figure out what to do.


ishmaru
Registered User
Quote
2017-08-08 14:48:59

Cameras don't lootAt anything, to properly orient a camera you have to edit its "Traget" via Javascript Api

You need to use an "every few seconds do something" behavior set t a low value like 10 then execute this javascript:
var targetNode = ccbGetSceneNodeFromName("cubeMesh1");
var camNode = ccbGetSceneNodeFromName("Camera1");
var position = ccbGetSceneNodeProperty(targetNode, "Position");
ccbSetSceneNodeProperty(camNode, 'Target', position);


Of course replace cubeMesh1 and Camera1 with the appropriate scene node names.


remo
Registered User
Quote
2017-08-09 08:22:43

Cameras don't lootAt anything,


That's a FALSE statement.
In any decent 3D engine:
node1.lookAt( node2 )
Where the nodes can be cameras, lights, meshes, groups, ... almost everything.

p.s.
All the noobs are game developers these days ...


remo
Registered User
Quote
2017-08-09 08:43:31

And a tip for Niko and his CC development:

(node1 front direction) lookAt (node2 position)

As I said before, this is available in any decent 3D engine.


ishmaru
Registered User
Quote
2017-08-10 06:26:07

wrote:
Cameras don't lootAt anything,


That's a FALSE statement.
In any decent 3D engine:
node1.lookAt( node2 )
Where the nodes can be cameras, lights, meshes, groups, ... almost everything.



Its TRUE for CopperCube.
Weather that is how other engines do it or not, "node1.lookAt( node2 )" is NOT currently how cameras (or any scene node) work in CC. As per the current documentation, there is no single method to have a camera simply look at a scene node via the Javascript API.

The easiest solution would be to copy the position of the node and set the camera's target to that value. As per the code I submitted above.


Create reply:


Posted by: (you are not logged in)


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