In a previous episode, I was trying to switch the PC to another character. That has since been solved, thanks to Ben. But in pursuing that on my own, I've created a persistent weird compile error.

I was (mis)using "intialPlayerChar = ..." mid-game for this purpose.

It didn't work. Therefore I tried "gameMain.initialPlayerChar = ...."

That didn't work. Therefore I tried making a method in gameMain that would take a parameter and set the PC to the parameter. I figured that the gameMain object didn't like outside code fiddling with its data.

That didn't work, so I tried creating gameMain's PC assignment method inside a pre-game intialization code, on the theory I was getting to gameMain too late. That didn't work either -- turns out all of this was a red herring; could the intialPlayerChar documentation perhaps mention gPlayerChar? -- but now I have a weird compile error I can't clear.

It seems that I've somehow created an EXTRA gameMain object, that I CAN'T get rid of.

>t3make -Fy "C:\Users\Conrad\Documents\TADS 3\obj" -Fo "C:\Users\Conrad\Documents\TADS 3\obj" -o "Amy`s Key_dbg.t3" -D "TADS_INCLUDE_NET" -D "LANGUAGE=en_us" -D "MESSAGESTYLE=neu" -v -d -statprefix <@> -statpct "Amy`s Key.t" "system.tl" "adv3\adv3web.tl" "webui.tl" "tadsnet.t" "other\scenes_ee.t" "AK_act1.t" "AK_act2.t" "AK_act3.t" "AK_verbs.t" -res "GameInfo.txt"
TADS Compiler 3.1.0 Copyright 1999, 2010 Michael J. Roberts
error:
The symbol "showGoodbye", which was originally defined of type function, is
redefined with type property in object file "C:\Users\Conrad\Documents\TADS
3\obj\misc.t3o". A global symbol can be defined only once in the entire
program. You must change one of the symbol's names in one of your source files
to remove the conflict.
If you recently changed the meaning of this symbol,
you might simply need to do a full recompile - try building again with the -a
option.
error:
The symbol "showIntro", which was originally defined of type function, is
redefined with type property in object file "C:\Users\Conrad\Documents\TADS
3\obj\misc.t3o". A global symbol can be defined only once in the entire
program. You must change one of the symbol's names in one of your source files
to remove the conflict.
If you recently changed the meaning of this symbol,
you might simply need to do a full recompile - try building again with the -a
option.
Errors: 2
Warnings: 0
t3make: error code 1
Build failed.

The code doesn't make any sense to me. You are trying to "modify" a method and you even do that inside another method? You can't modify methods or funtions, and you also can't define them inside other methods/functions.

Edit:Btw, you will never be able to do this using initialPlayerChar. As the name of that property implies, it holds the *initial* player character. After initialization, that property is useless.

Btw, you will never be able to do this using initialPlayerChar. As the name of that property implies, it holds the *initial* player character. After initialization, that property is useless.

Yeah, that's been clarified to me, by Ben this time and by Eric a year ago. -- Is this documented anywhere? I couldn't find it, and I had a basic idea what to look for.

Quote:

The code doesn't make any sense to me. You are trying to "modify" a method and you even do that inside another method? You can't modify methods or funtions, and you also can't define them inside other methods/functions.

Heh, I won't say the code makes sense. It's been removed from the game now, but I still get the error -- apparently because it created some weirdly persistent object.

I *did* just try using modify before the posted version. In any case, the problem is not now to make the code work. The problem is to unbreak whatever mysterious thing inside the project got broken by my attempt to edit gameMain.

Hmm, in case you found a compiler bug, try deleting the files by hand. Delete everything in the directory "C:\Users\Conrad\Documents\TADS 3\obj" and see if it helps. If yes, the "clean" functionality of the compiler has a bug. If it doesn't help, you still have definitions of showGoodbye() and showIntro() as functions somewhere in your code. Do a global search for them.

Hmm, in case you found a compiler bug, try deleting the files by hand. Delete everything in the directory "C:\Users\Conrad\Documents\TADS 3\obj" and see if it helps. If yes, the "clean" functionality of the compiler has a bug. If it doesn't help, you still have definitions of showGoodbye() and showIntro() as functions somewhere in your code. Do a global search for them.

I never wrote definitions for showGoodbye() or showIntro().

I'll delete TADS 3\obj files and see what happens. Almost doesn't matter at this point, as I've created a clean project and cut-pasted the code over. Which worked fine, by the way.

RealNC figured this out. Not a deep problem with T3, as it turns out, but a stray semicolon.

RealNC wrote:

I found the problem. You have this in your code:

Code:

gameMain: GameMainDef
initialPlayerChar = me;

The semicolon ("me;") terminates the object definition. So when you try to define showIntro() after that, what you're doing is defining a function, not overriding the showInto() method of GameMainDef, which is why the compiler is giving an error.

Personally, I don't like the short syntax for defining objects and classes, because using a semicolon to terminate property overrides is very natural. I use this syntax instead:

Who is online

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum