Including a .c in my .wdl project

Posted By: thegamedesigner

Including a .c in my .wdl project - 09/16/10 18:48

Hey all, I have a7 pro, and I have a project written in wdl.

I read in the manual: "You can even include a .c script in a .wdl script, and call lite-C functions from C-Script."

I want to do that, but I don't know how. I tried this:

in main.wdl:
include "litec.c";

in litec.c:
function litec_func()
{
beep();
}


Yet when I call litec_func, it says error nonexistant function.

How do I mix lite-c and wdl?

Thanks,
Posted By: Ganderoleg

Re: Including a .c in my .wdl project - 09/16/10 21:17

I used .c in my .wdl projects mostly for post-processing effects & there is a way to communicate between them by using engine vars.

The bad thing is that you must have a startup function in your .c because you can't initiate anything from .wdl, it has to be self-initiated. Another bad thing is that you can kiss standard save/load system goodbye grin since game_load in .wdl will not be able to re-initiate anything from .c.

Surprisingly & thankfully level_load works fine & it doesn't brake .c functionality so all you need is save-vars-to-txt based system smile

Check out my replies here, everything is explained down this page:

http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=301046#Post301046
Posted By: thegamedesigner

Re: Including a .c in my .wdl project - 09/16/10 21:33

Great. THanks, I'll check all this out.
© 2024 lite-C Forums