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. 

Is there a way to call a function from a variable?

I'm making a dialogue system that is entirely customized from the editor, without entering blueprints. So, my designers can drag in an NPC object, set it's mesh and configure the entire dialogue tree from the editor details.

I was just wondering if there was a way to say, make a String Variable the designer can set, that at some point, based on the string variable will call a specific function? I'm trying to make it so that certain dialogue points set off a function that effects another object's dialogue elsewhere.

Product Version: Not Selected
more ▼

asked May 27 '14 at 02:42 PM in Blueprint Scripting

avatar image

193 16 21 22

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

2 answers: sort voted first

You probably just need a way to Switch depending on what the string is.

3 ways that you can try.

Equal (String). As the conversation progresses, this would set booleans which would then cause branches to route your execution flow to the desired outcomes.

Switch on String. I don't know how to use this, but it could offer another option to change your execution flow based on string inputs.

Switch on Enum. This isn't exactly what you asked for, but if you are making a complicated conversation tree I would definitely look into some Enums.

more ▼

answered May 27 '14 at 11:16 PM

avatar image

1.8k 131 68 110

avatar image ProfessionsQuest May 29 '14 at 01:28 PM

That is what I ended up getting to work. Made a function in the game mode that was passed in a string, and depending on the string, calls another string. Thanks for the help! :)

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

Well i cant find any, blueprint does not support funtion pointers which C++ does. But there is example of what you asking for, timers which require function pointer to work use string name in its blieprint bindings, you might play with those, ty setting time to 0 on Set timer and check of its called instantly.

Arternativly you can make main funtion with int argument and reroute funtion depending in int.

more ▼

answered May 27 '14 at 05:18 PM

avatar image

36.6k 931 169 1111

(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