←  C&C Generals & Zero Hour Editing

Fallout Studios Forums

»

Building Coding Problems

Stalker's Photo Stalker 26 Nov 2012

Hi,

So I have this model:

Posted Image

Posted Image

And I want to get it ingame. It has 3 Turrets and should be Garrisonable. The problem is that I didn't get it to work correctly yet.
I had two Ideas how to code it:

1.) Main Object has 2 Turrets, and an OverlordContain Module to contain an Attached Object which has another Turret, and is garrisonable.
- It works fine, but random crashes occur, when the building gets into damaged (or reallydamaged) state. Also If the Building is sold, the extra object keeps existing.

2.) Main Object is Garrisonable and has no Weapons. The 3 turrets are individual objects, created via Stinger Site logic.
- It works, but the turrets stay in the air during selling process, and they have no damged or reallydamaged states, which looks really dumb.

Any ideas?

~Stalker
Quote

Zeke's Photo Zeke 26 Nov 2012

Unfortunately your second method is the closest you can get in ZH. Though for the damage states, you can just add damage particle bones on the main model where the turrets are. It's not perfect but it's better than nothing.
Quote

n5p29's Photo n5p29 26 Nov 2012

better use the overlord contain. but since it's also garrisonable, how about using helix contain instead?
about the crash issue, maybe there's something else wrong in your codes.
Quote

Zeke's Photo Zeke 26 Nov 2012

View Postn5p29, on 26 November 2012 - 15:10, said:

better use the overlord contain. but since it's also garrisonable, how about using helix contain instead?
about the crash issue, maybe there's something else wrong in your codes.


iirc, overlord contain is limited to one turret.
Quote

Stalker's Photo Stalker 26 Nov 2012

Random crashes seem to occur with both methods. However I'm pretty sure somethings's wrong with my model. How can a model make the game crash? (Sometimes it crashes when going from Normal into Damaged or Reallydamaged state).

IIRC Helix Contain requires a Locomotor and wouldn't work with Structures. Also the Firepoints wouldn't work.

EDIT: I did some testing, I'm 99% sure it's the model. Probably sometimes fails to load during state changes. But why?
-Too many Firepoints (it has 25)?
-Too much Alpha Channel (the big dirt pile)
-Too many (large) Textures?
-Too many Polygons? (I can't really believe that, it has ~2700)
Edited by Stalker, 26 November 2012 - 16:45.
Quote

Zeke's Photo Zeke 27 Nov 2012

Did you use .psd textures in the material editor? That can cause crashes. Also it would help if you post your codes.
Edited by Zeke, 27 November 2012 - 09:16.
Quote

Stalker's Photo Stalker 27 Nov 2012

All textures are .tga (I'll try with .dds later).

Well, here are the codes, however I don't think there's something wrong with it, as it was working just fine when I used a simpler dummy model.

Code:
Spoiler

Edited by Stalker, 27 November 2012 - 09:47.
Quote

Zeke's Photo Zeke 27 Nov 2012

View PostStalker, on 26 November 2012 - 16:30, said:

-Too many Firepoints (it has 25)?
-Too much Alpha Channel (the big dirt pile)
-Too many (large) Textures?
-Too many Polygons? (I can't really believe that, it has ~2700)


How big are the textures? .tga files are not ideal because they have really big file sizes and they generally don't look good compared to .dds files

If you are using hueg tga files that could be the problem.
Quote

Stalker's Photo Stalker 27 Nov 2012

I have already tried it with .dds. It still crashed.
I have also tried to simplify the model by attaching everything to a single mesh. It screwed up the alpha channel parts but it didn't crash. When I fixed the alpha channel, it crashed again. -.-
Quote

Zeke's Photo Zeke 27 Nov 2012

Well SAGE does hate alpha channels.

How big is that dirt texture?
Quote

Stalker's Photo Stalker 27 Nov 2012

512x512 - That shouldn't really be an issue
Quote

n5p29's Photo n5p29 27 Nov 2012

have you checked all of the bones on the models? maybe the damaged models have something lack than the normal model.
Quote

Stalker's Photo Stalker 29 Nov 2012

After hours of trial and error I got it to work. I reimported, the w3d file, reapplied all textures, got rid of a few unneeded ones. When I edited the mesh for damaged models, it kept crashing ingame though. So at the moment there are only skin changes when it is damaged, but I'll leave it at that.

Thanks for your help, guys.
Quote

Zeke's Photo Zeke 02 Dec 2012

It's too much awesomeness for SAGE to handle :P
Quote

Zeke's Photo Zeke 30 Jan 2013

Double post bump, but I got an idea from a random convo with Kris. Try dividing the model and put the parts in different draw modules. I think SAGE has a limit on how many polies/textures it can handle per draw module.
Quote

Stalker's Photo Stalker 30 Jan 2013

I already put all the animated parts into another model, but that probably wasn't enough. It works at the moment, my damaged models however, are just reskins. My previous damaged models had a deformed mesh and crashed. That's probably because I attached all parts (with different skins) to a singe mesh. Normally that should work, but maybe I reached some limits there.
Quote