OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Mr.Peanut on 08 Jun 2005, 21:57:02

Title: After making pbo, functions not found
Post 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......
Title: Re:After making pbo, functions not found
Post by: bedges on 08 Jun 2005, 21:59:24
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... ;)
Title: Re:After making pbo, functions not found
Post by: Mr.Peanut on 08 Jun 2005, 22:04:25
example line from init.sqs

Code: [Select]
SortBubble = preprocessFile "function/sortbubble.sqf"
Title: Re:After making pbo, functions not found
Post by: Blanco on 08 Jun 2005, 22:04:59
I don't think you can call them via :

Code: [Select]
myfunction = preprocessfile "\myfolder\myfunction.sqf"
Use :

Code: [Select]
myfunction = loadFile "\myfolder\myfunction.sqf"
Title: Re:After making pbo, functions not found
Post by: Mr.Peanut on 08 Jun 2005, 22:06:58
O crap... seems subfolders do not work for functions after mission has been pbo'd, even though scripts are fine. Can anyone confirm this?

Title: Re:After making pbo, functions not found
Post by: Blanco on 08 Jun 2005, 22:12:41
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.
Title: Re:After making pbo, functions not found
Post by: Mr.Peanut on 09 Jun 2005, 12:50:35
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.
Title: Re:After making pbo, functions not found
Post by: h- on 09 Jun 2005, 14:16:29
Try
Code: [Select]
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...