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"

Can I use Blueprints in Widgets?

Dear All, I wish to know if it is possible to use Blueprints in Widgets as well? Like, in the scene I use actor Blueprints that have their variables, functions and so on. Now I'm converting my prototype into a final game logic and I use widgets instead of the original 3D ugly meshes I quickly made to set things up. One of my objects get coloured in respect to its state (using an enum) and I did this with BP of course (as I said). But inside my widgets I don't seem to figure out if I can do that. Thanks in advance.

Product Version: UE 4.12
Tags:
more ▼

asked Jul 10 '16 at 09:39 AM in Blueprint Scripting

avatar image

agiro
95 8 12 18

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

1 answer: sort voted first

Absolutely, if you open up your slate widgets, in the top right you should have 'Designer' highlighted with 'Graph' next to it. Simply select graph and hey presto! BP time!

more ▼

answered Jul 10 '16 at 10:00 AM

avatar image

TechnicallyLew
134 7 3 7

avatar image agiro Jul 10 '16 at 10:12 AM

Thanks for you answer. What I meant is, can I use blueprints as widget elements? So I have images, scale boxes and whatnot on my widget, but I also have a blueprint, that contains an image and has variables and function?

avatar image agiro Jul 10 '16 at 12:02 PM

Sod it, could manage with my experience in C. Got my code ugly with creating arrays for all the fields, but so is life.

avatar image Prithvi Singh Jul 10 '16 at 01:52 PM

hi again @agiro ,

what are you basically trying to do? spawn widgets like actors? have widgets properties like actors(one actor is duplicated and inherits it's features?)

yes you can do anything you want like that , they can be spawned variable changed on run time ,functions , macros ,event dispatchers and specially have touch events drag events.

avatar image agiro Jul 10 '16 at 01:57 PM

greetings again, a regular saint you are :D It went like this: I have some parts that have their own characteristics, so to speak and the game decides this and that based on their properties. Now, I have 5 of the exact same part, the player has to deal with them one after the other, typical array situation. I used actors before. Now I would need to have a "MechParts" named BP as an object on my widget, so it has a different BP than the widget BP. The result would be to have on the canvas e.g. a couple of images, 2 buttons and 5 MechParts blueprint. Is this doable, or rather use the old school way I mentioned?

avatar image Prithvi Singh Jul 10 '16 at 02:05 PM

@agiro i am having a few questions

what are mechparts exactly? what are they supposed to do in levels?

you said it's different from widget blueprint, is it another widget or an actor?

avatar image agiro Jul 10 '16 at 02:19 PM

Some "teeth" that changes their position continuosly and block the way of the sphere. They move up, down, up, down etc. Another actor they were on my original scene, when I was prototyping. I would need an actor BP yes.

avatar image Prithvi Singh Jul 10 '16 at 02:30 PM

this is possible but as i mentioned in other question hit events and overlap events are not possible in umg, if your actor(teeth) is in level and sphere an actor in level as well (can be sprites or 3d) will be possible .

as for deciding what to do when , level blueprint is nice as it can cast to anything in level even if it's an widget.

avatar image Prithvi Singh Jul 10 '16 at 02:32 PM

actors can collide with each other not umg's

avatar image Prithvi Singh Jul 10 '16 at 02:06 PM

do mech parts have same BP and are to be created/spawned 5 times?

avatar image Prithvi Singh Jul 10 '16 at 02:06 PM

what do you want arrays to do here?

avatar image agiro Jul 10 '16 at 02:39 PM

I have everything on widgets. Those teeth are basically gates, trying to block the player out. The sphere, that is more of a circle, has to be clicked when facing the right direction. I had one actor array that contained the teeth. Now I have separate array for each property. Again, no collision. It can detect by position if it succeeded, if not, it sets the game back.

avatar image Prithvi Singh Jul 10 '16 at 03:47 PM

@agiro awesome idea , even low phones can run it with nice graphics,

it's all possible , so what's the problem here? you want to check if they have that property and fire event s,functions? it's easy just check if enums are equal or not , i never go for Enums until someone tells me to, just get the level name and use save games or set properties in widgets or actors you want and check them as required ,

where are you stuck?

avatar image agiro Jul 10 '16 at 03:51 PM

Nowhere, just wanted to make my BP code more simple. I had one array and access all from that, now I have 4 arrays for the properties and access from those. This way it is more difficoult to edit later on, but all in all I can get it done :D

avatar image Prithvi Singh Jul 10 '16 at 04:10 PM

i am not sure if you need four properties to compare(4 arrays , 4 different properties ,right?) "for each loop" is nice here for arrays as your game seems interesting, and making interesting games is the part where work is required. what you are comparing is up to you and you want to do and want player to do is also up to you

see these links please ,they are based on arrays:
check the links related to ARRAYS AND STRUCTURES official docs

google search of video tuts on simple array functions

just keep testing game on devices to see whats supported and whats not(keep the power of 2 [256*256 ,512 *512 etc] in mind)

since the game is umg based i would like to tell you an advantage of "touch" node , it's only for actors but by casting to widgets it can get them to function well and provides where screen is being touched. (touch node gets screen location so conversion of screen to world is not much required i guess)

avatar image agiro Jul 10 '16 at 04:16 PM

I'm bookmarking this page, it contains loads of useful info :D Thanks for your help once again!

avatar image Prithvi Singh Jul 10 '16 at 04:17 PM

you are welcome once again :D
happy developing!

(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