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. 

How to create Properties depending on Settings

Hi there!

I made custom K2Nodes for a Dialogue System and I would like those nodes to have a set of customizable properties, defined by the user in the plugin's settings.

For example, I would like users to be able to go into the Plugin's Settings (in their Project Settings), to add a list of parameters with a Name, a ToolTip, a Class and a Default Value. They could want to add:

  • Character - The character talking - Text - "Narrator"

  • Voice - The voice sound to play - Dialogue Voice - Null

  • etc.

Then, in the Details Panel of the Dialogue nodes they will use in their Blueprints, I would like these properties to show up with editable values for each node.

In some sense, it would look a lot like Blueprint's variable creation where you add a variable, select its type and name, etc. Is that something possible?

Thank you in advance, Bye!

CraftyWeazel

Product Version: UE 4.21
Tags:
more ▼

asked Jan 31 '19 at 11:28 PM in C++ Programming

avatar image

CraftyWeazel
62 5 7 12

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

1 answer: sort voted first

I think it mostly depends n how you store those properties in dialog node... or you didn't thought out about this yet?

You might consider incorporating registering custom UStruct or even incorporate existing blueprint structure asset to set those parameters. And then you can direct that struct directly to property editor (if it possible, but it defiantly should open up more options).UStruct will also help you to set up storage for those parameters.

You can also write down custom UI for some medium struct type https://docs.unrealengine.com/en-us/Programming/Slate/DetailsCustomization

more ▼

answered Jan 31 '19 at 11:50 PM

avatar image

Shadowriver
36.6k 931 169 1111

avatar image CraftyWeazel Jan 31 '19 at 11:59 PM

Thanks for the quick reply!

I'm not restricted on storage methods, I can do whatever is better to achieve what I described. In fact, the custom UStruct solution seems great.

How do I make my custom Struct storage editable by the user in the settings?

I would like him/her to create new fields, give them names, etc.

avatar image Shadowriver Feb 01 '19 at 08:15 AM

Look up Blueprint structure asset as it generates custom ustruct. You might as well just bind blueprint structure asset, with that your users would able to reuse the type in blueprints outside of your plugin

Ironocly, it's stupidly easy on C++ side as user would just make struct and do metadata entry USTRUCT() or use some common base struct, then find UStruct object with it. You might consider that as a extra feature to make your plugin C++ usable.

Or just make UStruct selectable, so both blueprint and C++ structs can be picked

avatar image CraftyWeazel Feb 01 '19 at 03:00 PM

Alright, that's a great idea, thanks!

Then, in my K2Node, how will I tell which kind of struct I need, actually? If I write

 UPROPERTY(EditAnywhere)
 FCustomStruct CustomData;

Then, how do I change FCustomStruct to be the type the user chose in the settings? TSubclassOf won't work with Structs, and even if it did, it would only be a class specifier, not an instance.

(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