PDA

View Full Version : call of duty 4 custom challenges error



sanyihun1923
19th November 2016, 11:17
hello all please can help me


******* script runtime error *******
++ must be applied to an int (applied to undefined): (file 'maps/mp/gametypes/_rank.gsc', line 1025)
level.challengeInfo[baseRef]["levels"]++;
*
Error: called from:
(file 'maps/mp/gametypes/_rank.gsc', line 77)
buildChallegeInfo();
*
Error: called from:
(file 'maps/mp/gametypes/_persistence.gsc', line 24)
maps\mp\gametypes\_rank::init();
*
Error: called from:
(file 'maps/mp/gametypes/_globallogic.gsc', line 4224)
thread maps\mp\gametypes\_persistence::init();
*
Error: called from:
(file 'maps/mp/gametypes/_callbacksetup.gsc', line 15)
[[level.callbackStartGameType]]();
*
Error: started from:
(file 'maps/mp/gametypes/_callbacksetup.gsc', line 10)
CodeCallback_StartGameType()
*
Error: ************************************
********************
ERROR: script runtime error
(see console for details)
++ must be applied to an int (applied to undefined)
********************
----- Server Shutdown -----
==== ShutdownGame (1) ====
---------------------------

Ni3ls
19th November 2016, 11:32
level.challengeInfo[baseRef]["levels"] must be an integer. Use int(variable)

Whiskas
19th November 2016, 12:06
Replace in maps/mp/gametypes/_rank.gsc (Line 1025)


level.challengeInfo[baseRef]["levels"]++;

With:


level.challengeInfo[baseRef]["levels"] = int(level.challengeInfo[baseRef]["levels"]++);
level.challengeInfo[baseRef]["levels"]++;

serthy
19th November 2016, 14:42
Replace in maps/mp/gametypes/_rank.gsc (Line 1025)


level.challengeInfo[baseRef]["levels"]++;

With:


level.challengeInfo[baseRef]["levels"] = int(level.challengeInfo[baseRef]["levels"]++);
level.challengeInfo[baseRef]["levels"]++;


That doesn't look right to me..

also the error says ++ must be applied to an int (applied to undefined), so level.challengeInfo[baseRef]["levels"] does not exist

IzNoGoD
19th November 2016, 14:42
Please dont. Just set it to 0 if its undefined.

Also, this error is caused by something else, not your thingy being undefined. Probably wrong way to call code or smth.

sanyihun1923
19th November 2016, 18:03
Does't not work :( or bad syntax or ++ must be applied to an int (applied to undefined)

Whiskas
19th November 2016, 19:39
That doesn't look right to me..

also the error says ++ must be applied to an int (applied to undefined), so level.challengeInfo[baseRef]["levels"] does not exist

My bad.
10chars

serthy
19th November 2016, 21:53
Does't not work :( or bad syntax or ++ must be applied to an int (applied to undefined)

the error says ++ must be applied to an int (applied to undefined)

This means the following:
level.challengeInfo[baseRef]["levels"] is undefined (and not of type int where you could do a int++ operation on)
level.challengeInfo[baseRef] is defined, as the error wasn't thrown before

As IzNoGoD already said, the error probably comes from somewhere else.
You can also try (only for debugging purposes, as this does not fix the real cause) to set the variable: level.challengeInfo[baseRef]["levels"] = 0; ... before the ++

Without more information from you, we cant help you anymore than this.

sanyihun1923
20th November 2016, 19:04
this is a problem
ERROR: Trying to set a server-only stat 280.