OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Mr.Peanut on 08 Jun 2005, 21:57:02
-
Just tried to pbo my first mission and run it. I kept all functions in a separate folder. Everything worked fine in design mode but now that I've pbo'd, it tells me it can't find the functions... help......
-
what path did you use in the 'preprocess' command? is it the entire mission path or just the folder path?
probably nothing to do with that, but it's a reasonable guess... ;)
-
example line from init.sqs
SortBubble = preprocessFile "function/sortbubble.sqf"
-
I don't think you can call them via :
myfunction = preprocessfile "\myfolder\myfunction.sqf"
Use :
myfunction = loadFile "\myfolder\myfunction.sqf"
-
O crap... seems subfolders do not work for functions after mission has been pbo'd, even though scripts are fine. Can anyone confirm this?
-
ow, ok, I thought you were talking about an addon pbo. You are talking about a mission pbo.
You can use subfolders but don't rename the mission when you export it as SP/MP mission.
-
Okay,
Seems that PreProcessFile does not like subfolders, but LoadFile does.
Funny this is not mentioned in the sqf tutorial. Anybody else care to elaborate on the differences? I will post as a comment to the tutorial.
-
Try
the_func = preprocessFile "..\function\sortbubble.sqf"
That should work in AddOns, so why not in missions...
preprocessFile seems to have some hostility againts subfolders...
loadFile does not support any kind of comments (/**/, //, comment {}..) so it will give error messages if the function uses some...
If this works btw, I'm not to 'blame' ::)
I was told about this 'trick' a while ago...