Jump to content

Concatenate string and variable in Module Manager ?


FooPhoenix

Recommended Posts

Hi :)

I'm trying to concatenate a string with the value of a variable with MM, but noting seems to works and I find nothing on Internet. I need your help :confused:

 

Here an example of what I'm trying :

// First try :

@PART[*]:HAS[#category[FuelTank],@RESOURCE[LiquidFuel],!RESOURCE[Oxidizer]]:LAST[MyModExample]
{
    @description ^= :$:<br><color="green">It's an example with LiquidFuel #$/RESOURCE[LiquidFuel]/maxAmount$</color>:
}

It doesn't work. MM just don't evaluate the #$/RESOURCE[LiquidFuel]/maxAmount$ and just put it as normal text...

 

 

// This one change nothing, same result

@PART[*]:HAS[#category[FuelTank],@RESOURCE[LiquidFuel],!RESOURCE[Oxidizer]]:LAST[MyModExample]
{
    @description ^= :$:<br><color="green">It's an example with LiquidFuel :
    @description ^= :$:#$/RESOURCE[LiquidFuel]/maxAmount$:
    @description ^= :$:</color>:
}


// This one change nothing, same result too...

@PART[*]:HAS[#category[FuelTank],@RESOURCE[LiquidFuel],!RESOURCE[Oxidizer]]:LAST[MyModExample]
{
    var = #$/RESOURCE[LiquidFuel]/maxAmount$

    @description ^= :$:<br><color="green">It's an example with LiquidFuel :
    @description ^= :$:#$var$:
    @description ^= :$:</color>:
}


// This one doesn't work, throw an error...

@PART[*]:HAS[#category[FuelTank],@RESOURCE[LiquidFuel],!RESOURCE[Oxidizer]]:LAST[MyModExample]
{
    @description ^= :$:<br><color="green">It's an example with LiquidFuel :
    @description += #$/RESOURCE[LiquidFuel]/maxAmount$
    @description ^= :$:</color>:
}

 

Anyone know how to concatenate a string with a value ? :confused:
So much thanks in advance :)

Link to comment
Share on other sites

Variables don't work in regex replacements.  Fortunately you don't really need regex since you're just appending to the end

@description = #$description$<br><color="green">It's an example with LiquidFuel $/RESOURCE[LiquidFuel]/maxAmount$</color>

 

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