Hatchet_Harry 1 Posted August 1, 2013 (edited) Hello, atm i am thinking about preprocessing files. I am planning to create a mod and generating the ruleset for mission designers and scripters. I just dont want to run against walls. The highest priority topic is: Performance To get the best possible performance i am thinking about preprocessing funtions and save them into variables. ATM i am struggling with 3 things 1) Limitiations of preprocessed functions 2) Difference between preprocessFileLineNumbers and preprocessFile 3) Include external files 1) I read a lot of topics about preprocessing and some descriptions. No descriptions or topics gave me a clear answer to the question: In which cases should i not preprocess scripts. ATM i am at the point: I preprocess nearly every file. I preprocess functions and store them to variables, to prevent the compiler to compile them more than one time. I am not shure if i will run in trouble with this idea. When should i use execVM and compile it in realtime? 2) There is no clear decription about differences. I think Bohemia had an idea, when they generated this 2 commands, but i dont got it. Could you please help me? When should i use preprocessFileLineNumbers and when preprocessFile? 3) I want to include external files. These file are just serverside. I dont want to make them public. There are some mod settings and some settings for a the stores in the mod (which items are in the store and which not, prices and so on). In fact: I dont want to publish which items are aviable in the mod, because it would make the BE Filters more efficient. I dont want to have a serverside config file directly in my pbo. Is that possible? http://community.bistudio.com/wiki/PreProcessor_Commands says: YES it is! Has anybody experience with this kind of includes? Are there problems in MP? Thank you very much for the answers :-) Harry ---------- Post added at 19:23 ---------- Previous post was at 17:59 ---------- no ideas? Edited August 1, 2013 by Hatchet_Harry Share this post Link to post Share on other sites
kylania 567 Posted August 1, 2013 This page has some info about that and better performance. Share this post Link to post Share on other sites
cuel 25 Posted August 1, 2013 1) No not really. It's good to preprocess most stuff on mission load, as that's where the script engine runs really fast. execVM is the same thing as writing [] spawn {_this call compile preProcessFileLineNumbers "myscript.sqf"}; ... So the difference is that it spawns a new thread and runs the script instantly where as only using compile ppfln can be used later on as a call or spawn. And if used with call it will not spawn a new thread, waiting for the script to finish running. preProcessFile doesn't spit any errors from my experience and I've barely seen people use it so go with ppfln, there's also "loadFile" but I can't comment on that. 3) I'd say go with profileNameSpace commands on the server and PV the values. Share this post Link to post Share on other sites
Hatchet_Harry 1 Posted August 5, 2013 Thank you for the answers. The profielNamespace is a really good idea to keep the items private. I will try it =) Share this post Link to post Share on other sites