Node.LinkedInputNode()
Node.LinkedInputNode()
When using Node.LinkedInputNode() in a scenario and the Connector is not hooked up it will throw an error!
Is there a way to stop this error?
This Test.RsObj disconnects|connects the Connector so the error does not happen.
It also runs the Watch Dog Event when it is loaded into the scene by way of an OnPostLoad function, which is twofold.
One it wakes up the notorious sleeping Watch Dog Event and two, runs the script that is hooked up to it.
Load this Test.RsObj into a scene.
In the Link Editor, enter inside this Test.RsObj and connect the Cube's "WldMatrix" to the Watch Dog Event's "Change detect".
Watch the connection disconnect | connect when you run your mouse over and away from the Cube.
Is there a way to stop this error?
This Test.RsObj disconnects|connects the Connector so the error does not happen.
It also runs the Watch Dog Event when it is loaded into the scene by way of an OnPostLoad function, which is twofold.
One it wakes up the notorious sleeping Watch Dog Event and two, runs the script that is hooked up to it.
Load this Test.RsObj into a scene.
In the Link Editor, enter inside this Test.RsObj and connect the Cube's "WldMatrix" to the Watch Dog Event's "Change detect".
Watch the connection disconnect | connect when you run your mouse over and away from the Cube.
You do not have the required permissions to view the files attached to this post.
- clintonman
- Captain
- Posts: 5440
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: Node.LinkedInputNode()
Node.LinkedInputNodeCount to be sure something is connectedtrueBlue wrote: ↑03 Feb 2023, 17:23 When using Node.LinkedInputNode() in a scenario and the Connector is not hooked up it will throw an error!
Is there a way to stop this error?
This Test.RsObj disconnects|connects the Connector so the error does not happen.
Load this Test.RsObj into a scene.
In the Link Editor, enter inside this Test.RsObj and connect the Cube's "WldMatrix" to the Watch Dog Event's "Change detect".
Watch the connection disconnect | connect when you run your mouse over and away from the Cube.
Re: Node.LinkedInputNode()
I have that and it does not stop the error if it is Not connected.
Maybe it is wrong?ERR Source object: /Project/Space 3D/Test/LinkedInput Error: Microsoft JScript runtime error Description: Invalid procedure call or argument Error code: 0x800a0005 - (null) Line: 6, Char: 1 Script text: var inputNode = Node.LinkedInputNode(System.ThisName(), " Control In", 0)
Code: Select all
var inputNode = Node.LinkedInputNode(System.ThisName(), " Control In", 0)
if(Node.ConExists(inputNode, "Change detect")) {
if(Node.LinkedInputNodeCount(inputNode, "Change detect") == 0)
return;
}
- clintonman
- Captain
- Posts: 5440
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: Node.LinkedInputNode()
Backward, You have to test for the existence of a linked node before you try to use or get the linked node.trueBlue wrote: ↑03 Feb 2023, 23:38 I have that and it does not stop the error if it is Not connected.Maybe it is wrong?ERR Source object: /Project/Space 3D/Test/LinkedInput Error: Microsoft JScript runtime error Description: Invalid procedure call or argument Error code: 0x800a0005 - (null) Line: 6, Char: 1 Script text: var inputNode = Node.LinkedInputNode(System.ThisName(), " Control In", 0)Code: Select all
var inputNode = Node.LinkedInputNode(System.ThisName(), " Control In", 0) if(Node.ConExists(inputNode, "Change detect")) { if(Node.LinkedInputNodeCount(inputNode, "Change detect") == 0) return; }
Code: Select all
if(Node.LinkedInputNodeCount(inputNode, "Change detect") == 0)
return;
var inputNode = Node.LinkedInputNode(System.ThisName(), " Control In", 0)
if(Node.ConExists(inputNode, "Change detect")) {
}
- clintonman
- Captain
- Posts: 5440
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: Node.LinkedInputNode()
I see, I just rearranged the code. You're getting the link count of one thing and then trying to get the linked node of another thing. I can look at your actual code later.
- clintonman
- Captain
- Posts: 5440
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: Node.LinkedInputNode()
I don't know if this stops the error or not. No instructions on how to make the error happen and I don't know what this is trying to do, so this is just a guess. It looks the same as before the change when using the object nav widget. Also don't know what "run your mouse over and away from the Cube" means, so I just used the widget to move the cube around.trueBlue wrote: ↑03 Feb 2023, 17:23 When using Node.LinkedInputNode() in a scenario and the Connector is not hooked up it will throw an error!
Is there a way to stop this error?
This Test.RsObj disconnects|connects the Connector so the error does not happen.
It also runs the Watch Dog Event when it is loaded into the scene by way of an OnPostLoad function, which is twofold.
One it wakes up the notorious sleeping Watch Dog Event and two, runs the script that is hooked up to it.
Load this Test.RsObj into a scene.
In the Link Editor, enter inside this Test.RsObj and connect the Cube's "WldMatrix" to the Watch Dog Event's "Change detect".
Watch the connection disconnect | connect when you run your mouse over and away from the Cube.
Code: Select all
// Execute
// Called to execute the command
function Execute(params)
{
//var inputNode = Node.LinkedInputNode(System.ThisName(), " Control In", 0)
//if(Node.ConExists(inputNode, "Change detect")) {
// if(Node.LinkedInputNodeCount(inputNode, "Change detect") == 0)
// return;
//}
if(Node.LinkedInputNodeCount(System.ThisName(), " Control In") == 0) {
params.SetTerminationFlag();
return;
}
var inputNode = Node.LinkedInputNode(System.ThisName(), " Control In", 0);
if(!Node.ConExists(inputNode, "Change detect")) {
params.SetTerminationFlag();
return;
}
}
Re: Node.LinkedInputNode()
That works without errors.
Oddly though, the script that is hooked up to this script still runs even when it is not hooked up to the Watch Dog Event and run it from the Start button.
You would think that params.SetTerminationFlag() would stop it from running.
I can see that the Control Out = 2
Oddly though, the script that is hooked up to this script still runs even when it is not hooked up to the Watch Dog Event and run it from the Start button.
You would think that params.SetTerminationFlag() would stop it from running.
I can see that the Control Out = 2
You do not have the required permissions to view the files attached to this post.
- clintonman
- Captain
- Posts: 5440
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: Node.LinkedInputNode()
You can't tell a script is running by looking at it. Try adding a trace or alert inside the Disconnect nodetrueBlue wrote: ↑04 Feb 2023, 05:24 That works without errors.
Oddly though, the script that is hooked up to this script still runs even when it is not hooked up to the Watch Dog Event and run it from the Start button.
You would think that params.SetTerminationFlag() would stop it from running.
I can see that the Control Out = 2
LinkedInput script.png
Code: Select all
// Execute
// Called to execute the command
function Execute(params)
{
System.Trace("yes i am running")
Node.Disconnect(System.ThisOwner() + "/Watch Dog Event", " Control Out", System.ThisOwner() + "/LinkedInput", " Control In")
}
Re: Node.LinkedInputNode()
Ah, I see now!
I was fooled because the ConnectTo script also disconnects | connects.
Not understanding why, you do not know how to see this Test object in use.
The Test object is a 2D Encapsulation with the scripts and 3D object.
It is not necessary to select the 3D object.
Just use your mouse to hoover over and away from the 3D object.
trueSpace shows pre-selection highlight color.
When you hoover over the 3D object, it connects the Watch Dog Event to the LinkedInput script.
When you hoover away from the 3D object, it disconnects the Watch Dog Event to the LinkedInput script.
Anyways, it was just a Test object to test the LinkedInput script.
And now, thanks to you, it works without throwing an error.
Thank you!
When you are not busy maybe you can show how to use Node.LinkedOutputNode()
I was fooled because the ConnectTo script also disconnects | connects.
Not understanding why, you do not know how to see this Test object in use.
The Test object is a 2D Encapsulation with the scripts and 3D object.
It is not necessary to select the 3D object.
Just use your mouse to hoover over and away from the 3D object.
trueSpace shows pre-selection highlight color.
When you hoover over the 3D object, it connects the Watch Dog Event to the LinkedInput script.
When you hoover away from the 3D object, it disconnects the Watch Dog Event to the LinkedInput script.
Anyways, it was just a Test object to test the LinkedInput script.
And now, thanks to you, it works without throwing an error.
Thank you!
When you are not busy maybe you can show how to use Node.LinkedOutputNode()