View Full Version : [HOW-TO] Edit SCAR files with Syntax Checking, Highlighting, and Code Completion
Miguel
4th Dec 10, 6:00 PM
Download Lua for Windows (http://code.google.com/p/luaforwindows/) and install it (I assume you've installed it in the default directory for this tutorial)
Install Lua for Windows, then open SciTE in C:\Program Files (x86)\Lua\5.1\SciTE\SciTE Lua.exe
Click Options\Open Global Options File
Around line 349 there's a list of file formats, add *.scar; to it like this:
http://img12.imageshack.us/img12/4553/sourcefiles.jpg (http://img12.imageshack.us/i/sourcefiles.jpg/)
Then click Options\Open lua.properties.
On line 3 there is a list of lua file formats, so add *.scar; to that also like this:
http://img687.imageshack.us/img687/8629/luafilepatterns.jpg (http://img687.imageshack.us/i/luafilepatterns.jpg/)
Go to the bottom of the file, and under the line
command.go.subsystem.*.lexe=1
add this:
command.build.*.scar=luac -p "$(FileNameExt)"
like this:
http://img547.imageshack.us/img547/9010/parse.jpg (http://img547.imageshack.us/i/parse.jpg/)
Now, open any scar file with SciTE Lua.exe (you might set it as the default scar editor), and there will be syntax highlighting. When you want to check syntax, just click Tools\Build, or F7, and the program will check the syntax, and any errors will be shown down the bottom. Double click on them to go to the line and fix it. Finally to open the code completion window, press ctrl+enter while you're typing.
The end result will look like this:
http://img69.imageshack.us/img69/3117/example3d.jpg (http://img69.imageshack.us/i/example3d.jpg/)
http://img573.imageshack.us/img573/8151/example2d.jpg (http://img573.imageshack.us/i/example2d.jpg/)
http://img442.imageshack.us/img442/8338/example1o.jpg (http://img442.imageshack.us/i/example1o.jpg/)
Akaiyou
4th Dec 10, 6:40 PM
yeah dat didnt work and i installed it are there 2 different versions i installed the one that u had a link to
i add all that stuff in perfectly make it look identical to how u do it in the pictures and then i go to 'file - new - open' and try to open a scar file it opens but the F7 buttong doenst work and i click at the top options > build and it doenst work either it's greyed out
Miguel
4th Dec 10, 9:55 PM
That means you didn't save after step 7. Make sure when you open it this time the changes are still there.
Akaiyou
4th Dec 10, 11:27 PM
I"m going to uninstall the whole thing and re-install
This program doesnt require Net4 by any chance does it?
----------
http://img.photobucket.com/albums/v630/0RaktaK0/dontsave1.jpg
http://img.photobucket.com/albums/v630/0RaktaK0/dontsave2.jpg
http://img.photobucket.com/albums/v630/0RaktaK0/dontsave3.jpg
http://img.photobucket.com/albums/v630/0RaktaK0/dontsave4.jpg
Doesn't work, full installation and all it refuses to let me save anything.
Miguel
5th Dec 10, 12:20 AM
That's probably because it doesn't have correct permissions or something. Make sure you do (make sure you're an admin, then try to run Scite with admin permissions), and then try and save as into C:\Program Files (x86)\Lua\5.1\SciTE and override the current file.
Akaiyou
5th Dec 10, 3:55 AM
im the only user of this computer no other admin.
Vista/Win7 don't allow default write permissions to Program Files (Program Files (x86) in 64-bit Windows). You'll have to set the security permissions on the folder yourself. Right click on your "Lua/5.1/SciTE" folder and scroll down to Properties. Click on the Security tab and give either your account or all Administrators Full Control.
Akaiyou
5th Dec 10, 5:36 AM
oh really? dats so gey is there something like that also with Net 4 on Vista? becuase my net4 seems to refuse to work even tho it installs successfully
As long as you run the .NET installer as an administrator and restart your computer, you should be fine. I've never had a problem updating my .NET (or installing a new version).
Akaiyou
5th Dec 10, 6:27 PM
Thanks to you mentioning that I googled admin problems with Vista and it seems that there's some crap called UAC on it that makes a hidden admin and even if ur 'admin' ur really not THE admin of your computer until you disable that crap. So i will try to install all those programs again and see what happens.
Akaiyou
6th Dec 10, 4:51 AM
Update: Yup after turning off UAC mode this works and im now able to save.
I still can't get Cope's Toolbox to work tho and I need serious help creating wargear that's able to summon minions...anyone?
Akaiyou
7th Dec 10, 5:38 AM
Hey miguel so i'm running the program and the syntax checker and im not sure i understand what the error messages mean, i'm getting the following error report:
>luac -p "units.scar"
luac: units.scar:2347: '}' expected (to close '{' at line 426) near 'Survive'
>Exit code: 1
>luac -p "units.scar"
luac: units.scar:2347: '}' expected (to close '{' at line 6) near 'Survive'
>Exit code: 1
That's what i get when i press F7. What exactly does it mean?
You're not closing statements correctly. "{" opens a statment (usually a function), and "}" closes it.
Akaiyou
7th Dec 10, 7:20 AM
Yeah but it says on line 6 which doesn't make sense unit 6 is open because that's where you begin the list of all units in Last Stand.
It's giving me that 'error' for the 'units.scar' check it out. If you close line 6 you end up with no units in the game!
Miguel
7th Dec 10, 10:54 PM
Answered here (http://forums.relicnews.com/showthread.php?255617-Please-Help-I-Keep-Crashing!-Pretty-Please&p=1045173202&viewfull=1#post1045173202)
Akaiyou
8th Dec 10, 3:06 PM
Problem still persists can we get a tutorial as well on how to actually use this syntax checker? Seems a bit useless to me because it seems to believe that whatever scar i load onto it has an error at the very beginning of it becuase it leaves an open bracket before getting to the actual coding. And it only seems to display the first found error.
Like in my example I get the "FATAL ERROR" screen about the units.scar being messed up and i didn't understand the error report at all. And i even fixed the line 135 that you pointed out to me but still i get the same error so what gives?? I've had that error for days now.
Also u said when it displays an error in the coding to double click to be taken to it, i do it at the bottom i double click, triple click, etc n nothing happens.
Miguel
8th Dec 10, 10:36 PM
Edit: Just realised this isn't the problem. See here (http://forums.relicnews.com/showthread.php?255617-Please-Help-I-Keep-Crashing!-Pretty-Please&p=1045173568&viewfull=1#post1045173568) for my response.
Akaiyou
22nd Dec 10, 8:47 AM
mmmm i re-installed windows to fix cope's toolbox (finally got it working) and now for some reason this lua editor won't work like it used to. I did all the steps 2x and even disabled UAC
It lets me 'save' but wont let me use the build F7 function wat gives?
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.