Jump to content

How to Use FStextureSwitch2 and FSfuelSwitch


ErevanGaming

Recommended Posts

Hi everybody =)

Thanks to @dboi88 for converting z_thing's boxes to DDS format, I've been using them on my sandbox save. =)

Now am trying out on using FStextureSwitch2 and FSfuelSwitch to switch between... boxes models to use with different types of resources, but only got the FSfuelSwitch to work. ="> Am using a known mod's config as basis. Is this just a matter of getting the from MM syntax or editing the MU files is required?

Again, this is only for my personal testing, learning/tinkering purposes. ="> all rights are reserved by their respective owners. =)

 

Regards

Link to comment
Share on other sites

8 minutes ago, ErevanGaming said:

Hi everybody =)

Thanks to @dboi88 for converting z_thing's boxes to DDS format, I've been using them on my sandbox save. =)

Now am trying out on using FStextureSwitch2 and FSfuelSwitch to switch between... boxes models to use with different types of resources, but only got the FSfuelSwitch to work. ="> Am using a known mod's config as basis. Is this just a matter of getting the from MM syntax or editing the MU files is required?

Again, this is only for my personal testing, learning/tinkering purposes. ="> all rights are reserved by their respective owners. =)

 

Regards

I should be able to help you get this working aswell! I did some switchable kontainers for the MKX/KPBS integration pack using firespitter.

y4ypGTj.gif

Now this took my a LOOOOONG time to work out.

There were two things i was doing wrong. You need to refer to the base texture directly, (normally if the texture is in the same location as the model it will just pick it up, for some reason this didn't work for me and i had to expressly refer to the location, i.e. CoyoteSpaceIndustries/Parts/Assets/texture)

Secondly you need to ensure you are referring to the mesh name within the .mu which could be ANYTHING. If you post your config i'll take a look and see if i can see were you are going wrong. Also this is a great help. 

https://docs.google.com/document/d/1iD52DfHft04Hb48TEhF5a4n5JOc8efUevdg5Y_QPICQ/edit

Link to comment
Share on other sites

Hiya, took a while for me to work it out too,  however it's become pretty standard fare for most things i do now, here's  the MM patch I currently use ,

@PART[TruckIntake]:NEEDS[Firespitter]
{
	MODULE
	{
		 name = FStextureSwitch2
		moduleID = 0

		objectNames = IntakeActive // this is as mentioned is the name of the mesh not the part, if you are working on someone elses parts and dont know the mesh name, open the .mu in notepad and  usually the mesh name is the third or fourth human readable block of characters

		textureNames = SM_AFVs/Parts/OSHCab/OshKabS;SM_AFVs/Parts/OSHCab/OshKabDC;;SM_AFVs/Parts/OSHCab/OshKabOD;SM_AFVs/Parts/OSHCab/OshKabUC           // this the texture path and in this case translates as foldername/foldername/foldername/texture
		textureDisplayNames = Stock;Des;Grn;Urb  // this is the list of names shown in the gui 
		nextButtonText = Next Color
		prevButtonText = Previous Color
		statusText = Current Color
		showPreviousButton = true
		updateSymmetry = true
		showInfo = false
		debugMode = false
		showListButton = false
	}
}

 

Link to comment
Share on other sites

23 minutes ago, SpannerMonkey(smce) said:

objectNames = IntakeActive // this is as mentioned is the name of the mesh not the part, if you are working on someone elses parts and dont know the mesh name, open the .mu in notepad and usually the mesh name is the third or fourth human readable block of characters

Thank you,i was struggling so much and this was the only thing i was missing.
Also i don't specify all of the textures path and just use this:

textureRootFolder = //path to the textures
textureNames = texturname1;texturname2;texturname3 //...
textureDisplayNames = LF; LFO; Mono //

example of my config:

Spoiler

MODULE
 {
 name = FStextureSwitch2
 nextButtonText = Next Type 
 prevButtonText = Prev Type
 textureNames = lf;lfo;rcs
 objectNames = MMI - External Gas Tank
 //mapNames = tank_NRM;tank_NRM;tank_NRM;
 useFuelSwitchModule = true
 fuelTankSetups = 0;1;2
 textureDisplayNames = LF; LFO; Mono
 textureRootFolder = sebi/parts/MMItank/texture/
 //mapIsNormal = true
 showPreviousButton = false
 moduleID = 0
 showInfo = false
 }

MODULE
 {
 name = FSfuelSwitch
 resourceNames = LiquidFuel;LiquidFuel,Oxidizer;MonoPropellant
 resourceAmounts = 200; 90,110; 200
 basePartMass = 0.1
 tankMass = 0; 0; 0
 tankCost = 0; 0; 0
 hasGUI = false
 availableInFlight = false
 availableInEditor = true
 }

 

Edited by sebi.zzr
Link to comment
Share on other sites

Here's my custom CFG file =">

Spoiler

PART
{
    // --- general parameters ---
    name = B_long
    module = Part
    author = z

    // --- asset parameters ---
    MODEL
    {
        model = z_thing/Parts/Utility/Boxes/B_white_long
        texture = z_thing/Parts/Utility/Boxes/B_white_long
    }
    scale = 1
    rescaleFactor = 1.5

    // --- node definitions ---
    node_attach = 0.0, -0.60, 0.0 , 0.0, 0.0, 1.0
   
    
    // --- editor parameters ---
    TechRequired = largeVolumeContainment
    entryCost = 42000
    cost = 680
    category = FuelTank
    subcategory = 0
    title = Tripple size Box 
    manufacturer = Sklifosovsky Labs
    description = White striped box to store any kind of matter. Write there something about content if you decide to put something in it

    // attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
    attachRules = 1,1,1,1,0
    

       
        // --- standard part parameters ---
    mass = 2
    dragModelType = default
    maximum_drag = 0.2
    minimum_drag = 0.3
    angularDrag = 2
    crashTolerance = 20
    maxTemp = 3400
    fuelCrossFeed = True
    breakingForce = 1215
    breakingTorque = 1215

    MODULE
    {
        name = FStextureSwitch2
        textureNames = z_thing/Parts/Utility/Boxes/B_white_long;z_thing/Parts/Utility/Boxes/B_black_long;z_thing/Parts/Utility/Boxes/B_blue_long;z_thing/Parts/Utility/Boxes/B_green_long;z_thing/Parts/Utility/Boxes/B_red_long;z_thing/Parts/Utility/Boxes/B_white_long;z_thing/Parts/Utility/Boxes/B_black_long;z_thing/Parts/Utility/Boxes/B_blue_long;z_thing/Parts/Utility/Boxes/B_green_long;z_thing/Parts/Utility/Boxes/B_red_long;z_thing/Parts/Utility/Boxes/B_white_long;z_thing/Parts/Utility/Boxes/B_black_long;z_thing/Parts/Utility/Boxes/B_blue_long;z_thing/Parts/Utility/Boxes/B_green_long;z_thing/Parts/Utility/Boxes/B_red_long;z_thing/Parts/Utility/Boxes/B_white_long;z_thing/Parts/Utility/Boxes/B_black_long;z_thing/Parts/Utility/Boxes/B_blue_long;z_thing/Parts/Utility/Boxes/B_green_long;z_thing/Parts/Utility/Boxes/B_red_long;z_thing/Parts/Utility/Boxes/B_white_long;z_thing/Parts/Utility/Boxes/B_black_long;z_thing/Parts/Utility/Boxes/B_blue_long
        objectNames = white_long;black_long;blue_long;green_long;red_long;white_long;black_long;blue_long;green_long;red_long;white_long;black_long;blue_long;green_long;red_long;white_long;black_long;blue_long;green_long;red_long;white_long;black_long
        textureDisplayNames = MetallicOre;Uraninite;Substrate;Minerals;Karbonite;Commodities;MaterialKits;Metals;Polymers;Supplies;Ore;Machinery;Recyclables;SpecializedParts;Fertilizer;Hydrates;Gypsum;Dirt;Silicates;Silicon;RefinedExotics;ColonySupplies;Organics
        useFuelSwitchModule = true
        fuelTankSetups = 0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;
        repaintableEVA = true
        nextButtonText = Next Cargo
        prevButtonText = Previous Cargo
        moduleID = 2
    }

    MODULE
    {
        name = FSfuelSwitch
        resourceNames = MetallicOre;Uraninite;Substrate;Minerals;Karbonite;ExoticMinerals,RareMetals;MaterialKits;Metals;Polymers;Supplies;Ore;Machinery;Recyclables;SpecializedParts;Fertilizer;Hydrates;Gypsum;Dirt;Silicates;Silicon;RefinedExotics;ColonySupplies;Organics
        resourceAmounts = 16000;16000;16000;16000;16000;8000,8000;16000;16000;16000;16000;3200;16000;16000;16000;16000;16000;16000;16000;16000;16000;16000;16000;16000
        initialResourceAmounts = 0;0;0;0;0;0,0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
        tankCost = 28160;11200;4800;12800;5120;2400000;32000;227840;128000;40000;64;252800;112000;512000;32000;8000;160;4800;160;320;4000000;240000;8000
        basePartMass = 2
        tankMass = 0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
        hasGUI = false
    }

    MODULE
    {
        name = USI_ModuleResourceWarehouse
    }
    MODULE
    {
        name = USI_ModuleRecycleBin
    }    
    
    
}

I kinda combined z's B_white_long.cfg with... MKS' Kontainer_02.cfg in my amateurish attempt =">

Link to comment
Share on other sites

Hi everybody,

Still haven't figured out the fxtextureswitch2 on the custom part am trying to work in my personal career save. =D =">

To move things along, I group the resources and paired them with a specific z_box container to skip the texture switching/selecting thing. Applied the same approach to "z's" circular hub parts which is going well. =D

Thanks again for your comments and tips! =)

 

