x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Functions with variable number of input pins

Is there a way to create a function node that has the "add pin" functionality on it? I want to create a function that concatenates n number of strings, and inside the function is an array that gets looped through. The array has the "add pin" function, is there a way I can expose that, rather than having a set number of inputs and therefore set array size?

Product Version: Not Selected
Tags:
more ▼

asked Apr 20 '15 at 12:43 PM in Blueprint Scripting

avatar image

PersnicketyGareth
25 10 12 17

avatar image Narghile Apr 20 '15 at 01:05 PM

yeah, give me a min.

Narg

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

The way to do it in Blueprint is to take an array-of-type, rather than the actual type. Then the caller can pass in an array of whatever size he/she wants. This is a work-around, not exactly what you want.

The way to do it "for real" is to write C++. Grepping for "Add pin" in the GitHub source finds a good example:

Engine/Source/Editor/GraphEditor/Private/KismetNodes/SGraphNodeSwitchStatement.cpp

which uses an API documented in a header file:

Engine/Source/Editor/GraphEditor/Public/SGraphNode.h

The interesting functions are Create{Input,Output}SideAddButton(), IsAddPiButtonVisible(), and OnAddPin().

more ▼

answered Apr 20 '15 at 04:37 PM

avatar image

jwatte
1.3k 48 41 88

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Make function

Click on input and look in details panel

alt text

Then add inputs

alt text

From outside

alt text

Narg

capture.jpg (45.8 kB)
capture.jpg (40.6 kB)
capture.jpg (21.2 kB)
more ▼

answered Apr 20 '15 at 01:12 PM

avatar image

Narghile
1.7k 74 38 110

avatar image PersnicketyGareth Apr 20 '15 at 04:11 PM

Thank you, but this is not what I meant. There is no "Add Pin" on the outside. I would like it so the function accepts any number of arguments, and this number is defined at the instance of its use.

avatar image Narghile Apr 20 '15 at 04:36 PM

Make a macro to do what you want.

Look at existing macros, and make one that matches what you want.

Narg

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question