Author Topic: BUG?: asc/ash error  (Read 1402 times)

CaptainBinky

  • My dog's got no nose.
    • CaptainBinky worked on one or more games that won an AGS Award!
    •  
    • CaptainBinky worked on one or more games that was nominated for an AGS Award!
BUG?: asc/ash error
« on: 01 Feb 2009, 00:27 »
Hiya,

I was mucking about in AGS v3.1.1 and when adding a new script I accidentally typed the .asc extension. Things went a bit wrong at that point, and the upshot is I now have a script with a name whoops.asc.ash with no associated .asc file.

When I try to delete the rogue .asc.ash file from the editor I get an exception error:

Quote
Error: Value cannot be null.
Parameter name: key
Version: AGS 3.1.1.67

System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.ThrowHelper.ThrowArgumentNullExc eption(ExceptionArgument argument)
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at AGS.Editor.Components.ScriptsComponent. CommandClick(String controlID)
   at AGS.Editor.GUIController._mainForm_OnMe nuClick(String menuItemID)

etc.

Bizarrely as a side effect, I now have a second GlobalScript.asc in the list, and the keyboard movement script has now broken, claiming undefined tokens even though they are still defined:

Quote
GlobalScript.asc(111): Error (line 111): Undefined token 'KeyboardMovement'

Other than that, the second copy of the GlobalScript doesn't seem to effect things as double-clicking either of them brings up the same script, and the functions all seem to work still.

Is there any way of cleaning up this list and getting rid of the rogue files?

Cheers,

CB
« Last Edit: 01 Feb 2009, 00:28 by CaptainBinky »

A Lemmy & Binky Production

CaptainBinky

  • My dog's got no nose.
    • CaptainBinky worked on one or more games that won an AGS Award!
    •  
    • CaptainBinky worked on one or more games that was nominated for an AGS Award!
Re: BUG?: asc/ash error
« Reply #1 on: 01 Feb 2009, 00:37 »
Ah okay, so I didn't realise the main project file was XML.

I've edited this file and removed the rogue files and it's all working again now. Still, I guess the bug is still valid.

A Lemmy & Binky Production

Pumaman

  • Creator of AGS
  • Administrator
  • Mittens King
  • I sense danger.
    • Lifetime Achievement Award Winner
    • Pumaman worked on one or more games that won an AGS Award!
    •  
    • Pumaman worked on one or more games that was nominated for an AGS Award!
Re: BUG?: asc/ash error
« Reply #2 on: 01 Feb 2009, 00:38 »
Can you remember the exact sequence of things you did that caused the problem?

I tried adding a new script, typing in "testscript.asc" as the name, and yes the editor then called it "testscript.asc.asc". But I then renamed this and removed the ".asc" from the name, and it all seemed fine. At what point did things go wrong?

What has happened with the names of the new script? Are you saying that the .ASC file is now called "GlobalScript" but the .ASH file is called something else?

CaptainBinky

  • My dog's got no nose.
    • CaptainBinky worked on one or more games that won an AGS Award!
    •  
    • CaptainBinky worked on one or more games that was nominated for an AGS Award!
Re: BUG?: asc/ash error
« Reply #3 on: 01 Feb 2009, 01:02 »
Can you remember the exact sequence of things you did that caused the problem?

Not precisely, I'm afraid - I kind of panicked. I called the new script myScripts.asc then when I saw what happened, I renamed it to "whoops" and I think I omitted the extention, then I think I tried renaming it with the extension back on. I renamed it quite a few times, I can remember that, but precisely what and in what order I'm afraid I don't know.

What has happened with the names of the new script? Are you saying that the .ASC file is now called "GlobalScript" but the .ASH file is called something else?

I ended up with 2 copies of GlobalScript.asc both of which worked, with one GlobalScript.ash which also worked fine.

Like I said above, this whole cock up is easily fixed since the offending <script>...</script> bits can be zapped out of the game.agf file in notepad which was incredibly handy :)

This is what I ended up with in the file:
Quote
<Script>
        <FileName>whoops.asc.ash</FileName>
        <Name />
        <Description />
        <Author />
        <Version />
        <Key>1767744287</Key>
        <IsHeader>True</IsHeader>
      </Script>
      <Script>
        <FileName>GlobalScript.asc</FileName>
        <Name />
        <Description />
        <Author />
        <Version />
        <Key>1767744287</Key>
        <IsHeader>False</IsHeader>
      </Script>
      <Script>
        <FileName>KeyboardMovement_102.ash</FileName>
        <Name>KeyboardMovement</Name>
        <Description>Allows to move the player character using the keyboard.

See KeyboardMovement.txt for details.
</Description>
        <Author>Rui "Brisby" Pires / strazer</Author>
        <Version>1.02</Version>
        <Key>160503183</Key>
        <IsHeader>True</IsHeader>
      </Script>
      <Script>
        <FileName>KeyboardMovement_102.asc</FileName>
        <Name>KeyboardMovement</Name>
        <Description>Allows to move the player character using the keyboard.

See KeyboardMovement.txt for details.
</Description>
        <Author>Rui "Brisby" Pires / strazer</Author>
        <Version>1.02</Version>
        <Key>160503183</Key>
        <IsHeader>False</IsHeader>
      </Script>
      <Script>
        <FileName>GlobalScript.ash</FileName>
        <Name />
        <Description />
        <Author />
        <Version />
        <Key>1959917563</Key>
        <IsHeader>True</IsHeader>
      </Script>
      <Script>
        <FileName>GlobalScript.asc</FileName>
        <Name />
        <Description />
        <Author />
        <Version />
        <Key>1959917563</Key>
        <IsHeader>False</IsHeader>
      </Script>
    </Scripts>

You can see how "GlobalScript.asc" got defined in there twice somehow, and that there's  a "whoops.asc.ash" but no .asc with it.

Thanks for making the .agf files friendly :D

CB

A Lemmy & Binky Production

Pumaman

  • Creator of AGS
  • Administrator
  • Mittens King
  • I sense danger.
    • Lifetime Achievement Award Winner
    • Pumaman worked on one or more games that won an AGS Award!
    •  
    • Pumaman worked on one or more games that was nominated for an AGS Award!
Re: BUG?: asc/ash error
« Reply #4 on: 01 Feb 2009, 01:08 »
Hmm strange, I've just tried adding a script and renaming it with and without ".asc" and haven't had this problem. Did you at any point try to call it "GlobalScript"?

Let me know if you have this problem again -- if anyone else experiences this, please also let me know.