Home   Help Search Login Register  

Author Topic: After making pbo, functions not found  (Read 1050 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
After making pbo, functions not found
« 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......
urp!

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:After making pbo, functions not found
« Reply #1 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... ;)

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re:After making pbo, functions not found
« Reply #2 on: 08 Jun 2005, 22:04:25 »
example line from init.sqs

Code: [Select]
SortBubble = preprocessFile "function/sortbubble.sqf"
urp!

Offline Blanco

  • Former Staff
  • ****
Re:After making pbo, functions not found
« Reply #3 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"
Search or search or search before you ask.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re:After making pbo, functions not found
« Reply #4 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?

« Last Edit: 08 Jun 2005, 22:17:09 by Mr.Peanut »
urp!

Offline Blanco

  • Former Staff
  • ****
Re:After making pbo, functions not found
« Reply #5 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.
Search or search or search before you ask.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re:After making pbo, functions not found
« Reply #6 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.
urp!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:After making pbo, functions not found
« Reply #7 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...
« Last Edit: 09 Jun 2005, 14:17:00 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.