Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I'm not sure why the engine lacks instance/node variables but it would really enhance the level of functionality when it comes to accessing/cloning nodes data. At the moment I was able to make use of 'Special Variables' feature but giving the 'Game Actor with Health' behavior to any node that requires node-specific variable is a bit unpractical. I would really like to see this feature introduced in some of the following Coppercube versions, I believe it would be a very big step when it comes to node-related functionality. |
||||
|
I found this work around, use dynamically created copercube variables.
When cloning the nodes I recommend using JS to rename the cloned nodes using an incrementing coppercube variable that increases after each clone, to make sure each node has a unique name. |
||||
|
Damn never thought of dynamically creating variables based on node names, that's much more elegant solution, cheers! Since I was using 'AI for Melee Combat' behavior I had 'Game Actor with Health's movementspeed var cleared :) This was my take: var node = ccbGetCurrentNode();...first two numbers are armor, third number is sword, fourth number shield :) I'ts working but your solution is much simpler. |
||||
|
Not to mention easier to decipher. :) |
||||
|
Code worked out but, unfortunately, every enemy i clone is dead :) If I change the clone's name he seem to lose health/damage values & appear in his dead-state/animation :) var sourceNP1 = ccbGetSceneNodeFromName("enemyAA");////////// Edit ...no, this seems to be working now, I'm not sure why it didn't work first couple of tries, I must of done something wrong with the code before :/ |
||||
|
In terms of the code above that looks good, though it seems to be missing the dynamic variables we talked about before. Not sure if this is intentional or not. It's hard to fully grasp what's going on without seeing all the code or even the sceen. Can you answer some questions so I can get a better idea? 1 Are you using coppercube character behavior for health or does your script handle this? 2 similarly what is controlling your animations? 3 What node is the above script running on? The original node, or a separate node entirely? 4 is there any other script running that my be overlapping functionality? Like animation or movement? |
||||
|
The code is working now, I'm not really sure why it is working now or why it didn't work before :/ I did a big amount of changes left & right in my scripts, hopefully it will stay working or I will figure out what change I've made that was beneficial :) Thank you again for your help, cheers! |
||||
|
NP, glad to help! |
|