Jump to content


Building Coding Problems

3 Turrets + Bunker. How?

15 replies to this topic

#1 Stalker

    All Purpose ZH Modder

  • Project Team
  • 568 posts
  • Projects: secret stuff.

Posted 26 November 2012 - 10:13

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
Posted Image

#2 Zeke

    The X General

  • Project Team
  • 3504 posts
  • Projects: Deep Impact (formerly EC)

Posted 26 November 2012 - 11:32

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.

#3 n5p29

    Lurker

  • Project Leader
  • 1417 posts
  • Projects: NProject Mod, Recolonize, Tidal Wars

Posted 26 November 2012 - 15:10

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.

#4 Zeke

    The X General

  • Project Team
  • 3504 posts
  • Projects: Deep Impact (formerly EC)

Posted 26 November 2012 - 15:38

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.

#5 Stalker

    All Purpose ZH Modder

  • Project Team
  • 568 posts
  • Projects: secret stuff.

Posted 26 November 2012 - 16:30

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.

Posted Image

#6 Zeke

    The X General

  • Project Team
  • 3504 posts
  • Projects: Deep Impact (formerly EC)

Posted 27 November 2012 - 09:15

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.


#7 Stalker

    All Purpose ZH Modder

  • Project Team
  • 568 posts
  • Projects: secret stuff.

Posted 27 November 2012 - 09:46

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.

Posted Image

#8 Zeke

    The X General

  • Project Team
  • 3504 posts
  • Projects: Deep Impact (formerly EC)

Posted 27 November 2012 - 11:22

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.

#9 Stalker

    All Purpose ZH Modder

  • Project Team
  • 568 posts
  • Projects: secret stuff.

Posted 27 November 2012 - 12:00

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. -.-
Posted Image

#10 Zeke

    The X General

  • Project Team
  • 3504 posts
  • Projects: Deep Impact (formerly EC)

Posted 27 November 2012 - 12:15

Well SAGE does hate alpha channels.

How big is that dirt texture?

#11 Stalker

    All Purpose ZH Modder

  • Project Team
  • 568 posts
  • Projects: secret stuff.

Posted 27 November 2012 - 12:55

512x512 - That shouldn't really be an issue
Posted Image

#12 n5p29

    Lurker

  • Project Leader
  • 1417 posts
  • Projects: NProject Mod, Recolonize, Tidal Wars

Posted 27 November 2012 - 16:16

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

#13 Stalker

    All Purpose ZH Modder

  • Project Team
  • 568 posts
  • Projects: secret stuff.

Posted 29 November 2012 - 08:47

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.
Posted Image

#14 Zeke

    The X General

  • Project Team
  • 3504 posts
  • Projects: Deep Impact (formerly EC)

Posted 02 December 2012 - 00:34

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

#15 Zeke

    The X General

  • Project Team
  • 3504 posts
  • Projects: Deep Impact (formerly EC)

Posted 30 January 2013 - 08:51

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.

#16 Stalker

    All Purpose ZH Modder

  • Project Team
  • 568 posts
  • Projects: secret stuff.

Posted 30 January 2013 - 22:11

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.
Posted Image



3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users