Download

String Append Add (+)

Hey everyone,

So i’m working a lot with Append right now, and i noticed that if i need to put together 5+ things i need to have a lot of Append strings.

Now is it possible to add a (+) to it so you can add entry’s like you can in Sequence? And then output the whole of it?
I think this is just a minor improvement but could possible give a better workflow for those who use it a lot?

Kind regards,
Celeste

I dont think that is possible with the way the “Add pin” functionality is currently implemented.
When I asked about a multiple subtraction node, I learned that it only supports commutative operations.
String concatenation is however noncommuntative.

I guess the easiest way would be implementing the node in C++.
Shouldnt be too complicated, especially as no real complicated logic is involved :slight_smile:

The default append node is a pain in the butt for sure :stuck_out_tongue:

There is already a function with “Add pin +” in Rama’s victory plugin though (Append Multiple) :slight_smile:

I’d highly recommend using the Format node for display or debugging. It lets you write things like “The health of {Name} is {Health}”, and it will create pins named Health and Name for you.

In general, Text pins and nodes are localizable while String pins are not.

Cheers,
Michael Noland

The format text node is not really nice to use, since for almost anything there is not direct “convert to text” node, only convert to string. So if I want to output a vector, with the “append string” node I just drag and drop the vector onto the string input field and UE4 automatically creates the “vector to string” node and connects everything correctly. With the “format text” node I would first need to manually convert the vector to a string and then the string to text. It’s just a lot more clicking, and for debugging some values just too much work.

Are you sure?

Just try my friend, just try :smiley:

KismetStringLibrary.h


/** @return the result string concatenated */
UFUNCTION(BlueprintPure, meta = (FriendlyName = "Append String", CompactNodeTitle = "Append", Keywords = "String append", CommutativeAssociativeBinaryOperator = "true"), Category = "Utilities|Strings")
        static FString AppendString(FString A, FString B);

**KismetStringLibrary.cpp

**


FString UKismetStringLibrary::AppendString(FString A, FString B)
{
    return A + B;
}

I don’t know hot to create a pull request, maybe someone can do it for me

Well, that why I wrote “…is currently implemented.” :slight_smile:

I havent made custom nodes yet. I tried it following a aturorial, but the node si not showing up in the menu (even with context unchecked) .

Are you sure your node will always and in every case, reliably, concatenate them in the right order?
Im not sure, but I dont think they would have named the flag “CommutativeAssociativeBinaryOperator” if it would be meaningless or not fitting :slight_smile:
Could be that they concatenate correct in some/most cases, but that this is not really guaranteed…