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"

Character Item Drop System Only Works On Last Sequence

I was creating an item drop system (not the most efficient way) and for some reason, "Uncommon Drop" (or the first "Then" Statement) does not drop even though I used the same exact code for each "Then" besides the chance to drop (I change this using, "Random Boolean By Weight.) Does anybody know why this is or can someone give me a more efficient way of doing this?

To make this less confusing: Uncommon Drop isn't dropping even though the code is exactly the same besides the chance to drop. Why? alt text

Product Version: UE 4.16
more ▼

asked Jul 03 '17 at 01:28 PM in Blueprint Scripting

avatar image

5 2 5

avatar image senrgames.dev Jul 03 '17 at 01:41 PM

I should also mention that "Uncommon Drop" will actually appear on the screen, it's just the item that isn't working. I've tested some of my suspicions and nothing seems to be working...

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

1 answer: sort voted first

You add a Component to self. And then Destroy self. What is there to not understand? After you call Destroy dont expect any Code that follows to work. Your then2 should never execute since you Destroy your Actor regardless if the bool is true or false including the Component you added.

more ▼

answered Jul 03 '17 at 04:08 PM

avatar image

7k 143 28 172

avatar image senrgames.dev Jul 03 '17 at 04:33 PM

Like I stated already, Then2 does in fact execute... I specifically said that Then1 works and everything else is functional.

avatar image Nachtmahr Jul 03 '17 at 05:04 PM

Cant be working as it should. You literally Destroy the Actor that holds that Component. And I said Then 1/2 should not execute since its unsafe once you flagging the Actor for Destruction (consider it gone). It still can Execute and you probably managed to Bug your Code. Since it can´t attach to your Actor anymore it probably attaches itself to World. And indeed it does ;P

Asside from that you use Actors World Transform as Relative input. Should be simply 0,0,0 Location since its relative.


avatar image senrgames.dev Jul 03 '17 at 05:25 PM

I probably should've stated that I am very new to UE4. I did suspect it had something to do with DestroyActor but didn't know what it was attaching to. Thanks for clarifying, so to fix this I do what you did in that picture? And for future reference, any advice for bug fixing or how to find them?

avatar image Nachtmahr Jul 03 '17 at 05:59 PM

Spawn a Actor and add a Mesh Component to the Spawned Actor. Should be a Item class you created with functionality in place resolving around Items. A Mesh alone won´t do anything.

Destroy your Actor if you are done with everything. Should be the very last thing you do (can be on multiple places). Instead of Sequence use the False output of the Branch node if you dont want to drop Multiple Items.

avatar image senrgames.dev Jul 03 '17 at 06:05 PM

Thank you for the quick replies. I will test this when I get back home. I'll check this as the answer because now I understand what you mean. For those who want to know what the code looks like in blueprint, I will be updating.

avatar image senrgames.dev Jul 04 '17 at 12:12 AM

It works!!! The only thing that I still don't know how to do is spawning the items where the actor died. First of all, it's spawning too high, and second, not even at the actors location. Otherwise it works, do you know how to fix the actor spawn issue?

Somewhat working code: alt text

Issue I would like to fix: alt text

avatar image senrgames.dev Jul 04 '17 at 12:13 AM

uhh wrong screen shot for first image... oh and I forgot to mention that the character does not die all the time.

alt text

avatar image senrgames.dev Jul 04 '17 at 03:24 AM

I tried creating an ArrowComponent and giving a location directly under the character and instead of spawning at the ActorTransform, I told the items to spawn at the ArrowComponent. This approach for some reason does not seem to work either... alt text

avatar image senrgames.dev Jul 04 '17 at 05:02 PM

Figured it out thanks!

(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