Page 1 of 1

Can't make custom object transparent [Solved]

Posted: Thu Jun 10, 2010 2:06 pm
by Food_Eater
I've been trying to create a large flat wall that is entirely invisible but has collision. Since I lack the XSI knowhow, I made a wall in SketchUp with a texture that has an alpha channel, making the whole thing transparent (and it appeared so in SketchUp). I followed the tutorial through XSI and converted it to a .msh. Before I hex-edited in the transparency, I placed the object in ZeroEditor so I knew were to put it. As expected, the object appeared completely black (which is what the texture looks like without the alpha channel). Then I hex-edited in the transparency and went back in to ZeroEditor. The object was now invisible. But when I loaded up the map, the object appeared black.

For days I've been trying to figure out what's wrong.

I've re-made the model a few times. No luck.

At first I thought that maybe the game doesn't accept textures with a 2x2 pixel resolution (I'm using small resolutions since the object's supposed to be invisible anyway). So I tried something larger like 32x32 when I remade/converted the model. That didn't help. It's invisible in ZeroEditor, anyway.

I've tried changing the numbers in the hex editor to use the different types of transparency like the "double-sided" and the "hard-edged" etc. None of them work.

I even put the "Transparent = [value]" line in the .odf, even though I'm pretty sure that's only for cloth. It didn't work, no surprise.

Full cleans haven't helped either.

I don't know what to do. I've made an object with transparency before and it turned out fine.

If this helps diagnose the problem: Weapon effects don't show up in front of the object, and it's black on both sides of the face for some weird reason.

Re: Can't seem to get custom object to have transparency

Posted: Thu Jun 10, 2010 4:19 pm
by Maveritchell
Is there more than one projection referenced in the .msh file?

Re: Can't seem to get custom object to have transparency

Posted: Thu Jun 10, 2010 5:06 pm
by Teancum
Just curious, but you know about the default invisible barrier boxes you can place in ZE, right?

Re: Can't seem to get custom object to have transparency

Posted: Fri Jun 11, 2010 3:25 am
by Food_Eater
@Maveritchell, nope. I wouldn't have been able to export it through MeshEx if that were the case, anyway.

@Teancum, you mean the AI barriers? Yeah I know of those and know how to use them, but they don't have collision, do they? This isn't for controlling AI or anything like that. I just need something with collision and it has to be an object because I'm referencing certain properties in the odf.

You guys are probably wondering why I need a big transparent object that doesn't effect gameplay. Let's just say it's a neat aesthetic thing that the player can interact with that adds to the atmosphere of the battle. If anyone wants to look at the .msh and .tga themselves, I'll gladly PM them. It's such a simple object that it doesn't spoil what I'm trying to do.

Re: Can't seem to get custom object to have transparency

Posted: Fri Jun 11, 2010 3:37 am
by lucasfart
Check out the stock Mos Eisley map. The walls around the edge have invisible collisions above them to stop you flying away......They do have collision, and can stop the player as well as ai.

Re: Can't seem to get custom object to have transparency

Posted: Fri Jun 11, 2010 4:11 am
by Food_Eater
Hmmm... so apparently there are invisible collision objects right in the common folder! Wow, I never knew that. Thanks for the find.

But I'm going to need something much bigger than these, so I'll just reference the com_inv_col meshes and targa to see how I can change my own mesh. What puzzles me is that the targa doesn't have an alpha channel and and the meshes don't have the transparency thing applied in the hex editor. I'll do some digging around.

Edit: I haven't gotten around to replicating the properties of the invisible column mesh yet, but I recolored the texture blue and did a manual clean before munging, and it still appears black in-game. Is there a limit on how large an object can be to display textures, or how large the texture's projection is allowed to be?

Re: Can't seem to get custom object to have transparency

Posted: Fri Jun 11, 2010 6:00 am
by SW_elite
I can't answer the question you just asked but couldn't you just put a few of the invisable walls together to get the size you need?

Re: Can't seem to get custom object to have transparency

Posted: Fri Jun 11, 2010 6:30 am
by lucasfart
Or you can scale the object in the odf, if you really wanted to......It isn't scaled in ZE though, from what i can remember.

Re: Can't seem to get custom object to have transparency

Posted: Fri Jun 11, 2010 6:42 am
by Food_Eater
As far as I know, you can only scale an object up to 1.3 before problems occur.

