Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
script 24: TypeError: other is undefined

Robbo
Guest
Quote
2023-03-23 23:01:13

I would say this is the most annoying and difficult error message in CopperCube to find and fix. Took me over two days to find and fix this problem...

1 - Firstly its giving you the wrong line number to look at - my problem actually was found in line 88, not 24....

2 - Secondly its giving you the wrong place to look for the problem with "script" - which typically means the JavaScript code boxes - not any Behaviour or Action as will normally specify which one is at fault if its a Behaviour...in this case the problem was actually in one of my Behaviour's...

3 - Also it seems to be saying a variable called "other" is undefined here .... Well, I don't use this variable name anywhere in my whole code so hence the issue nu 2.

4 - Its also saying its a type error - ie maybe trying to set a variable with the wrong type of information...which was not the case actually as the problem was not having defined a variable using 'this.xxx' at the start.

So the actual problem was a variable using "this." was not defined at the time it needed to use it...so its was NOT a type error at all nor any of the information given in the error message.....fck

Really wasted so much of my time over a stupid omission with bs error message from CC.....


just_in_case
Moderator
Quote
2023-03-23 23:29:09

well, this error was not due to the use of variable "this", it was actually due to the wrong use of vector3d.
in your code you need to make sure when you are dealing with vector stuff you are providing or feeding vector3d stuff.

like when you are using vector3d.add() or vector3d.substract() etc.

whenever you see that "other" is undefined then it is going to be an issue with your vector code.

 var v = new vector3d(1,2,3);
var z = v.substract();


this should give you the same error, here "s" in the substract method is going to be the "other" variable for the vector method.

Edit:- Updated the code to show the correct error. It happens when you don't specify other vector or parameter to the vector method.

hope this helps when you encounter this error in future.


Robbo
Guest
Quote
2023-03-25 05:51:16

Cool - was going to suggest changing the error message to show what is the problem but sounds like you already have, cheers!


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