Results 1 to 9 of 9

Thread: Yet another case of invisible units

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Yet another case of invisible units

    Here is my case:

    battle_models.modeldb entry:

    14 egypt_spearmen
    1 4
    44 unit_models/_Units/egypt/egypt_spearman.mesh 121
    44 unit_models/_Units/egypt/egypt_spearman.mesh 900
    44 unit_models/_Units/egypt/egypt_spearman.mesh 2500
    44 unit_models/_Units/egypt/egypt_spearman.mesh 6400
    5
    5 egypt
    55 unit_models/_Units/egypt/textures/egypt_soldier.texture
    77 unit_models/_Units/ME_Light_Padded/textures/ME_Peasant_Variant_normal.texture 0
    46 unit_sprites/moors_ME_Spear_Militia_sprite.spr
    5 turks
    76 unit_models/_Units/ME_Light_Padded/textures/ME_Peasant_Variant_turks.texture
    77 unit_models/_Units/ME_Light_Padded/textures/ME_Peasant_Variant_normal.texture
    46 unit_sprites/turks_ME_Spear_Militia_sprite.spr
    7 mongols
    78 unit_models/_Units/ME_Light_Padded/textures/ME_Peasant_Variant_mongols.texture
    77 unit_models/_Units/ME_Light_Padded/textures/ME_Peasant_Variant_normal.texture
    48 unit_sprites/mongols_ME_Spear_Militia_sprite.spr
    8 timurids
    79 unit_models/_Units/ME_Light_Padded/textures/ME_Peasant_Variant_timurids.texture
    77 unit_models/_Units/ME_Light_Padded/textures/ME_Peasant_Variant_normal.texture
    49 unit_sprites/timurids_ME_Spear_Militia_sprite.spr
    5 slave
    77 unit_models/_Units/ME_Light_Padded/textures/ME_Peasant_Variant_rebels.texture
    77 unit_models/_Units/ME_Light_Padded/textures/ME_Peasant_Variant_normal.texture
    46 unit_sprites/slave_ME_Spear_Militia_sprite.spr
    5
    5 egypt
    57 unit_models/_Units/egypt/textures/egypt_equipment.texture
    60 unit_models/AttachmentSets/Final Teardrop_moors_norm.texture 0
    5 turks
    60 unit_models/AttachmentSets/Final Teardrop_turks_diff.texture
    60 unit_models/AttachmentSets/Final Teardrop_turks_norm.texture 0
    7 mongols
    62 unit_models/AttachmentSets/Final Teardrop_mongols_diff.texture
    62 unit_models/AttachmentSets/Final Teardrop_mongols_norm.texture 0
    8 timurids
    63 unit_models/AttachmentSets/Final Teardrop_timurids_diff.texture
    63 unit_models/AttachmentSets/Final Teardrop_timurids_norm.texture 0
    5 slave
    60 unit_models/AttachmentSets/Final Teardrop_slave_diff.texture
    60 unit_models/AttachmentSets/Final Teardrop_slave_norm.texture 0
    1
    4 None
    10 MTW2_Spear 0
    2
    18 MTW2_Spear_primary
    14 fs_test_shield 0
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002

    EDU entry:

    type Egyptian Spearmen
    dictionary Egyptian_Spearmen ; Egyptian Spearmen
    category infantry
    class spearmen
    voice_type Light
    banner faction main_spear
    banner holy crusade
    soldier Dismounted_Sipahi_Lancers, 60, 0, 1
    attributes sea_faring, hide_forest, can_withdraw, free_upkeep_unit
    formation 1.2, 1.2, 2.4, 2.4, 5, square
    stat_health 1, 0
    stat_pri 7, 4, no, 0, 0, melee, melee_blade, piercing, spear, 25, 0.6
    ;stat_pri_ex 0, 0, 0
    stat_pri_attr light_spear, spear_bonus_4
    stat_sec 0, 0, no, 0, 0, no, melee_simple, blunt, none, 25, 1
    ;stat_sec_ex 0, 0, 0
    stat_sec_attr no
    stat_pri_armour 0, 4, 6, flesh
    ;stat_armour_ex 0, 4, 0, 0, 1, 6, 6, flesh
    stat_sec_armour 0, 0, flesh
    stat_heat 0
    stat_ground 1, 1, 0, -1
    stat_mental 7, normal, untrained
    stat_charge_dist 30
    stat_fire_delay 0
    stat_food 60, 300
    stat_cost 1, 250, 100, 65, 50, 250, 4, 60
    armour_ug_levels 0
    armour_ug_models egypt_spearmen
    ownership egypt, slave
    ;unit_info 5, 0, 7

    ---------------

    What I'm getting is completely invisible units on the field. Anyone know any reason for this?


    EDIT: When I edit the serialization number at the top of the file, the game CTD's. That means my code is wrong...I can't seem to find a mistake, any help?
    Last edited by PurpleScotch; February 08, 2008 at 09:08 AM.

  2. #2
    KnightErrant's Avatar Decanus
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    578

    Default Re: Yet another case of invisible units

    I don't know if this is the cause but one thing that looks wrong to me
    is:

    Code:
    14 egypt_spearmen 
    1 4 
    44 unit_models/_Units/egypt/egypt_spearman.mesh 121 
    44 unit_models/_Units/egypt/egypt_spearman.mesh 900 
    44 unit_models/_Units/egypt/egypt_spearman.mesh 2500 
    44 unit_models/_Units/egypt/egypt_spearman.mesh 6400 
    5 
    5 egypt 
    55 unit_models/_Units/egypt/textures/egypt_soldier.texture
     77 unit_models/_Units/ME_Light_Padded/textures/ME_Peasant_Variant_normal.texture 0   
    46 unit_sprites/moors_ME_Spear_Militia_sprite.spr 
    5 turks 
    76 unit_models/_Units/ME_Light_Padded/textures/ME_Peasant_Variant_turks.texture 
    77 unit_models/_Units/ME_Light_Padded/textures/ME_Peasant_Variant_normal.texture 
    46 unit_sprites/turks_ME_Spear_Militia_sprite.spr 
    7 mongols
    The 0 at the end of the line looks like it shouldn't be there, the 0's only
    occur on the attachment sets entries.

  3. #3
    Socal_infidel's Avatar PDER Piper
    Join Date
    Jan 2007
    Location
    Brooklyn USA
    Posts
    2,563

    Default Re: Yet another case of invisible units

    This isn't going to solve your immediate problem, but if you're editing the modelsdb file, then I would highly recommend using KE's formatted mdb tool

    Believe me, it's a lifesaver. It'll format your mdb into something approaching readable and the syntax checker will catch a lot of little mistakes. One of the best 72.3 KB downloads you'll find around here!

    Oh yeah, what happens if you change this line:

    Code:
    soldier Dismounted_Sipahi_Lancers
    to

    Code:
    soldier Egypt_Spearmen

  4. #4

    Default Re: Yet another case of invisible units

    Thanks for the replies.

    But the problem of the invisible units is the serialization number, EXCEPT that my code is somewhat wrong. Because when I edit the serialization number by +1 to the 701 value, I get a CTD...

    Which means, the code I put in the battles_models file is somewhat wrong.

    @KnightErrant: I removed the zero, but I still get a CTD before the game starts.


    @Socal infidel:

    I get a CTD, because the modelsdb file entry is wrong, so I have to keep the serialization vanilla, which means the model entry virtually doesn't exist, which means the game would crash because it can't find the model and it's animation.

    ---

    I'm not sure if this is too much, but can one of you construct an entry with the same file directories I included, and point me out to what has to be done, and doesn't have to be done?

    Thanks for replying!
    Last edited by PurpleScotch; February 08, 2008 at 10:57 AM.

  5. #5

    Default Re: Yet another case of invisible units

    Its invisible because you have it at the end of the db file and hadn't changed the serialization number. So as far as the game was concerned the entry didn't exist. Hence invisible. Upgrading the serialization number you added the entry to the file and an error in the syntax is causing a CTD. Have you checked EVERY line with regards to character length? 99.9% of the time when there is a CTD it is caused by that. But you definitely need to check syntax. A place I some times screw up is the weapons and shield animations.

  6. #6
    Socal_infidel's Avatar PDER Piper
    Join Date
    Jan 2007
    Location
    Brooklyn USA
    Posts
    2,563

    Default Re: Yet another case of invisible units

    Hmm, if it's a problem with your entry in the mdb, then I would definitely download KE's syntax checker. It'll tell you if your model count if off, or if the strings count at the beginning of a line is wrong. All that stuff that is sometimes easy to overlook.

    I remember I wanted to kill myself after adding mounts for new factions to the game and overlooked the formatting that immediately follows the last entry for each faction mount texture path. Placed new factions after that and got a nasty CTD...took awhile but I done figured it out.

  7. #7
    KnightErrant's Avatar Decanus
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    578

    Default Re: Yet another case of invisible units

    Ah, I see it, or at least part of it,

    Code:
    14 egypt_spearmen
    in the modeldb file doesn't match with

    Code:
    type             Egyptian Spearmen
    dictionary       Egyptian_Spearmen      ; Egyptian Spearmen
    category         infantry
    class            spearmen
    voice_type       Light
    banner faction   main_spear
    banner holy      crusade
    soldier          Dismounted_Sipahi_Lancers, 60, 0, 1
    attributes       sea_faring, hide_forest, can_withdraw, free_upkeep_unit
    formation        1.2, 1.2, 2.4, 2.4, 5, square
    stat_health      1, 0
    stat_pri         7, 4, no, 0, 0, melee, melee_blade, piercing, spear, 25, 0.6
    ;stat_pri_ex      0, 0, 0
    stat_pri_attr    light_spear, spear_bonus_4
    stat_sec         0, 0, no, 0, 0, no, melee_simple, blunt, none, 25, 1
    ;stat_sec_ex      0, 0, 0
    stat_sec_attr    no
    stat_pri_armour  0, 4, 6, flesh
    ;stat_armour_ex   0, 4, 0, 0, 1, 6, 6, flesh
    stat_sec_armour  0, 0, flesh
    stat_heat        0
    stat_ground      1, 1, 0, -1
    stat_mental      7, normal, untrained
    stat_charge_dist 30
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        1, 250, 100, 65, 50, 250, 4, 60
    armour_ug_levels 0
    armour_ug_models egypt_spearmen
    ownership        egypt, slave
    ;unit_info        5, 0, 7
    The red entries should all be the same and match to the modeldb name.

  8. #8

    Default Re: Yet another case of invisible units

    Ah, well, I don't think that's the problem. The dictionary name can be set to whatever one wants, and the soldier line only tells which modelsdb animation entry to use (he could make it egypt_spearmen, but unless they use different animations it wouldn't matter).


    The only relevant part should be egypt_spearmen on the armour_ug_models line.


    How about you try a simple approach? Delete the modelsdb entries for everything BUT Egypt, try a more orthodox texture folder approach.


    5 egypt
    76 unit_models/_Units/ME_Light_Padded/textures/ME_Peasant_Variant_egypt.texture
    77 unit_models/_Units/ME_Light_Padded/textures/ME_Peasant_Variant_normal.texture


    and

    5 egypt
    60 unit_models/AttachmentSets/Final Teardrop_egypt_diff.texture
    60 unit_models/AttachmentSets/Final Teardrop_egypt_norm.texture 0


    Placing and renaming your texture files to the above proper folders.


    Then simply have the EDU ownership set to egypt and no one else.



    OH YEAH.

    Try and remove the multiple mesh entries that are all alike. Instead of reusing egypt_spearman 4 times, try and make copies of the file and rename them all into egypt_spearmen_lod0, lod1, lod2, and lod3 just like the vanilla files.

    Or make it something like this:
    14 egypt_spearmen
    1 1
    44 unit_models/_Units/egypt/egypt_spearman.mesh 6400



    And also, I recommend renaming the mesh into egypt_spearmen.mesh for consistency.
    Last edited by Sher Khan; February 08, 2008 at 06:46 PM.

  9. #9

    Default Re: Yet another case of invisible units

    Thanks guys. I solved the problem. I copied a whole code from a one faction unit, changed that faction's entry to Egypt, and launched the game.

    The unit appears but the shields and spears get messed up UV-maps, as in the shield uses other parts of the texture. When I try to convert the model back as a .ms3d to check it out, the UV-maps are perfectly normal.

    What's that supposed to mean? :S

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •