Page 2 of 47 FirstFirst 12345612 ... LastLast
Results 11 to 20 of 467

  Click here to go to the first Developer post in this thread.  

Thread: Squint - the sqf editor and error-checker

  1. #11
    Quote Originally Posted by sbsmac View Post
    Parameters- can you provide a short code-example and I'll see what I can do.
    Again I understand dynamic variable assignment is tough and it is totally fine if you decide my parameter case does not warrant an exception. Here is part of an description.ext:
    Code:
    class P_Hour
        {
            title = "Hour of day";
            values[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23};
            texts[] = {"00:XX", "01:XX", "02:XX", "03:XX", "04:XX", "05:XX", "06:XX", "07:XX", "08:XX", "09:XX", "10:XX", "11:XX", "12:XX", "13:XX","14:XX", "15:XX", "16:XX", "17:XX", "18:XX", "19:XX", "20:XX", "21:XX", "22:XX", "23:XX"};
            default = 12;
        };
    The following script turns the class into a variable. If run in the editor then P_Hour = 12;. Cause 12 is default. In mp or somewhere where you can specify parameters it get's set to that value. The benefit of this approach I think is that it does not require you to maintain order in the params and you don't do manual indexing into paramsArray. This is the script that does the work:
    Code:
    if (isNil "paramsArray") then {
    	if (isClass (missionConfigFile/"Params")) then {
    		for "_i" from 0 to (count (missionConfigFile/"Params") - 1) do {
    			_paramName = configName ((missionConfigFile >> "Params") select _i);
                _paramValue = getNumber (missionConfigFile >> "Params" >> _paramName >> "default");
                call compile format ["%1 = %2", _paramName, _paramValue];
    		};
    	};
    } else {
    	for "_i" from 0 to (count paramsArray - 1) do {
            _paramName = configName ((missionConfigFile >> "Params") select _i);
            _paramValue = paramsArray select _i;
            call compile format ["%1 = %2", _paramName, _paramValue];
    	};
    };
    Again this might be a special case, however you need some way to tell squint that this variable, even if not recognized, is okay. "I got this one squint".

    UTF8... yes the bane of my life. The richtextbox control used in squint doesn't understand UTF-8 and even if it did, handling multi-byte characters through the data-path would be a serious headache for me atm. *Most* non-ascii's should be handled correctly now but I'm prepared to believe there may be a few that escape under certain circumstances. Again, if you can provide a specific example I can take a look.
    I'm surprised that .Net does not support UTF all the way. A specific example is this:
    In N++:
    Code:
    /*
    Søren Enevoldsen - Muzzleflash - Deadecho
    */
    In Squint
    Code:
    /*
    Søren Enevoldsen - Muzzleflash - Deadecho
    */
    I noticed that my file somehow got saved with BOM. I changed it back and reloaded in squint it did not make a difference to it's interpretation.
    EDIT: The good part is at least is saves the character(s) the same way it loads them. Saving in Squint (with the expanded byte representation) produces the correct result, which I verified by loading in N++ after.

    -------------------------
    Quote Originally Posted by JDog View Post
    ^LOL

    Nice I'll be downloading ASAP.
    Yeah had a laugh myself when I wrote that

    ---------- Post added at 01:04 ---------- Previous post was at 00:49 ----------

    Using the preprocessed view seems to FUBAR the syntax highlighting (Notice the T too):

    Last edited by Muzzleflash; Aug 19 2010 at 23:09.

  2. #12
    I approve of your choice of name.

  3. #13
    Quote Originally Posted by sbsmac View Post
    I'm also particularly keen to get your suggestions on the kinds of errors you find in your code which squint does not yet catch.
    Yay! I finally managed to come up with one. (just reported)


    But that default background color for the editor window.. sure, fortunately one may change it, but still....
    ...are you friggin serious?!

    Black!?


  4. #14
    One of the web guys I work with swears by a black background for coding. I have no idea why!

  5. #15
    Quote Originally Posted by ruebe View Post
    Yay! I finally managed to come up with one. (just reported)


    But that default background color for the editor window.. sure, fortunately one may change it, but still....
    ...are you friggin serious?!

    Black!?

    Well, if you're using it for extended periods of time, black is easier on the eyes than white, and it also makes the highlighting more... highlighted.

  6. #16
    flippin awesome tool. fixed a bunch of errors right on loading. Thanks for a great tool.

    an this work for HPP files?
    Last edited by gunterlund21; Aug 20 2010 at 02:48.
    My System
    Motherboard - Asus Striker II Extreme 790i
    CPU - Intel E8500 Duo 3.16GHz overclocked to 3.8
    Memory - OCZ Gold DDR3 SDRAM 1600 2Gig
    Drive - Western Digital Caviar RE2 500Gig Sata
    Drive - Kingston 128Gig SSD
    Video -BFG 285GTX
    Drivers - Nvidia 195.
    Artic Cooling Freezer 7 Pro CPU Fan
    Power - Antec TPQ-850 850 Watt
    Microsoft Windows 7 64-Bit

  7. #17
    First Sergeant cobra4v320's Avatar
    Join Date
    Mar 10 2009
    Location
    Seattle Washington
    Posts
    841
    Awesome tool thanks for sharing, already found some errors in a couple of scripts that I didnt even notice.

  8. #18
    Quote Originally Posted by kylania View Post
    One of the web guys I work with swears by a black background for coding. I have no idea why!
    Maybe that way it feels more like Neo hacking the matrix or something in this direction

    Quote Originally Posted by Laertes View Post
    Well, if you're using it for extended periods of time, black is easier on the eyes than white...
    Black? As a background color? Easier on the eyes? To read (white and even colored!!!) text?
    ...

    Are you shitting me?

  9. #19
    I don't use black, but very dark colored background. Less blinding than white background. When you play a lot of "dark missions", it matters a lot. I even have means to put a red/black marker over the map to make it less blinding.

    You should see my UltraEdit colors
    Regards
    Carl Gustaffa - left this game due becoming Steam Exclusive

  10. #20
    cool tool. from a cpp point of view I would love to see a class explorer which would allow quick navigation in huge configs.

Page 2 of 47 FirstFirst 12345612 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •