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"

HUD Not displaying correct value?!

Hey, so I have been trying to make a score HUD that displays the Round you are on and the amount of kills you have had however it seems to just be giving me 0.

I have two variables in a blueprint called "zombiesAlive" and "zombiesforRound".

zombiesAlive - How many zombies are alive at the current time, is -1 when you kill one in blueprint BP_Enemy (Refrence from BP_Enemy to spawnVolume.

zombiesforRound - How many zombies should be spawned per round (roundNumber 10 (Round 1 10 = 10, so spawn 10 zombies).

So, I tried to make my widget display the value's of these integers/variable's however that does not work out. It just says the round number and amount of kills = 0.

There are no error's however. In the image below you can see the spawnVolume blueprint reference.

Any help is appreciated.

alt text

Product Version: UE 4.10
Tags:
more ▼

asked Jun 14 '16 at 11:15 PM in Blueprint Scripting

avatar image

ABkayCkay
5 2 6 8

avatar image Vaei Jun 15 '16 at 07:02 AM

You need to ensure that everything is valid before being concerned about the variable, it seems you're just assuming the way you've added it worked.

Add an IsValid node to make sure that SpawnBlueprint2 is valid, and if it is then print it's object name.

Print your variables on tick from inside your SpawnBlueprint2 to make sure they aren't actually 0.

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

2 answers: sort voted first

Is your Spawn Blueprint 2 reference being set somewhere in this bp? If not that could be the reason for returning a 0 value. Otherwise there might be a hick up in this Spawn bp, the value is not being altered correctly. I was wondering, if this is a widget bp and you've made the Spawn bp reference editable, how are you selecting the bp in question in the editor?

Hope it helped :) good luck

more ▼

answered Jun 15 '16 at 12:07 AM

avatar image

obj
66 3 1 4

avatar image ABkayCkay Jun 15 '16 at 12:25 AM

So yes the image you see is a widget event graph binding. This image: Is the spawnVolume blueprint I am trying to reference.

alt text

Then it get's the two variables from that blueprint but says they are 0 in this widget.

It is not being "Set" in the widget, I am unaware how to do so when it comes to setting a blueprint within a widget?

However, where I create the widget (in BP_Soldier), it added a "Spawn Blueprint 2" input. So I referenced spawnVolume in "BP_Soldier" and added it to the input.

alt text

However it still does not seem to be working. :/ All a bit confusing but hopefully that makes sense.

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

Hi, so the PrintString is displayed correctly? If the binding function gets called, and the PrintString shows the correct value, did you check the size of the Textbox if the first digit might be cut off? If the PrintString does not get called at all then the binding might be broken somehow. Perhaps it helps if you remove the binding and the function and bind it again. I had the same issue as far as i remember. After some renamings I guess. I think rebinding solved it.

more ▼

answered Jun 15 '16 at 12:11 AM

avatar image

Marooney
896 36 8 38

avatar image ABkayCkay Jun 15 '16 at 12:17 AM

No, Print string is being ran however it is spamming "0" when it should be 1. As soon as the level starts, it spawns 10 ai's and then sets it to round 1.

The round number, ai counter and other variables work fully in the blueprint they are in. (SpawnVolume Blueprint).

So it is being executed, however it is not getting the correct variable value in this widget.

(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