weird error

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

weird error

Post by enric »

I'm getting the following error when loading a scenario with the editor.
I reduced the .BSF file to nothing:

// called at the start of every turn.
// You would tend to use this for events
FUNCTION StartTurn(side)
{
if( GetTurn() == 0 )
{
// ShowUIScreen( “BattlePop0”, “Anim1”, “IDS_PONTOON”, “BP0Image:US_infantry_head”) ;
}
}


THE ERROR
nest ==0 && "Missing closing } on block"
/Users/philipveale/Dev/BBC/Util/C_Script.cpp(673) : Failed
ERROR

There is not any user named philipveale in my computer, are you Phip Veale?
If I remove the .BSF file the .BAM load normally.
pipfromslitherine
Site Admin
Site Admin
Posts: 9937
Joined: Wed Mar 23, 2005 10:35 pm

Re: weird error

Post by pipfromslitherine »

It's just where the source file was living on the machine when it was compiled. Nothing to worry about - I'm not haunting your machine :).

I'm not sure what the issue is with the code, it looks OK to me. What happens if you delete all the function body and just leave it empty? Are you including anything at the top of the file?

Cheers

Pip
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: weird error

Post by enric »

Try by yourself
AAE_MP_POOL_copy.zip
(26.58 KiB) Downloaded 90 times
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: weird error

Post by enric »

The issue seems to be in the line

// ShowUIScreen( “BattlePop0”, “Anim1”, “IDS_PONTOON”, “BP0Image:US_infantry_head”) ;

even if commented "//" crashes BA.
Removing that line works ok.
pipfromslitherine
Site Admin
Site Admin
Posts: 9937
Joined: Wed Mar 23, 2005 10:35 pm

Re: weird error

Post by pipfromslitherine »

It might be an issue with the Mac-style line endings in the text file? It might be failing to find the end of the line in the comment code, and thus running over and grabbing the following }

Does it work if you add another newline between the commented line and the closing }

Cheers

Pip
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: weird error

Post by enric »

FOUND!!!!

It's a problem with the quotations, BA don't like the double quotation like “BattlePop0”, there is a name for this kind of quotation I don't remember now.
The problem came because I copied from your post the function call, and paste in my Editor.

I think BA should not crash for a sign/char inside a comment line.

// “Hello”
This line crashes BA with this very estrange alert about you :) (/Users/philipveale/Dev/BBC/Util/C_Script.cpp(673) : Failed)

This not:
// "Hello"
pipfromslitherine
Site Admin
Site Admin
Posts: 9937
Joined: Wed Mar 23, 2005 10:35 pm

Re: weird error

Post by pipfromslitherine »

So it copied in some bad speech marks? Wierd. I will need to check it out - at least it's a simple workaround.

Cheers

Pip
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: weird error

Post by enric »

Yes, if a line contains a "educated quote" BA crashes, even if it's a comment line, that should be ignored by the compiler/interpreter.
Post Reply

Return to “Battle Academy : Modders Corner ”