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"

Issue changing between states in Blackboard

Hello! I've been following a tutorial on how to create an AI with vision, running towards the player if it is in sight, but for some reason, I'm unable to change between my two states (AggressiveCombat & Idle). Something does happen though, which makes me even more confused. Here's a video of what happens when it should change states

https://www.youtube.com/watch?v=5fvpWjO-6Ls

Here's a snippet of the blueprint where the state changes occur: alt text

Product Version: UE 4.9
Tags:
statechange.png (136.6 kB)
more ▼

asked Sep 07 '15 at 10:03 AM in Blueprint Scripting

avatar image

Mr-Manly
19 8 8 11

avatar image ambhar Sep 07 '15 at 05:11 PM

I was having the same problem in 4.9 in setting state of player. I switched back to 4.8 and the same blueprints worked correctly.

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

2 answers: sort voted first

From what I can see on the video your problem is that the first task of the selector you're showing there (the one with Vision service) is succeeding it's execution, and since it's parent is a selector it means it just finishes, not executing next child (by design). You just need to structure your BT differently. Is the first task is "state selection" and it always succeeds consider using a sequence, and have the other child be a selector with "idle" and "aggressive" branches.

BTW, a hint here: place the higher priority branch ("aggressive" I presume) on the left, and have it's condition decorator set to Abort both. And leave idle as a condition-less fallback. It's more robust this way :)

Let me know if there's anything unclear.

Cheers,

--mieszko

more ▼

answered Sep 07 '15 at 02:12 PM

avatar image

MieszkoZ STAFF
7.3k 225 57 413

avatar image Mr-Manly Sep 07 '15 at 04:02 PM

Hi Mieszko, do you mean like this?

alt text

Because that doesn't seem to work either :/

likethis.png (250.1 kB)
avatar image MieszkoZ STAFF Sep 07 '15 at 04:04 PM

ok, but how doesn't it work? :) Would you mind recording another video, just from the BT debugger? The previous one was very enlightening.

avatar image Mr-Manly Sep 07 '15 at 04:16 PM

Well, it does exactly the same thing as the previous video. It shows the value of State as "MAX" when the player is not in vision, and it shows as "none" when the player is in vision

I'll do you a better one and send you the BP, since I have been following a tutorial and just can't see what's going wrong there.. 2 sec

avatar image Mr-Manly Sep 07 '15 at 04:27 PM

Keep in mind that I've been following a couple of different tutorials to get to this alt text

therewego.png (732.2 kB)
avatar image MieszkoZ STAFF Sep 07 '15 at 06:44 PM

It seems fine. I strongly encourage you to debug your blueprints in this case, both the Vision service and Set Player Position. Or share your project with me. Or a stripped down version that exhibits the same behavior.

avatar image Mr-Manly Sep 08 '15 at 12:08 AM

Here is a stripped down version with only the needed BP's for it to work.

https://drive.google.com/file/d/0B62a0mseJ9bGTXZMRnRVNko0Zjg/view?usp=sharing

As ambhar wrote, maybe it could be an issue with 4.9, since his problem disappeared when he switched back to 4.8?

avatar image Mr-Manly Sep 08 '15 at 02:19 PM

It actually calms my mind hearing that "it seems fine" from someone who actually knows what they're talking about... I've been combing through the code forever trying to find the issue! :D

avatar image MieszkoZ STAFF Sep 08 '15 at 08:00 PM

So thanks to that repro project of yours I was able to nail it down, and it turns out there's enum-to-byte blueprint conversion issue. I've already filed a ticket for the blueprints team to have a look at it.

The only workaround I was able to find was not to use enums for now. Just use Int or Name keys instead.

I'm terribly sorry, and thank you very much for supplying us with repro project which made finding and reproing this bug a trivial. Thanks!

--mieszko

avatar image Mr-Manly Sep 08 '15 at 08:04 PM

That's both sad and great to hear! Sad that we won't be able to use enums for now, but great that we got to the bottom of the issue :)

avatar image User-1420270633 STAFF Sep 09 '15 at 06:53 PM

Hi Beslind,

We believe we hava fix for this. You can check it out here: b53db70. To be clear, we think this was only occuring with enums that were saved from a 4.9 preview build. Is that possibly the case here? I want to make sure we correctly resolved the issue.

avatar image Mr-Manly Sep 09 '15 at 07:02 PM

Hi Mike :) I was not in a hurry to try 4.9 so i did not update during the previews, but decided to update only efter the official release. The project started as 4.8 and was converted to 4.9 official

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

Usually what I do/What I was taught by the bignames is SetBlackboardKeyAsText

Then you can type in the state using the literalText node.

Let me know if you cant figure that out and I'll dig out some old AI projects. IT looks like it should work though, it could be an error in your logic. Your BTT or whatever your creating has a failure/non failure at the end? Hope this helps

Don't forget to accept an answer that best clears your question up or answers it so when the community finds your question in the future via search/google they know exactly what you did to fix it/get it going.

more ▼

answered Sep 07 '15 at 12:26 PM

avatar image

Nsomnia
1.8k 67 27 137

avatar image Mr-Manly Sep 07 '15 at 12:51 PM

There's a "Set Blackboard Value As String", is that the one you mean? But yeah, I think it'd be easier if you dig up those projects, please and thank you :)

avatar image Mr-Manly Sep 07 '15 at 02:11 PM

It's not a BT Task, but a BT service, so it seems I can't add a "finish execute" at the end.

(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