Need a fresh pair of eyes to look at a script

Discussion in 'Fallout General Modding' started by burn, Jun 26, 2019.

  1. burn

    burn Mildly Dipped
    Modder

    506
    Apr 22, 2012
    Can't compile DCATKSLV.SSL from UP:
    Code:
    [Error] <DCATKSLV.SSL>:152:46: Expected 'then'.
    Can't see what's the problem. Tried older sslc versions, no effect. Anyone wants to give it a shot?
     
    Last edited: Jun 26, 2019
  2. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    If I cut the give_slave_weapon to:
    Code:
    #define give_slave_weapon(the_slave)                                                  \
                if (self_elevation != 2) then begin                                       \
                   if (random(0,1)) then begin                                            \
                      arm_obj(the_slave, PID_SPEAR, 1, 0, 0)                              \
                   end else begin                                                         \
                      arm_obj(the_slave, PID_KNIFE, 1, 0, 0)                              \
                   end                                                                    \
                end else begin                                                            \
                   temp := random(1, 4);                                                  \
                end
    
    the script will compile just fine. It seems there can be only two arm_obj calling in give_slave_weapon, one more it will fail with the same error.

    EDIT: looks like the built-in mcpp preprocessor can't handle heavily nested if-else. I use Watcom C as the preprocessor and the script compiles normally.
     
    Last edited: Jun 26, 2019
  3. burn

    burn Mildly Dipped
    Modder

    506
    Apr 22, 2012
    Damn... thanks.
    Anyway, how is it supposed to be used from command line? I don't see any such option in compile.exe.
    Or should it be preprocessed into a temp file, and then that file compiled with compile.exe?
     
  4. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    Yes, it needs to be preprocessed into a temp file, just like in original P.BAT included in BIS mapper installation.
     
  5. burn

    burn Mildly Dipped
    Modder

    506
    Apr 22, 2012
    I see, thank you.
     
  6. burn

    burn Mildly Dipped
    Modder

    506
    Apr 22, 2012
    What are the exact options for wcc used in SFSE? I've looked in the sources, but can't find the %param% passed.
    Compile.exe dies with "line too long", I tried passing -pw=100, but then it wraps with breaking words, and sslc doesn't want to eat that.

    Edit: nevermind, I'm stupid. Didn't disable built-in preprocessor.
     
    Last edited: Jun 26, 2019