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"

Communication widget to blueprint

Hey,

I'm trying to use a terminal to control some training targets but after hours trying all I can find online I really can't seem to make it work.

My setup is the following: -A target, with built in script to fall down and raise upon damage/command -A (placeholder) terminal, consisting of just a box and a collision box to determine when player is in range to access it (this here is absolutely not functional but still lets me access the widget) -A widget, displaying atm just three buttons being up (raise the target), down (lower target) and out (exit the terminal).

The player access the terminal by pressing F, which opens the UI. Then the player can press the buttons which will communicate which target to raise/lower (currently only one, for the sake of making this work before applying it to the 20 targets)

My problem comes when I have to communicate from the widget blueprint that the button up or down has been clicked. I know the buttons and event react correctly since I can click exit and the UI does close. I know the communication between the physical terminal and the targets work, as I also made so I can control the target with other keys instead of the UI and it works. The problem really is to pull out of the widget the event that a button has been clicked.

I can't use direct communication because since the widget is not in the map, I can't set which target I want to send the data. Most of the other methods I found are usually between a character and the environment, and as such use the character as target/object, while I don't have any of those. As such I am really lost and have no idea how I am supposed to communicate those very simple bool data.

Product Version: UE 4.16
Tags:
more ▼

asked Sep 07 '18 at 09:29 PM in Blueprint Scripting

avatar image

Alaac
18 1 1 5

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

1 answer: sort voted first

hmmm odd i just submitted an answer but it doesnt show now.

lets try this again. if i read your question right you have a terminal actor, a target actor, and a widget. i guessing that the widget is being created from the terminals script which makes this a pretty simple issue where you just need to have a reference to the targets in the terminal then pass the info on to the widget when its created.

to do this you will need to create a variable array in your terminal which will store the appropriate targets, then you will need to create a variable thats basically the same thing in your widget. then where you create the widget drag off of the return pin and search for set (insert variable name here) to set the array variable thats in the widget. the last thing is to attach the variable from the terminal to the set node which sets the widgets variable value. i show how this looks in the terminal bp in the picture below.

alt text

capture.png (271.1 kB)
more ▼

answered Sep 07 '18 at 10:18 PM

avatar image

ThompsonN13
10.1k 33 10 25

avatar image Alaac Sep 08 '18 at 11:17 PM

Clean and simple, works like a charm.

Thanks for opening my eyes on that, I was so focused on a way out that I forgot I could just make a way in instead!

(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