Jump to content


Photo

Map.ini Help


  • Please log in to reply
3 replies to this topic

#1 HighKing96

HighKing96
  • New Members
  • 5 posts

Posted 10 January 2025 - 10:10 PM

I'm hoping someone can help me with troubleshooting my attempt to make map.ini files.

 

My goal is to replace Gondor Soldier, Archer, and banner carrier models with their Last Alliance variants, in addition to the Elven Warrior model with it's Last Alliance model. I've looked at several tutorials and tried to follow along with the ReplaceModule, but the game crashes as soon as I launch the map, giving me parsing errors related to the ModuleTag and the line replacing the model:

 

 

I would also like to make the Elven Barracks buildable from either Gondor/Rohan building foundations and outpost flags.



#2 Echo

Echo

    T3A:Online

  • T3A Staff
  • 1,072 posts
  • Projects:Lot3A
  •  ~~
  • Division:BFME
  • Job:T3A Moderator
  • Donated

Posted 12 January 2025 - 02:01 AM

Hi! For your first issue, it would be helpful if you include the errors you're getting. They tend to give clues on what's wrong ;)

Generally you need to take a look at the Gondor Soldier model, see how the DrawModule is called. In that case it's ModuleTag_01.

 

So, you replace it as follows:

ReplaceModule ModuleTag_01
  Draw = W3DScriptedModelDraw ModuleTag_01_Override ; << Can be any name but this works well in terms of readability
    ;All the content of the LA Gondor Soldier model's draw module goes here.
  End
End

In full, something like this should work:
 

Spoiler


It is important that ReplaceModule requires an extra 'End' to close that behavior.

As for the CommandSet... there's a command that builds the barracks, just add it to the CommandSet of the foundation of your choosing via map.ini?

CommandSet RohanFoundationCommandSet
  1  = Command_ConstructRohanFarm
  2  = Command_ConstructRohanArcherRange
  3  = Command_ConstructRohanWell
  4  = Command_ConstructRohanStatue
  5  = Command_ConstructRohanStable
  6  = Command_ConstructRohanArmory
  7  = Command_ConstructElvenBarracks ; << like this
End

I don't know what you mean by making them buildable from outpost flags. In any case, I would recommend you to play around with this, take a look at INI.big and try coding some stuff, and also take a look at complex map.ini files from custom maps like Gladiator. Do you have access to some existing custom maps?


26285.png


#3 HighKing96

HighKing96
  • New Members
  • 5 posts

Posted 13 January 2025 - 10:06 PM

Hello! Thank you for your detailed explanation! I guess my initial problem is that I didn't realize I would need all the lines for that ModuleTag in the body, I thought I could simply keep it at the "Model" line to essentially just swap the skin. But now I attempted the code that you shared, and I'm still getting the same error. I added "Object GondorFighter" at the top and then copied everything you wrote below that

 

This is the error I'm currently getting

 

"ReplaceModule must replace modules with another module of the same type, but you are attempting to replace a W3DHordeModelDraw with W3DScriptedModelDraw for object GondorFighter

Error parsing field 'Draw" in block "object" in [file location], line 5.

Error parsing field field ' Draw' in block 'Object' in [file location], line 5

Error parsing INI block ' Draw' in [file location]"

It then lists 7 addresses which are strings of file names and characters



#4 Echo

Echo

    T3A:Online

  • T3A Staff
  • 1,072 posts
  • Projects:Lot3A
  •  ~~
  • Division:BFME
  • Job:T3A Moderator
  • Donated

Posted 14 January 2025 - 07:42 PM

Hello! Thank you for your detailed explanation! I guess my initial problem is that I didn't realize I would need all the lines for that ModuleTag in the body, I thought I could simply keep it at the "Model" line to essentially just swap the skin. But now I attempted the code that you shared, and I'm still getting the same error. I added "Object GondorFighter" at the top and then copied everything you wrote below that

 

This is the error I'm currently getting

 

"ReplaceModule must replace modules with another module of the same type, but you are attempting to replace a W3DHordeModelDraw with W3DScriptedModelDraw for object GondorFighter

Error parsing field 'Draw" in block "object" in [file location], line 5.

Error parsing field field ' Draw' in block 'Object' in [file location], line 5

Error parsing INI block ' Draw' in [file location]"

It then lists 7 addresses which are strings of file names and characters

Yeah that is true. I just checked. It actually depends on the base model, in this case the GondorFighter. The GondorFighter uses indeed the W3DHordeModelDraw and not W3DScriptedModelDraw.

This is from the GondorFighter object: 

Object GondorFighter
    ; *** ART Parameters ***

    SelectPortrait         = UPGondor_Soldier
;    SelectPortrait         = SP_Gondor_Swordman

    Draw = W3DHordeModelDraw ModuleTag_01
        OkToChangeModelColor = Yes    
        StaticModelLODMode = Yes

So you would have to use that instead (because, as the error says, we attempted to replace a W3DHordeModelDraw with a W3DScriptedModelDraw, and the game won't like that).

ReplaceModule ModuleTag_01
  Draw = W3DHordeModelDraw ModuleTag_01_Override ; << Can be any name but this works well in terms of readability
    ;All the content of the LA Gondor Soldier model's draw module goes here.
  End
End

Ah, and this would be the full code:
 

Spoiler

Edited by Echo, 14 January 2025 - 07:46 PM.

26285.png





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users