Regards

 

Link to comment
Share on other sites

7 hours ago, dboi88 said:

You should only have one object name. The name of the mesh you are switching.

HI thats not quite true.  Why? Well take for example a stock cargo bay that you want to give a texture switch, IIRC a stock cargo bay is four individual meshes that form the floor , main hull and doors. In order for a switch to work  you'll need to list ALL the mesh components in the model you want to change the texture on . 

There is no way to select individual meshes in sph or vab, so failing to list all the mesh parts will leave items uncolored with no way of applying a texture.

You can also use many individual texture switch modules to do the same job, but that's only really useful (imo) when dealing with mesh parts that have different textures than the main mesh ,  so that instead of switching the whole model texture you can for example  , in the case of the cargo bay have a stock color hull and black doors

On 18/03/2017 at 3:54 AM, ErevanGaming said:

Here's my custom CFG file =">

  Hide contents

 

        textureNames = z_thing/Parts/Utility/Boxes/B_white_long;z_thing/Parts/Utility/Boxes/B_black_long;z_thing/Parts/Utility/Boxes/B_blue_long;z_thing/Parts/Utility/Boxes/B_green_long;z_thing/Parts/Utility/Boxes/B_red_long;z_thing/Parts/Utility/Boxes/B_white_long;z_thing/Parts/Utility/Boxes/B_black_long;z_thing/Parts/Utility/Boxes/B_blue_long;z_thing/Parts/Utility/Boxes/B_green_long;z_thing/Parts/Utility/Boxes/B_red_long;z_thing/Parts/Utility/Boxes/B_white_long;z_thing/Parts/Utility/Boxes/B_black_long;z_thing/Parts/Utility/Boxes/B_blue_long;z_thing/Parts/Utility/Boxes/B_green_long;z_thing/Parts/Utility/Boxes/B_red_long;z_thing/Parts/Utility/Boxes/B_white_long;z_thing/Parts/Utility/Boxes/B_black_long;z_thing/Parts/Utility/Boxes/B_blue_long;z_thing/Parts/Utility/Boxes/B_green_long;z_thing/Parts/Utility/Boxes/B_red_long;z_thing/Parts/Utility/Boxes/B_white_long;z_thing/Parts/Utility/Boxes/B_black_long;z_thing/Parts/Utility/Boxes/B_blue_long
        objectNames = white_long;black_long;blue_long;green_long;red_long;white_long;black_long;blue_long;green_long;red_long;white_long;black_long;blue_long;green_long;red_long;white_long;black_long;blue_long;green_long;red_long;white_long;black_long 

 

I kinda combined z's B_white_long.cfg with... MKS' Kontainer_02.cfg in my amateurish attempt =">

ALL  those underscores,  you know that they cause problems in parts names?  The underscore is translated as a period (.) and MM doesn't seem to play nice when underscores are present .  Have you got a simple switch to work?  Id use a stock structural panel and do a couple of textures and try that, it seems that you're making life difficult for yourself trying it on a complex part first. Crack the easy one and everything becomes easy

