PDA

View Full Version : Custom 2da script not compiling?


Ferc Kast
01-18-2008, 08:18 PM
I just read this (http://www.lucasforums.com/showthread.php?t=148587) thread a few days ago; When I tried to compile the following script to access my new workbench in game, it didn't compile it:

void main() {

ShowUpgradeScreen(object oItem = OBJECT_INVALID, object oCharacter = OBJECT_INVALID, int nDisableItemCreation = FALSE, int nDisableUpgrade = FALSE, string sOverride2DA = "newitemcreate");

}

Where did I go wrong? Also, I was wondering if this would work in K1 too or only TSL.

Thanks in advance.

Kristy Kistic
01-19-2008, 07:17 AM
Your trying to compile a function declaration, not an actual call to the function. You need to define the variables and fill them in the actual function. Note that the variable names do not have to match what they're called in the declaration.

void main() {

object oItem = OBJECT_INVALID;
object oCharacter = OBJECT_INVALID;
int nDisableUpgrade = FALSE;
int nDisableItemCreation = FALSE;
string sOverride2DA = "newitemcreate";

ShowUpgradeScreen(oItem, oCharacter, nDisableItemCreation, nDisableUpgrade, sOverride2DA);

}

I'm not absolutely certain about this, but since the function declaration defines default values you might be able to get away with this:


ShowUpgradeScreen(,,,,sOverride2DA);

Ferc Kast
01-19-2008, 08:34 AM
Thanks; It compiled perfectly with the first script that you suggested. I will be sure to credit you in the read me when I'm done with the main mod that I'm making.

Hopefully, it'll save some space when I compress it for release. (At least, when compared to the big .utm file that I made.)

EDIT: I just tried running the script in game; However, it doesn't work. http://64.20.36.214/lucasforums.com/images/smilies/confused.gif