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"

Widget communications

Hi community, I try find good solution for next situation: I hase widget "MainState" and "WindowMainState" for example. WindowMainState composed a few "MainState" (strength, dexterity....etc) "MainState" widget has buttons (plus and minus) when player up new level I whant set state, but I can't understand how can I check what plus button player use (strength, dexterity....etc) ?

![alt text][1]

Product Version: UE 4.20
wq.png (525.7 kB)
more ▼

asked Sep 17 '18 at 07:15 PM in Blueprint Scripting

avatar image

34 4 4 12

avatar image ThompsonN13 Sep 17 '18 at 10:12 PM

where are you storing the stats? im assuming that your using a widget for each row as you show in the right picture. if thats the case then you already have the stats and it should be an easy task to change the values. basically you would have all the functionality built into the sub widgets then the only thing you would need to reference the main widget for is to show points remaining to be spent.

avatar image Schepetkov Sep 18 '18 at 06:24 AM

Hi ThompsonN13, thank for answer, my question is not about how change and storing variable. I try explain again: I create widget "MainState" then I create another one "WindowMainState" and manual add 5 "MainState" on this widget, and now I try understated how I will know what plus button players click, if he click on second (it will dexterity). in "MainState" I have simple logic on click event and сall function on my ManitSates component (how I can check what state try change player).

avatar image Everynone Sep 18 '18 at 07:17 AM

Your original message wasn't clear, I would've responded just like ThompsonN13 did.

Now that you've provided more info, here's a solution (one of many):

  • create an enumerator for your stats

  • when you add stat widgets, make sure to set the enumerator

  • create an event dispatcher in the stats widget and have it dispatch the enumerator with a bool (bIncrease)

  • in the listening object responsible for counting, catch the dispatcher and switch on enum

  • use the bool to increase / decreases the stat based on the enum execution

Alternatively, do the counting in the widget itself but this is not really recommended as widgets can be a bit finicky at times.

avatar image Schepetkov Sep 18 '18 at 07:48 AM

Hi Everynone, thank for support.

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

0 answers: sort voted first
Be the first one to answer this question
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