AND the object names need to be the name of the MESH not the part unless the mesh is called white_long;black_long;blue_long;green_long;red_long;white_long;black_long;blue_long;green_long;red_long

And you have the division between names wrong it needs to be like this YourMod/Parts/Folder/texture;   YourMod/etc   commas or periods will not work and it will not read the textures or parts names correctly

Link to comment
Share on other sites

Just now, ErevanGaming said:

if I don't ask questions, I'd never learn how things are supposed to be done =D

No worries, as far as I'm concerned if you don't know that answer, asking the question is the best way to find out,  we all started somewhere as new mod makers, and it's one little hobby that throws up continuous new questions even for people who've been doing it for years

When it comes to the part names and underscores, if you are reworking a mod that is already in circulation, and are worried about breaking craft already built , you can change everything in the cfg except for the title, changing the title will break craft.

Link to comment
Share on other sites

hi @SpannerMonkey(smce)

7 minutes ago, SpannerMonkey(smce) said:

No worries, as far as I'm concerned if you don't know that answer, asking the question is the best way to find out,  we all started somewhere as new mod makers, and it's one little hobby that throws up continuous new questions even for people who've been doing it for years

When it comes to the part names and underscores, if you are reworking a mod that is already in circulation, and are worried about breaking craft already built , you can change everything in the cfg except for the title, changing the title will break craft.

Will do that =) I already planned on restarting a new career save since @dboi88 was kind enough to convert the TGA files to DDS =) and I really want to use the parts made by z_thing =">

 

Cheers and thanks again! =)

Link to comment
Share on other sites

  • 3 months later...

@dboi88                                  What is wrong with my mm config to switch stock and nothke's textures on the large 3.75 m fuel tank using fs texture switch, because the game crashes with them.

@SpannerMonkey(smce)

Spoiler

@PART[Size3LargeTank]:NEEDS[Firespitter]
{
    MODULE
    {
        name = FStextureSwitch2
        moduleID = 1

        objectNames = Size3LargeTank

        textureNames = Squad/Parts/FuelTank/Size3Tanks/FueltTanks_cm.dds;nothke-2015_SLS_CDR_textures/FuelTank/Size3LargeTank/FueltTanks_cm.dds

        textureDisplayNames = Pre-2015;Post-2015;

        nextButtonText = Next Colour
        prevButtonText = Previous Colour

        statusText = Current Colour
        showPreviousButton = true
        updateSymmetry = true
        showInfo = false
        debugMode = false
        showListButton = false
    }        
}

 

                                                    

Thanks, Bottle Rocketeer 500

Link to comment
Share on other sites

4 minutes ago, Bottle Rocketeer 500 said:

 objectNames = Size3LargeTank

Are you sure that is the correct object name,?  switch on debug in the module and click the print objects button that will output a list of the parts object names in the Alt F12 window,  and just place the name you find listed there in your patch

Link to comment
Share on other sites

@SpannerMonkey(smce) I used both Object Inspector and went into Blender. I also looked at the mu file through Notepad (like dboi88 suggested).

EDIT: I fixed the problem.  

My problems were:

1. Mod incompatibilities

2. I used a filetype at the end of the file

                                                                  **WORKING CODE**

Spoiler

@PART[Size3LargeTank]:NEEDS[Firespitter]
{
    MODULE
    {
        name = FStextureSwitch2
        moduleID = 1

        objectNames = Size3LargeTank

        textureNames = Squad/Parts/FuelTank/Size3Tanks/FueltTanks_cm;nothke-2015_SLS_CDR_textures/FuelTank/Size3LargeTank/FueltTanks_cm

        textureDisplayNames = Pre-2015;Post-2015;

        nextButtonText = Next Colour
        prevButtonText = Previous Colour

        statusText = Current Colour
        showPreviousButton = true
        updateSymmetry = true
        showInfo = false
        debugMode = true
        showListButton = false
    }        
}

 

 

Edited by Bottle Rocketeer 500
Problem fixed
Link to comment
Share on other sites

Hi do not put the file extension eg.dds in the texture name slot

Squad/Parts/FuelTank/Size3Tanks/FueltTanks_cm.dds;
should be 
Squad/Parts/FuelTank/Size3Tanks/FueltTanks_cm;

also ;  at the end of a line may cause the patch to expect another item

 

textureDisplayNames = Pre-2015;Post-2015 >>;<< this should not be here

What exactly does the log error say?

