Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Custom 2da script not compiling?

Page: 1 of 1
 Ferc Kast
01-18-2008, 8:18 PM
#1
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, 7:17 AM
#2
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, 8:34 AM
#3
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)
Page: 1 of 1