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"

How can I count how many times an event happens in a child blueprint?

Hi, so I've been working on trying to get a fail state for my gameplay, which revolves around herding A.I. Player hits the A.I until they leave, but runs the risk of killing them. There is one parent A.I and the rest are children, as they all use the same behaviour tree, but doing it this way I've run into trouble trying to count each instance of death in the A.I. I want the player to fail the game if they end up killing all the A.I in the level (so when all A.I health reaches 0).

alt text

This was the attempt I tried in the level blueprint, then used a print string to see if it worked. I either got it to count once, then it reset to zero, or it counted each A.I as 1 individually.

I can't use destroy actor, as it is already used to create the winning state (when A.I reach the right destination), and I want their bodies to remain in the level anyway. Any ideas? Or would it be easier to put all the A.I onto separate behaviour trees/blueprints and do it that way?

Product Version: UE 4.8
countattempt.png (68.7 kB)
more ▼

asked Mar 17 '16 at 01:09 PM in Blueprint Scripting

avatar image

3 3 4

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

1 answer: sort voted first

Put a Print String node into the "botDad_character" cast failed. If this system isnt keeping track of your "dead number" variable its because the cast is either failing or your "dead" bool is never true.

more ▼

answered Aug 12 '16 at 11:22 PM

avatar image

94 8 7 12

(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