strange syntax error

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: strange syntax error

Post by Aero »

Code: Select all

if u=="" or u==null then
return 0
elseif u=="\b" then
return 8
elseif u=="\t" then
return 9
elseif u=="\n" then
return 10
elseif u=="\f" then
return 12
elseif u=="\r" then
return 13
endif
Just change that to this...

Code: Select all

if u=="" then
return 0
endif
Just rationalize it a bit...
local string u=SubString(char,0,1)

First of all, a string can't be 'null' so we can remove that comparison.
Second of all, the substring u will ALWAYS either be "" or a string length of one (char,0,1) 1-0=1

Therefore, how can a string with a maximum string length of one be equal to "\b" (A string of length two).

Seems to me like you don't really have a problem--it looks like a form of protection if anything.
And believe me, posting in JASS section is your best bet.
User avatar
itsonlyaname
Senior Member
Posts: 195
Joined: February 13th, 2008, 5:30 pm

Re: strange syntax error

Post by itsonlyaname »

that seems to have fixed the jass error (at least jasscraft says so)
but i still cant play the map for some reason. blank player screen.

isn't this the jass section ?
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: strange syntax error

Post by Aero »

Well, if you didn't screw up somewhere in the .j script, then a few of the following are possible:

Attributes isn't deleted.
Xdep corrupted the map (Or some other program).

'Cause, if the .j script is fully functioning and has no issues, then the problem is in the other vital wc3 files.
User avatar
itsonlyaname
Senior Member
Posts: 195
Joined: February 13th, 2008, 5:30 pm

Re: strange syntax error

Post by itsonlyaname »

attributes never was in the map . . so it must be becous of x-dep (kinda makes sence, just after deprotecting the .j script got errors while befor it doesn't have.)

edit: i found a similar map with "\f" in it, tough that one worked perfectly (i just ignored jasscraft saying it's a error there)
-but, what else can it be then ?
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: strange syntax error

Post by Aero »

Try without xdep.
User avatar
itsonlyaname
Senior Member
Posts: 195
Joined: February 13th, 2008, 5:30 pm

Re: strange syntax error

Post by itsonlyaname »

first time i edited a map without xdep :lol:

but, it worked, thanks :D
Last edited by itsonlyaname on February 21st, 2008, 4:21 pm, edited 1 time in total.
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: strange syntax error

Post by Aero »

There ya go.
This is why I steer clear of xdep.