≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Action script crash problem
Posted by:
(you are not logged in)
Enter the missing letter in: "Internationa?"
(you are not logged in)
Text:
[quote][b]hadoken[/b] wrote: Does anyone have a glue why the following action script crashes in CC when used with "When a key is pressed do something" ? [code] /* <action jsname="action_AiMoveTo" description="Move AI npc to target node's position"> <property name="npc" type="scenenode" /> <property name="Target" type="scenenode" /> </action> */ action_AiMoveTo = function() { } action_AiMoveTo.prototype.execute = function() { var npc = ccbGetSceneNodeFromName(this.npc); var target = ccbGetSceneNodeFromName(this.Target); var targetpos = ccbGetSceneNodeProperty(target, "Position"); ccbAICommand(npc, "moveto", targetpos); } [/code] If I use the following "Execute Javascript" instead of having executed the action script it works but with error "Could not get property, provided scene node is invalid": [code] var npc = ccbGetSceneNodeFromName("npc"); var target = ccbGetSceneNodeFromName("Target"); var targetpos = ccbGetSceneNodeProperty(target, "Position"); ccbAICommand(npc, "moveto", targetpos); [/code] Maybe I missed something with the AI requirements? Thanks for any help.[/quote]
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