Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Cloned Scene Node

seacloud9
Registered User
Quote
2011-01-11 01:52:14

Question if I clone a scene node how do I tell the newly cloned object to enable patrol "mode". I have been debugging the object in the console and I don't see a way to trigger the models "patrol" mode option. I can find the animations etc.. although I am not seeing the mesh modes. Please let me know thanks in advance. I really enjoy working with CopperCube / CopperLicht

Example:


function cloneEnemy(i){
var scene = engine.getScene();
var warlord = scene.getSceneNodeFromName('warlord');
var clone = warlord.createClone(scene.getRootSceneNode());
clone.Id = "war"+i;
clone.Pos.X += (Math.random() * 50) - 25;
//clone.setAnimation("Attack"); nice but needs to be mode "Patrol mode"
clone.Pos.Z += (Math.random() * 50) - 25;
return clone;
}

/// I call it by doing this where cloneEnemy is an array ///

for(var i=0;i<this.store.data.items.length;i++){
cloneEnemy[i] = new cloneEnemy(i);
}




niko
Moderator
Quote
2011-01-11 17:02:09

Try
clone.AIType = 2;

there is a reason this is not documented. :)


seacloud9
Registered User
Quote
2011-01-12 01:10:18

If I run that in Canary Chrome I currently receive -> RangeError: Maximum call stack size exceeded. This is with Copperlicht 1.3.2. I have tried to reduce the number for example to 2 or 5 but it only makes one clone. Sometimes it will execute the "patrol" although it still doesn't seem to attack. Your help is greatly appreciated in this matter. Thanks


seacloud9
Registered User
Quote
2011-01-12 01:48:19

Seems to work better on the webkit nightly build on osX. Googles Canary seems to have a possible bug one is on OSX and the other is running on Windows 7. Thanks for the reply that is helping


niko
Moderator
Quote
2011-01-12 16:04:38

Maybe it also helps to set the variables to values like these:
clone.PatrolRadius = 1000
clone.StartPositionOfActor = InitialPositionOfYourActor


seacloud9
Registered User
Quote
2011-01-13 03:14:18

I have started to play around with the clone object I have set the PatrolRadius.

I can see the characters after they are dynamically created. I have animations for this character hit, attack, stand, walk, etc.. I am just trying to create an array of enemy tag types and assign them the same properties I have currently set in CopperCube. By the way the binary compilation of the models is brilliant. This library runs quickly easily enables multiple scenes and is easy to use. I did submit a request for and indy license would really enjoy using it to its fullest capabilities thanks in advance.


var pc= scene.getSceneNodeFromName('PC');
// the I can see the pc object in the console just fine
// I am assuming this is something like below clone.StartPositionOfActor = InitialPositionOfYourActor ?
clone.StartPositionOfActor = pc.Pos




Create reply:


Posted by: (you are not logged in)


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