Author Topic: Odd Syntax?  (Read 444 times)

If possible, I would like to keep my project secret. The following is in a function, brackets line up perfectly, and every variable is correctly defined. The only problem is that I am getting a weird syntax on the equals sign. I copied a line below and above it, so you can see what is surrounding that line of code.
Code: [Select]
%heroname = getword(%fo.line1,1);
$HeroAttack.Hero_[%heroname]_Occupied ##=## false;
$HeroAttack.Hero_[%heroname]_Job = getword(%fo.line2,1);
« Last Edit: February 16, 2013, 04:20:21 AM by Honorabl3 »

Syntax error is always before the ##s, that's just when the engine actually fails to compile it.

I'm pretty usre you can't have anything after the %heroname]

What you actually do with that (and will produce the same result) is
$HeroAttack.Hero_[%heroname,Occupied] = false;
$HeroAttack.Hero_[%heroname,Job] = getword(%fo.line2,1);


Alright, I'll try your fix chrono..

Syntax error is always before the ##s, that's just when the engine actually fails to compile it.

I'm pretty usre you can't have anything after the %heroname]

What you actually do with that (and will produce the same result) is
$HeroAttack.Hero_[%heroname,"Occupied"] = false;
$HeroAttack.Hero_[%heroname,"Job"] = getword(%fo.line2,1);
" " 's?
« Last Edit: February 16, 2013, 10:02:25 PM by Alphadin »

" " 's?

Not strictly necessary for single-word strings like Occupation

However, because of Torque works, it might turn into occupation or OcCuPaTiOn if someone has already defined that string with different capitalization.

" " 's?
I was already aware of them needing to be there. But thanks anyway.