Author Topic: Syntax Errors  (Read 487 times)

so I made a new Weapon, and I downloaded a addon set for melee weapons

Code: [Select]
>>> Some error context, with ## on sides of error halt:
^stateFire[3]                    = true;

^stateAllowImageChange[3]        = false;

^stateSequence[3]                = "Fire";

^stateScript[3]                  = "onFire";

^stateWaitForTimeout[3]^^= true;

^stateSound[3]                   = KukriSwingSound



^stateName[##4##]^^^= "CheckFire";

^stateTransitionOnTriggerUp[4]^= "StopFire";

^stateTransitionOnTriggerDown[4]^= "Fire";



^

^stateName[5]                    = "StopFire";

^stateTransitionOnTimeout[5]     = "Ready";

^stateTimeoutValue[5]            = 0.2;

^stateAllowImageChange[5]        = false;
>>> Error report complete.

Any help? I'm new at editing scripting

You're missing a semicolon at the end of "KukriSwingSound."

Ok, now When I try to spawn it, it doesn't spawn, Should I just give you the Addon to see what's wrong or something?

No, If you can't spot a missing semi-colon, you should go read a scripting tutorial and move on to other projects. 

That's not helpful. OP, you should post a detailed description (including your code) in Coding Help.

what is the rest of the code? it doesn't look like that chunk should stop the item from spawning
No, If you can't spot a missing semi-colon, you should go read a scripting tutorial and move on to other projects. 
or you're just trying to be an starfish
something small like that can be missed easily

If I was to take his add-on and fix it for him he would be left with a working add-on and no knowledge of how it was fixed or what was wrong.  And he might end up just coming back again for more help.

Learning to troubleshoot your own problems is more helpful to you and those around you than just fixing a problem straight up could ever be.

Every other line in that sample of code ends with a semicolon.  It says ">>> Some error context, with ## on sides of error halt:".  So the error must be SOMEWHERE around those hashes.  He's either lazy or he doesn't know enough to fix simple errors.  I see him coming back to the help section again and again asking for others to fix his problems.

I don't mean to be dismissive, I just think he should get some basic scripting and troubleshooting knowledge before running to the forums for help again.

Also, OP, if you paste your code into this program when you're done it should help you learn syntax.  (Has an autochecker)
Torque Dev (IDE with autocomplete and live error checking)
http://localhostr.com/files/8UvPqPT/netMerics%20TorqueDev.zip