So when I try to overlay Bb, I get:
Script error. Object with duplicate name already exists
Bb = g_world.newtexture("Intr02", #fromcastmember, member("Intr02"))
Why am I getting that error? I named the new texture something different.
It really looks like you already have a texture with that name. I can't suggest how it got there, but I'm inclined to believe the SW3D engine on this point ;-)
I bet it worked the first time you ran it? It's a simple problem I have overlooked when creating quick tests, unless you manually or through code reset the w3d, models and textures etc are still going to be there the next time you run your project in Director.
When you initialize your world run member("yourW3D").resetWorld(), this should solve your problem. 3DPI would also help you see what textures etc are in your w3d at any time in your program and can reset or delete certain textures etc without resetting the whole w3d.
Hope this helps.
First, I should add that the error comes when I try to overlay Intr02 (which is when the game hits 12 seconds).
Second, I've always used the resetWorld code at the initialization for all my levels. I even double checked this level to make sure I didn't make a stupid mistake.
Any other ideas?
Well according to your error message you never get so far as to create the overlay, the error occurs the line before you assign the texture, there clearly exists an instance of an texture with the same name at the time.
Also if you ran the program past the texture creation, saved your dir, then director won't remove it on resetworld, but since you checked inside the w3d member in your dir or cst we'll assume it's clean.
I sugest inserting a break point before or on the line causing the error and either through 3DPI, object inspector or through lingo code in the message window, checking to see if the texture exists.
Off the top of my head possible causes may be that:
you are calling this function more than once (pGameTime isn't updated before you reenter this function again?),
creating a texture with the same name somewhere else (do a search for).
Other than that it's difficult to guess, the only way to be sure would be to step through the movie and see what happens, if you have a stripped down version of your game with the error I'd be willing to take a look.
ok, I'm just thinking out loud right now on the forum but, I think maybe its overlaying it again within the second. You know what I mean? Like...right when 12 seconds hits, it overlays the image but even a millisecond after the 12 marker it tries to overlay again.. I'm gonna try to walk around this somehow and see if it works.