BUG?: asc/ash error

Started by CaptainBinky, Sun 01/02/2009 00:27:03

Previous topic - Next topic

CaptainBinky

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.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at AGS.Editor.Components.ScriptsComponent.CommandClick(String controlID)
   at AGS.Editor.GUIController._mainForm_OnMenuClick(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

A Lemmy & Binky Production

CaptainBinky

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

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

Quote from: Pumaman on Sun 01/02/2009 00:38:38
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.

Quote from: Pumaman on Sun 01/02/2009 00:38:38
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

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.

SMF spam blocked by CleanTalk