Hi, can someone please tell me how to set this code up in UE4.27. (It was made in UE4.1x something. When I opened the project, I converted to UE4.27, instead of opened as a copy.)
Or tell if it is broken in UE4.27?
The asset comes with a demo map, when you click Play, their widget automatically displays the random name gen. It keeps cycling and I have no control. I looked in the Level BP, but found no trigger code.
I see the Widget, and see Graph tab > Set Name Text (Function). But where/what is calling this function in the Widget > to link it to the other Function code below (FL_NameGen) > to activate/trigger the text change in the widget’s text bar??
I see the Function asset: FL_NameGen. I open it and see F-Get Random Name (which is the first name), and F-Get Random Surname. But where is the code that sends this info to the Widget?? (how do I connect this in my own Widget?)
And where is the function/code that puts the First + Surname together? (I need this code because I want to add 4 name parts, and combine that as the “full name.”
Goal: I want the code for generating a random FULL name (to display on a Widget), that is made from 4 random words chosen 1 each, from 4 different Data Tables (A - D).
So Full name = A(word) + B(word) + C(word) + D(word) = Apple Beef Cat Dog, in that order.
The widget gets created in the LevelBlueprint. The name generation is inside the UserWidget. (Femalenames, MaleNames + Surname => 3 DataTables) You should be able to easily modify it. The names can be imported from a CSV file with dragging and dropping it into the content browser. But they need to have the same structure:
First column: RowName, Second column: MaleName => must match the structure.
Thank you so much for remaking it and uploading a project!
“The widget gets created in the LevelBlueprint” Did you add this yourself? Because when I opened his project (in UE4.27), his Level BP was void of code. Thats why I was confused. Or maybe my UE4.27 opened/converted it wrong?
“3 DataTables” Also my project only showed 1 Structure, even tho there were 3 DataTables… I see your file has 3 Structures. Ty for fixing.
“The names can be imported from a CSV file with dragging and dropping it into the content browser.” Ty for explaining this and showing a picture . I read about CSV files months ago, but forgot what it was called, and the method to get a list file into UE. (You explained it easy; thought I would need a plugin for that.)
What happened to the FL_NameGen Function file? Did you remove the file and absorb the code into the Widget BP? (Wondering if my conversion was wrong, or if you did that.)
Im looking at your code. I’ll see if I can get my application to work, and reply back to choose solution if yes. Thanks again
I created this without downloading the code I just read what you wanted and created that. You can add all your names to one DataTable if you want that, that would be another solution. That there is only one structure is because he uses NAME for all his entries. So when you add the CSV to your project you have to select which structure this CSV should use (for RowName and RowContent). The function is inside the WidgetBP, you could put this inside a FunctionLibrary to access it in another blueprint. Tried to keep it “simple”. I will have a look at the project from your link
Wow lol. You made that from scratch. I appreciate it. You dont need to look at the linked file then (it’s not mine) and didnt seem to work in UE4.27?
But can you help me with my CVS file? Something is wrong with my rows? First time using them. Do I need to type the 0, 1, 2, 3, 4? Do I need to name A as Row? This didnt import.
I copied the SFemaleNames, renamed, and edited it with my variable string = 1Description.
I dragged my CVS file into UE. Selected my Struct = WeaponName1_description.
Your CSV is in the wrong format from the authors post.
In your sheet, Cell a,1 should be blank, and cell b,1 should be MaleName.
Then each row under that should start with a number in a and the name in B.
A1 should be empty, so delete the “Row” and try again. Maybe try to change “1Description” to “Description” also for both structure and CSV. And yes, there have to be numbers from 0-XXX
The file works in 4.27 and I can explain all the implemented functions if you want to.
Ty, I fixed it.
My problem was the program I was using to open/save the CSV file.
It was a CSV file, but I opened in OpenOffice (free), not in Microsoft Office.
Thus it kept asking me how to open/convert it (as a CSV).
There was a check mark for Semicolon selected by default. I need to check “Comma” for UE4.
And I named Row A1 to blank. Now it imports correctly
[Old, solved below:] Why cant I connect this pin? The variable type is different when I change your Node to my Data table. Pin turns Blue instead of Pink.
So I tried to add a new Get Data Table Row Node - off of my Variable. But the out pin is still blue??
Edit: I fixed the pin type by doing the steps in the pic: Had to Right click on the Out pin > Split it (weird terminology from 3 pin nodes ???) > changes it to a different pin type.
[Old, solved below:] Also as I said at the start, I want to combine a full name with word A + B + C + D. (Im not using male or female names - names of weapons.) So I took your code and Im trying to connect them in a line. I thought I could connect each Get Data Table Row - with the Append node, like you did? Ty.
EDIT: GOT IT. Only 2 words were showing, I forgot to Set my extra 5 word-DataTables at part 1 of his code.
Thank you so much for your first post with the complete project file, and commented code sections ! I was able to understand and implement.
[Note: the pic below is not meant to read the code details - it’s too zoomed out - to show the full picture of the code layout of 5 parts. See his project file for the code, then move around blocks like in my pics.]
.
.
Part 3: FYI for anyone new: to activate the Widget, I put the code in my Character BP, and used a keybind (for testing only, not perma method). You can change the activation to your method.
Using the random name generator widget you are able to enter the name of a class group or year group (providing these have been setup) and click “randomise” to automatically select a student at random out of that group.
The widget has been designed to animate a cycle round the names within that class group. This could be used by a staff member at the front of a lesson to pick a random student to answer their question. It helps prevent the same students from being picked to answer questions and opens up the questions to allow for typically quieter more introvert students to be asked a question.
In order to use this widget, drag the widget onto the site form the left hand content tray…
There are no setting sfor this widget. In order to use the widget click the “Save Changes” button to be taken out of edit mode.
When viewing the site you are then able to type in the name of a user group that exists on the platform. This should display any manually created groups and any groups that have been imported from your MIS. Once the desired group appears, single left click to select the group.
You are then able to click randomise to begin the animation to cycle round the names within that class group. After a few seconds a name will be selected at random and shown within the widget with flashing lights around the outside.
You are able to click the randomise button again to select another random user from this group or click the back button arrow to search for another group.