PDA

View Full Version : Runtime error



zajcev
15th October 2019, 18:32
Hello, could you be so kind na help me fix this error, please?

******* script runtime error *******
undefined is not a field object: (file 'scripts/main.gsc', line 2074)
if( GetSubStr(self.blocker.targetname, 0, 1) == "wc")
*
called from:
(file 'scripts/main.gsc', line 2008)
zom thread UltraBoss();
*
called from:
(file 'scripts/main.gsc', line 1983)
thread SpawnUltraBoss();
*
called from:
(file 'scripts/main.gsc', line 1810)
level thread KillZombie(owner, attacker);
*
called from:
<removed thread>
started from:
(file 'scripts/main.gsc', line 1679)
self waittill("damage", damage, attacker, point);
*
************************************

******* script runtime error *******
cannot cast undefined to string: (file 'scripts/main.gsc', line 2074)
if( GetSubStr(self.blocker.targetname, 0, 1) == "wc")
*
called from:
(file 'scripts/main.gsc', line 2008)
zom thread UltraBoss();
*
called from:
(file 'scripts/main.gsc', line 1983)
thread SpawnUltraBoss();
*
called from:
(file 'scripts/main.gsc', line 1810)
level thread KillZombie(owner, attacker);
*
called from:
<removed thread>
started from:
(file 'scripts/main.gsc', line 1679)
self waittill("damage", damage, attacker, point);
*
************************************

******* script runtime error *******
pair 'undefined' and 'wc' has unmatching types 'undefined' and 'string': (file 'scripts/main.gsc', line 2074)
if( GetSubStr(self.blocker.targetname, 0, 1) == "wc")
*
called from:
(file 'scripts/main.gsc', line 2008)
zom thread UltraBoss();
*
called from:
(file 'scripts/main.gsc', line 1983)
thread SpawnUltraBoss();
*
called from:
(file 'scripts/main.gsc', line 1810)
level thread KillZombie(owner, attacker);
*
called from:
<removed thread>
started from:
(file 'scripts/main.gsc', line 1679)
self waittill("damage", damage, attacker, point);
*
************************************

******* script runtime error *******
cannot cast undefined to bool: (file 'scripts/main.gsc', line 2074)
if( GetSubStr(self.blocker.targetname, 0, 1) == "wc")
*
called from:
(file 'scripts/main.gsc', line 2008)
zom thread UltraBoss();
*
called from:
(file 'scripts/main.gsc', line 1983)
thread SpawnUltraBoss();
*
called from:
(file 'scripts/main.gsc', line 1810)
level thread KillZombie(owner, attacker);
*
called from:
<removed thread>
started from:
(file 'scripts/main.gsc', line 1679)
self waittill("damage", damage, attacker, point);
*
************************************
dvar set force_difficulty

******* script runtime error *******
pair 'undefined' and '1' has unmatching types 'undefined' and 'int': (file 'scripts/main.gsc', line 2143)
if(self.killed == true)
*
started from:
(file 'scripts/main.gsc', line 2155)
wait 1.0;
*
************************************

******* script runtime error *******
cannot cast undefined to bool: (file 'scripts/main.gsc', line 2143)
if(self.killed == true)
*
started from:
(file 'scripts/main.gsc', line 2155)
wait 1.0;
*
************************************

Thank you!

voron00
16th October 2019, 02:14
undefined is not a field object: (file 'scripts/main.gsc', line 2074)
if( GetSubStr(self.blocker.targetname, 0, 1) == "wc")


if (!isDefined(self.blocker.targetname))
return;

maxdamage99
16th October 2019, 05:24
undefined is not a field object: (file 'scripts/main.gsc', line 2074)
if( GetSubStr(self.blocker.targetname, 0, 1) == "wc")


if (!isDefined(self.blocker.targetname))
return;

Correction 1 line of code will not solve the problem. I think that in such scripts this is not the only error associated with this.

set server mode in


developer 0

or use libcod to avoid shutting down the server in case of such errors.

zajcev
16th October 2019, 08:30
Correction 1 line of code will not solve the problem. I think that in such scripts this is not the only error associated with this.

set server mode in


developer 0

or use libcod to avoid shutting down the server in case of such errors.

Yes, I realize that. So maybe it's the highest time to sent this mod to the doctor? Do you know a good one? maxdamage99, what do you think?

vanfreddy
16th October 2019, 20:08
this error looks like your trying to use a map which is not supported by this mod

zajcev
16th October 2019, 21:14
Indeed, I encapsulated history of the botzom maps ;)

maxdamage99
17th October 2019, 05:27
Yes, I realize that. So maybe it's the highest time to sent this mod to the doctor? Do you know a good one? maxdamage99, what do you think?

I don’t see the point in fixing this, the server works fine and in developer 0.
If you fear for debugging script errors then use libcod:

https://github.com/damage99/libcod/blob/master/libcod.cpp#L1326
- the same devloper mode only without crashing (the server continues to work after error), @Voron00 (https://github.com/voron00/libcod) did it a thousand years ago.

https://github.com/damage99/libcod/blob/master/libcod.cpp#L1334-L1339
- debugging mode improvements, even in developer 0 a script will be displayed, the path to it instead of "@45215". Some errors simply will not appear (errors comparing undefined with the bool / int / string and etc)

But if your mod and card are not designed for each other, then libcod no help :D