Jump to content


Photo

Some ROTWK 3d-modelling and texturing questions


  • Please log in to reply
3 replies to this topic

#1 DaedraWarrior

DaedraWarrior
  • Members
  • 8 posts

Posted 18 June 2020 - 02:29 PM

Hi everyone!

 

I'm diving into ROTWK modding and are facing some troubles. I already clued how to rig my models and add textures (thanks to the huge amount of tutorials), but there are some things I can't understand even with examples from other mods:
1) How to add multiple textures to one unit in ini files, if it's possible? I mean, not random texture for variations. For example, I have no space for the sword texture in my texture file and I want to add standalone file, but I can't find in unit's ini what should I write to make this second texture work.

2) Some questions about randomizing textures and models. For example, if I'll make one texture with two different heads or shields, I understand that I should make two different models of heads\shields and bind them to this texture, but how do I make game understand that it should randomize my head\shield models in the horde?



#2 Kwen

Kwen

    Vileartist

  • T3A Staff
  • 4,865 posts
  • Location:Korea I wish
  • Projects:It'sa secreeet
  •  T3A's First N00b
  • Division:BFME
  • Job:T3A Expert
  • Donated

Posted 04 July 2020 - 01:01 AM

1. It's really very simple, you can assign multiple textures to a single model and the game will have no trouble pulling each texture file as necessary. Although it is a better idea to increase the canvas size of your base texture and include everything in there if possible because using multiple textures per unit causes lag when many units are on screen.

 

2. There are a couple different ways to randomize; The first and most "ideal" is through LUA scripting, but it's not simple to understand. There are three things you need to do to make it work. In a unit's ini code you must find the

AILuaEventsList

line and modify it to a custom entry ex:

AILuaEventsList                    = RohanPeasant1Functions

Then you must have access to scripts.lua and scriptevents.xml (found in data.big and located in data/scripts in your mod directory)

 

In scriptevents.xml you define your custom AILuaEventsList entry ex:

<EventList Name="RohanPeasant1Functions" Inherit="BaseScriptFunctions">

        <EventHandler EventName="OnCreated"    ScriptFunctionName="OnRohanPeasant1Created" DebugSingleStep="false"/>

    </EventList>

This sets the "OnCreated" script for your unit. Now in scripts.lua you make a script to randomize subobjects. It's not easy to explain in great detail, but if you take some time and really read through it carefully it will begin to make sense.

function OnRohanPeasant1Created(self)

    ObjectHideSubObjectPermanently( self, "FORGED_SPEAR", true )

    ObjectHideSubObjectPermanently( self, "SCYTHE", true )

    ObjectHideSubObjectPermanently( self, "PITCHFORK", true )

    ObjectHideSubObjectPermanently( self, "HELMET01", true )

    ObjectHideSubObjectPermanently( self, "HELMET02", true )

    ObjectHideSubObjectPermanently( self, "HELMET03", true )

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

    local helmet    =    GetRandomNumber()
    

    if helmet <= 0.25 then

        ObjectHideSubObjectPermanently( self, "HELMET01", false )

    elseif helmet <= 0.60 then

        ObjectHideSubObjectPermanently( self, "HELMET02", false )

    else

        ObjectHideSubObjectPermanently( self, "HELMET03", false )

    end

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

    local weapon    =    GetRandomNumber()
  

    if weapon <= 0.50 then

        ObjectHideSubObjectPermanently( self, "SCYTHE", false )

    else

        ObjectHideSubObjectPermanently( self, "PITCHFORK", false )

    end

    

end

2.1 The other and much more simple option (but much more limited and tedious in the long run) is to simply create multiple model variations of your unit and define them all as the same unit much like how the mordor orc is.

DefaultModelConditionState

      Model               = MUOrcWar_SKN

      Model               = MUOrcWar_D_SKN  ExtraMesh:Yes

      Model               = MUOrcWar_E_SKN    ExtraMesh:Yes

      Model               = MUOrcWar_F_SKN  ExtraMesh:Yes

      Model               = MUOrcBrute_SKN  ExtraMesh:Yes

    End

                           https://www.twitch.tv/vileartist - Yes shameless self-promotion

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

                            "Old modders never die, they just fade away" ~ Hostile


#3 DaedraWarrior

DaedraWarrior
  • Members
  • 8 posts

Posted 05 July 2020 - 06:35 AM

Thank you for answer, Kwen.
Never knew about LUA scripting option for randomizing textures, but I'll try it. Can you explain what's the problem with randomizing models in ini files? BFME engine has some limitations for it?

Also, it appears that I actually knew how to add new and multiple textures to the models and how to randomize meshes through ini. Most of my problems happened because my asset.dat generated incorrectly so I thought that I missed something in adding new textures and models before I noticed that my asset.dat has incorrect size.



#4 Kwen

Kwen

    Vileartist

  • T3A Staff
  • 4,865 posts
  • Location:Korea I wish
  • Projects:It'sa secreeet
  •  T3A's First N00b
  • Division:BFME
  • Job:T3A Expert
  • Donated

Posted 05 July 2020 - 07:10 PM

The only issue with randomizing models within the code is that you need to manually make every model variation and export them separately. If you only have a handful of variations, it's totally fine! But if you have a number of different subobjects that you'd like to randomize you'll end up with a giant mess of files that you could have avoided by using a script and having everything contained in one mesh.


                           https://www.twitch.tv/vileartist - Yes shameless self-promotion

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

                            "Old modders never die, they just fade away" ~ Hostile





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users