Jump to content
Sign in to follow this  
Hatchet_Harry

Consideration about preprocessing in Arma 3

Recommended Posts

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 by Hatchet_Harry

Share this post


Link to post
Share on other sites

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×