Aller au contenu

Photo

main or StartingConditional required?


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
I have a few scripts that I'm using as includes. Just like utility_h or wrappers_h, all that they contain are functions that are designed to be called from other scripts.

Yet every time I compile them, I get a nasty error saying "Script must contain either a main or StartingConditional" and a "Compile failed" message.  However, utility_h, wrappers_h or any number of similar scripts written by BioWare have no main or StartingConditional.  Why can't we do this as well?

Is there any fix for this problem, or is the script actually compiling and the error is wrong?

#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
That is not an issue at all. You can ignore the warning and go ahead.


#3
Mengtzu

Mengtzu
  • Members
  • 258 messages
IIRC compiling the including script will compile any includes as well (at which point you won't see the main or starting conditional error, since your including script will have one). So as Timelord says it's no problem.

#4
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
Guess I'll just happily ignore those errors then, as disconcerting as that is. It just seems wrong that every export pulls up errors due to things that don't export (e.g. characters or area lists) scripts that "don't compile" or other issues.

Modifié par AmstradHero, 08 mai 2010 - 07:13 .


#5
Mengtzu

Mengtzu
  • Members
  • 258 messages
In general that is a challenge for us, but in this specific case includes aren't really supposed to be standalone compiled scripts, they're supposed to be compiled as part of their including script.



Since the compiler has no way of knowing it's dealing with a script fragment intended to be included, this is probably the correct behaviour.

#6
RecklezzRogue

RecklezzRogue
  • Members
  • 193 messages

AmstradHero wrote...

Guess I'll just happily ignore those errors then, as disconcerting as that is. It just seems wrong that every export pulls up errors due to things that don't export (e.g. characters or area lists) scripts that "don't compile" or other issues.


You should only get that error when saving (which compiles the script automitically) - not if you are doing an export...(right guys?) If things are not exporting, that's something else...

#7
TimelordDC

TimelordDC
  • Members
  • 923 messages
Yes, the error should occur only while compiling, not while exporting.



If you want to suppress these messages, you can set the Auto Compile on Save option in the Script Editor Options to False. That would mean you have to manually compile all your scripts though.

#8
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
Quite right. I was getting my errors mixed up in the small log window. It seems the best way to work is to have a dummy main function in while creating the include script to pick up any compile errors/typos you might have, then remove it before compiling the scripts that reference it.



That said, I have found that characters and area lists don't export, and always report "Unable to locate an exporter or resource information for object type:chr" (that's characters).


#9
TimelordDC

TimelordDC
  • Members
  • 923 messages
Characters don't serve any purpose within the game - Character. They are there only for giving some definition to the different creatures, primarily for voice-over and coordination; perhaps they didn't include the exporter for the character with the toolset released to us?