Aller au contenu

Photo

Another sys_chargen_h.nss not compiling problem.


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

#1
ravenlok

ravenlok
  • Members
  • 10 messages
Greetings,

So I'm working on a stock script to make a jail door go interactable after a plot flag is set. I'm using the same script from the Silent Cid video tut v2, part 4. Starting last night, I get the following error when I go to save: 

E: 05:01:20 - sys_chargen_h.nss - sys_chargen_h.nss(72): No right bracket on expression (while compiling bih_cldgncell_pc.nss)

Strange thing #1 is, I'd never touched sys_chargen_h before that error popped up. 

Strange thing #2 is, when I did go look at sys_chargen_h, there is no missing bracket. They're all present and accounted for. 

Has anyone had a similar experience? What should I do? I suppose I could replace sys_chargen_h with a clean copy, but where can I find one?  

-r

Modifié par ravenlok, 08 juin 2010 - 10:25 .


#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
The problem seems to be with the bih_cldgncell_pc.nss. I assume this is the script you created.



Have you modified any core include scripts to include your script? That could explain why sys_chargen_h is throwing that error.

#3
Craig Graff

Craig Graff
  • Members
  • 608 messages
There is a phantom compiler bug that causes such things occasionally even when everything is right. Try compiling again before you do anything else.
You can find a clean copy in your resource history. (Right click on file, select Resource History, left click on file again - then, in the list that comes up, right-click entry 1 and select Restore Resource.
If it's still not compiling you may need to clear any copies of sys_chargen out of all override directories (and subfolders).

Also make sure that you aren't including standard resources in core resources.

Modifié par Craig Graff, 07 juin 2010 - 03:13 .


#4
ravenlok

ravenlok
  • Members
  • 10 messages
TLDC -- I only included one error as an example, but every script I try to compile throws this same error. Even scripts that compiled correctly before. I have not modified any core include scripts. I'm fairly new at this, so I try to keep things as simple as possible. I know better than to monkey around with things beyond my ken. (or barbie). Mostly, I steal and modify.



Craig -- A phantom compiler bug sounds fun. Good luck with that. I will compile a couple more times, restart the toolset, restart the computer, pray to the the gods of the wood for a good hunt, rain, etc, and if all that don't work...follow your instructions to replace sys_chargen_h.



Thanks much,

-r

#5
ravenlok

ravenlok
  • Members
  • 10 messages
Alas, I have not found favor among the gods of the wood. Still getting:


E: 04:22:43 - sys_chargen_h.nss - sys_chargen_h.nss(72): No right bracket on expression (while compiling bih_test.nss)

This is after replacing sys_chargen_h with a clean copy and scouring the override directories and subfolders.

I've not modified any of the core resources (that I know of), so that shouldn't be an issue.

More info:

I was incorrect when I said every script causes this error. I just compiled successfully some of my older scripts. In fact it's only the plot events scripts that do it. Here's the code:

//::///////////////////////////////////////////////
//:: Plot Events Template
//:: Copyright © 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
Plot events
*/
//:://////////////////////////////////////////////
//:: Created By: Yaron
//:: Created On: July 21st, 2006
//:://////////////////////////////////////////////

#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "plot_h"

#include "plt_escape_dgn_bih"

int StartingConditional()
{
event eParms = GetCurrentEvent(); // Contains all input parameters
int nType = GetEventType(eParms); // GET or SET call
string strPlot = GetEventString(eParms, 0); // Plot GUID
int nFlag = GetEventInteger(eParms, 1); // The bit flag # being affected
object oParty = GetEventCreator(eParms); // The owner of the plot table for this script
object oConversationOwner = GetEventObject(eParms, 0); // Owner on the conversation, if any
int nPlotType = GetEventInteger(eParms, 5);
int bIsTutorial = GetM2DAInt(TABLE_PLOT_TYPES, "IsTutorial", nPlotType);
int bIsCodex = GetM2DAInt(TABLE_PLOT_TYPES, "IsCodex", nPlotType);
int nResult = FALSE; // used to return value for DEFINED GET events
object oPC = GetHero();

plot_GlobalPlotHandler(eParms); // any global plot operations, including debug info


if(nType == EVENT_TYPE_SET_PLOT) // actions -> normal flags only
{
int nValue = GetEventInteger(eParms, 2); // On SET call, the value about to be written (on a normal

//SET that should be '1', and on a 'clear' it should be '0')
int nOldValue = GetEventInteger(eParms, 3); // On SET call, the current flag value (can be either 1 or

//0 regardless if it's a set or clear event)
// IMPORTANT: The flag value on a SET event is set only AFTER this script finishes running!

switch(nFlag)
{
case KEYS_BRUTE_FORCE: // This section is to make an non-interactive door active.
{
object oDoor = GetObjectByTag("door_cell_pc");
SetObjectInteractive(oDoor, TRUE);
}

case KEYS_PILFER: // This section is to make an non-interactive door active.
{
object oDoor = GetObjectByTag("door_cell_pc");
SetObjectInteractive(oDoor, TRUE);
}

case PICK_CELL_DOOR: // This section is to make an non-interactive door active.
{
object oDoor = GetObjectByTag("door_cell_pc");
SetObjectInteractive(oDoor, TRUE);
}
}
}
else // EVENT_TYPE_GET_PLOT -> defined conditions only
{

switch(nFlag)
{


}

}

plot_OutputDefinedFlag(eParms, nResult);
return nResult;
}


-r

Modifié par ravenlok, 08 juin 2010 - 11:40 .


#6
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
I'm not sure what's wrong, but what if you comment out the empty switch block at the bottom? Also, what you might try doing is comment out the #includes and the code that depends on them until it compiles (setting variables that rely on functions to dummy values) to maybe see if the problem is coming from a header or section of code.

Modifié par FollowTheGourd, 08 juin 2010 - 01:00 .


#7
Craig Graff

Craig Graff
  • Members
  • 608 messages
You are missing a closing brace before the else.

        case PICK_CELL_DOOR: // This section is to make an non-interactive door active.
        {
            object oDoor = GetObjectByTag("door_cell_pc");
            SetObjectInteractive(oDoor, TRUE);
        }
    } 
}
else
{

Modifié par Craig Graff, 08 juin 2010 - 03:42 .


#8
ravenlok

ravenlok
  • Members
  • 10 messages

Craig Graff wrote...

You are missing a closing brace before the else.

        case PICK_CELL_DOOR: // This section is to make an non-interactive door active.
        {
            object oDoor = GetObjectByTag("door_cell_pc");
            SetObjectInteractive(oDoor, TRUE);
        }
    } 
}
else
{


If only that were true, I would kiss your missing-brace-finding eyes. Alas, no. I've checked and double checked. There are 16 braces and every brace has a mate -- if only this were so in the real world. Then again people would probably play fewer video games, and that wouldn't be so good for Bioware. 


One more data point: as soon as I comment out the include for plot_h the error goes away (of course the script won't run properly without plot_h...). 

Modifié par ravenlok, 09 juin 2010 - 05:47 .


#9
Craig Graff

Craig Graff
  • Members
  • 608 messages
Hrm... I must have erased it when I copied, pasted and commented out the plot include and flags.

#10
ravenlok

ravenlok
  • Members
  • 10 messages
So I got to thinking may this error is due to some bug in the script I used from SilentCid, so I hunt around for the original, and I find it. It's under the templates button when one has a script open. It's called "Custom plot events.txt" I create a new blank script and put the "Custom plot events.txt" code into it and try to compile. I get the same error.



E: 23:26:22 - sys_chargen_h.nss - sys_chargen_h.nss(72): No right bracket on expression (while compiling bih_test.nss)



I'm betting there's nothing wrong with Bioware's template, so I'm not sure where to go from here. I've not changed any of the core scripts--and when I look, they all have matched brackets. So maybe this is the phantom compiler problem. I'm out of my depth though. Can I just replace the compiler? Maybe I should just reinstall the toolset without touching the DB. Suggestions?



-r

#11
Craig Graff

Craig Graff
  • Members
  • 608 messages
The compiler problem I referred to is actually rather rare and I've never seen it twice in a row.

#12
Phaenan

Phaenan
  • Members
  • 315 messages
Not sure if it can help or even if it's related to your issue, but well. This "no right bracket" doesn't always refer to a missing bracket ; sometimes it's thrown when the compiler encounters a function call and doesn't get that the function is actually known / defined. For instance I have a library always giving me that message when included in an exported script because the compiler apparently fails to grab the dependencies properly. (despites the script working / compiling fine anyway)

So basically, the compiler can get confused from time to time and your problem may not be bracket related. :o

Modifié par Phaenan, 09 juin 2010 - 08:37 .


#13
ravenlok

ravenlok
  • Members
  • 10 messages
Problem resolved, but nothing learned. Brute force solution, alas.

First, I uninstalled, then restarted, then reinstalled the toolset. No luck.

Second, I backed up the DB, then did a BtoB Create of all my stuff, next I restored the DB from the backup DB, next recreated my module and did a BtoB Load for my stuff. Blammo! Everything worked and the script compiled.

My experience working with the toolset so far has been pretty consistent: A couple nights of productive work and then a week of bull****. Repeat.


-r

Modifié par ravenlok, 23 juin 2010 - 09:10 .