Link to comment
Share on other sites

@SpannerMonkey(smce)

@dboi88                                            I'm trying to add texture switch to the large boosters (SRBs,Kickbacks) The buttons show up, but don't work. That also happens to the adapter. What am I doing wrong?

Spoiler

@PART[Size3LargeTank]:NEEDS[Firespitter]
{
	MODULE
	{
		name = FStextureSwitch2
		moduleID = 1

		objectNames = Size3LargeTank

		textureNames = Squad/Parts/FuelTank/Size3Tanks/FueltTanks_cm;nothke-2015_SLS_CDR_textures/FuelTank/Size3LargeTank/FueltTanks_cm

		textureDisplayNames = Pre-2015;Post-2015;

		nextButtonText = Next Colour
		prevButtonText = Previous Colour

		statusText = Current Colour
		showPreviousButton = true
		updateSymmetry = true
		showInfo = false
		debugMode = false
		showListButton = false
	}		
}
@PART[Size3MediumTank]:NEEDS[Firespitter]
{
	MODULE
	{
		name = FStextureSwitch2
		moduleID = 2

		objectNames = Size3MediumTank

		textureNames = Squad/Parts/FuelTank/Size3Tanks/FueltTanks_cm;nothke-2015_SLS_CDR_textures/FuelTank/Size3MediumTank/FueltTanks_cm

		textureDisplayNames = Pre-2015;Post-2015

		nextButtonText = Next Colour
		prevButtonText = Previous Colour

		statusText = Current Colour
		showPreviousButton = true
		updateSymmetry = true
		showInfo = false
		debugMode = false
		showListButton = false
	}		
}


@PART[Size3to2Adapter]:NEEDS[Firespitter]
{
	MODULE
	{
		name = FStextureSwitch2
		moduleID = 3

		objectNames = Size3to2Adapter

		textureNames = Squad/Parts/Structural/Size3To2Adapter/decoupler_and_adapter_cm
;nothke-2015_SLS_CDR_textures/Structural/Size3To2Adapter/decoupler_and_adapter_cm

		textureDisplayNames = Pre-2015;Post-2015

		nextButtonText = Next Colour
		prevButtonText = Previous Colour

		statusText = Current Colour
		showPreviousButton = true
		updateSymmetry = true
		showInfo = false
		debugMode = false
		showListButton = false
	}		
}
@PART[MassiveBooster]:NEEDS[Firespitter]
{
	MODULE
	{
		name = FStextureSwitch2
		moduleID = 4

		objectNames = S1 SRB-KD25k "Kickback" Solid Fuel Booster

		textureNames = Squad/Parts/Engine/MassiveSRB/solid_booster_cm;nothke-2015_SLS_CDR_textures/Engine/MassiveSRB/solid_booster_cm

		textureDisplayNames = Pre-2015;Post-2015;

		nextButtonText = Next Colour
		prevButtonText = Previous Colour

		statusText = Current Colour
		showPreviousButton = true
		updateSymmetry = true
		showInfo = false
		debugMode = false
		showListButton = false
	}		
}

 

 

Edited by Bottle Rocketeer 500
Link to comment
Share on other sites

  • 3 years later...

I'm trying to get an old procedural glass wing mod to work. The problem I have is I can't switch the textures.

 

Spoiler

@PART[ProceduralglassMK2]:AFTER[Firespitter][ProceduralDynamics]:NEEDS[Firespitter][ProceduralDynamics]
{

    MODULE
    {
    name = FStextureSwitch2
    moduleID = 0    
    textureRootFolder = E4Mods/NOtintpak/
    textureNames = clear;bluetint;darktint

    objectNames = Cube
    
    textureDisplayNames = clear;blue;dark

    nextButtonText = Next Texture
    prevButtonText = Previous Texture
    statusText = Current Colour
    switchableInFlight = true

    
    }
}

MM is giving the error as "Cannot parse node name as tag list: encountered opening bracket in trailer" but I'm not sure if that's correct. Any help would be amazing, thank you!

Link to comment
Share on other sites

Your issue is this: (I think this is what that first line should be)

@PART[ProceduralglassMK2]:AFTER[Firespitter,ProceduralDynamics]

Also, pretty sure you dont need the :NEEDS[]... the :AFTER[] *implies* :NEEDS

Also note the comma... you need that as an "AND"

Edited by Stone Blue
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...