I guess I will make a much smaller version of my mesh to see if size really is the issue.

Re: Can't seem to get custom object to have transparency

Posted: Fri Jun 11, 2010 7:10 am
by DarthD.U.C.K.
the invisible object in the commonfolder are rather big collisions with one small triangle to make the placement easier
the invisible collisions i made for tuskecamp were all a big collisionobject (which is rendered invisible ingame automatically) and a small cube with a transparent texture and transparency enabled (because just having the invisible collisionobject in the msh didnt work for some reason)

Re: Can't seem to get custom object to have transparency

Posted: Fri Jun 11, 2010 8:01 am
by Food_Eater
Dunno how to make collisionobjects, I'm guessing it has to do with XSI which I know little about. My object is just a basic square, and now I've sized it down drastically, there's no reason why it shouldn't work.

I'm getting pretty desperate, so here's some pics of the mesh in a hex editor as well as the image with the channels panel in photoshop.
Hidden/Spoiler:
Image
black.tga is the texture
Hidden/Spoiler:
Image
Just tell me if there's something wrong.

Re: Can't seem to get custom object to have transparency

Posted: Fri Jun 11, 2010 8:58 am
by Maveritchell
Food_Eater wrote:@Maveritchell, nope. I wouldn't have been able to export it through MeshEx if that were the case, anyway.
You're right, and I really meant "texture support" or "texture subprojection," but the effect would be the same in that you would have the texture referenced more than once in your .msh file (this you can do with MshEx). In any case I see from your example that you do not.

Just post a link to your mesh and texture and I'll take a look at it.

Re: Can't seem to get custom object to have transparency

Posted: Fri Jun 11, 2010 9:19 am
by Food_Eater
Here it is

Please be aware that the scale of the mesh is gargantuously large, but that's on purpose.

Re: Can't seem to get custom object to have transparency

Posted: Fri Jun 11, 2010 10:22 am
by Maveritchell
You have most likely done something wrong in the exporting process. There's nothing apparently incorrect about your texture or your model in its munged form. Remake your model, freeze all its transforms, and re-export.

Make sure when you hexedit for transparency you use hard-edged (14 instead of 04) transparency. If you have an alpha layer that's only black and white (i.e. with no shades of grey - and completely transparent is all-black), you want to use hard-edged because it will eliminate the "transparency interference" you get when two objects with transparency are viewed one in front of the other.

Re: Can't seem to get custom object to have transparency

Posted: Fri Jun 11, 2010 10:30 am
by DarthD.U.C.K.
really? most interesting to know, you should write that into the faq-transparencytopic

Re: Can't seem to get custom object to have transparency

Posted: Sat Jun 12, 2010 5:25 am
by Food_Eater
Well, I rebuilt the model, froze all transforms (something I've been neglecting to do), and the redid entire process to no avail. I tried using normal sized textures like 512x512. I've tried having the textured repeat many times instead of being stretched out across the whole object. I tried breaking up the face into several smaller triangles. Nothing works.

It always appears transparent in editor, regardless of whether or not transparency is applied. It always appears black in-game, though I've managed to change the back side to be transparent or opaque depending on whatever I hexed in. If only I could give collision to the transparent back face, then I'd just flip it around and use that instead.

So I guess it's just because the object is so large. It's 375" height and 1875" length in SketchUp, which I think rounds to about 1250" height and 6250" length in XSI/Battlefront proprtions. There are no objects in the game that large, so there are definetly not any polys at that scale. It makes sense that the game is unable to project textures on something of that scale. I'd love it for someone to prove me wrong, though.

Anyway, it was supposed to be a massive shield alongside the border of a space map. So much for that grand idea.

Re: Can't seem to get custom object to have transparency

Posted: Sat Jun 12, 2010 8:39 am
by Maveritchell
Use several objects. There's no reason you should have to use one large object.

Re: Can't seem to get custom object to have transparency[SOL

Posted: Sun Jun 27, 2010 2:09 am
by Food_Eater
I accidentally found the solution to the problem after giving up on the idea weeks ago.

I gave the name "shield" to the object in Zeroeditor. Then, I placed this line...
SetProperty("shield", "IsVisible", 0)
...in the "function SetupObjectives()" section of the space map's assault script.

Now the object is completely invisible but still has collision and a label.