1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Which preprocessors does angelscript support?

Discussion in 'Modding Help' started by Kasper123, Oct 1, 2017.

  1. Kasper123

    Kasper123 Base Burner

    Messages:
    22
    C++ has those following preprocessors: #define, #undef, #include, #if, #ifdef, #ifndef, #else, #elif and #endif.

    It seems that angelscript lacks the #undef and #else preprocessors, do they exist in some other form?
    Does anyone know about some documents about angelscript preprocessors on the internet?
     
  2. Vermilicious

    Vermilicious Ballista Bolt Thrower

    Messages:
    232
  3. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
    I looked it up in the engine: #if, #ifdef, #ifndef, #ifndef, #endif, #define and #include should be working.
    This means using #endif then #ifndef should suffice in your case.
    #BRK might work - it should allow to set breakpoints within the script when the debugger is active - i.e. when g_debug is set to at least 1. A breakpoint stops the execution of a program to examine (debug) the state of the program when it is reached with the debugger.

    The engine looks up for a few script defines: SERVER_ONLY, CLIENT_ONLY, ALWAYS_ONRELOAD.
    When SERVER_ONLY is set, the server will not send that script to clients (to verify). At least, i'm pretty sure that when either of those is set hooks won't be called on the wrong side.
    I'm not sure what the last one does, but it might not be often useful.
     
  4. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    ...I'd also seriously suggest avoiding relying on the preprocessor very much if you can help it.