Skip to content

A script with no void main and no startingconditional

I've been trying to create a script file with nothing but useful functions that I'll be using as an "include". However, the editor can't seem to understand that and will not compile it, and then it ends up having no effect in game. I'll literally invert an operator in a talent check but nothing changes when I test it. Why is that? Am I just being stupid? Is there a workaround?

Comments

  • TarotRedhandTarotRedhand Member Posts: 1,481
    Simply put a blank void main() at the end of your script file like this
    void main()
    {
        // nothing to see here
    }
    

    Once you've compiled your functions you can always block remark it like this
    /*
    void main()
    {
        // nothing to see here
    }
    */
    

    That way if you edit any of your code you only have to delete the remark start and end to recompile.

    TR
  • KamirynKamiryn Member Posts: 74
    You can't compile an include file. You always have to compile the scripts that include your include file if you want changes in the include file have effect in game.

    To test whether there are errors in your include file you can temporarily add a blank void main() add the end of your include file so the editor can compile the script but that's only for testing purpose. Before you compile the module you have to remove the void main() again.
  • gpeddinogpeddino Member Posts: 50
    Thanks to you both for the comments but the thing is, I was altering things in my include file (and adding the void main to compile it) but they were having no effect in the game. Saving and closing the toolset was not working.I actually had to restart my computer for them to work. That what I was strange to me.
  • TarotRedhandTarotRedhand Member Posts: 1,481
    edited April 2021
    @gpeddino On the toolset main screen did you try Build/Build Module/Compile/Scripts? Doing that ensures that anything that references your library is actually linked to the current version and not previous ones.

    TR
  • meaglynmeaglyn Member Posts: 149
    There is no linking. You need to recompile all the scripts that use your include file when you change it. But yes, build module/compile scripts.
  • gpeddinogpeddino Member Posts: 50
    meaglyn wrote: »
    There is no linking. You need to recompile all the scripts that use your include file when you change it. But yes, build module/compile scripts.

    I think that's what I was doing wrong. There was another script with the include that was not compiling properly. Thanks for that info.
Sign In or Register to comment.