Wrong Weapon Collection for Item on Runtime

Eyeshock

Member
Hello everyone,

I'm trying to go through the documentation and videos and just assign the bow according to the video. However, when I assign the bow, it appears in the item object, but on runtime it sorta just falls apart.

I have removed 1st person from scene setup and character setup. It 'kinda' worked when I had that, but not really, and I don't need FPP anyway.

See screenshots: the item collection changes for the items on runtime. Also, it seems to create two instances of the item in the scene view. The item shows up on T-Pose before runtime, but vanishes and doesn't appear in the characters hands on runtime. Otherwise, I can walk around and it doesn't crash.

Please advise; thanks. I walked away from Opsive after buying it a few months ago for similar frustrations. Honestly, I'm finding it very frustrating that following both the documentation and the video has bugs.
 

Attachments

  • itemassignbug2.PNG
    itemassignbug2.PNG
    96.7 KB · Views: 2
  • itemassignbug3.PNG
    itemassignbug3.PNG
    94.1 KB · Views: 2
  • itemassignbug4.PNG
    itemassignbug4.PNG
    89.8 KB · Views: 3
For the bow have you gone through this tutorial?


This was made with the current version of the controller so you should be able to follow it step by step. The docs don't go through the details of setting it up so for the bow I recommend the videos.

Looking at the error though, on the bow Item that you have shown in itemassignbug3 it is using the Bow ItemType, but you'll want to use the MyBow ItemType.
 
For the bow have you gone through this tutorial?


This was made with the current version of the controller so you should be able to follow it step by step. The docs don't go through the details of setting it up so for the bow I recommend the videos.

Looking at the error though, on the bow Item that you have shown in itemassignbug3 it is using the Bow ItemType, but you'll want to use the MyBow ItemType.

I know that; that's the issue.

If you look at the previous screenshot, there's a MyBow in WeaponsCollection that I made as part of the tutorial.

And in the Items object on the model BEFORE runtime, it shows MyBow as weapon type.

But when I hit play, and check the item under the hands, it has been changed to BowType from DemoCollection.

Yes, I followed the video. I've tried both documentation AND the video. :p
 
See screenshots below. BEFORE runtime and AFTER runtime.
 

Attachments

  • itemassignbug7.PNG
    itemassignbug7.PNG
    110.6 KB · Views: 3
  • itemassignbug8.PNG
    itemassignbug8.PNG
    136.1 KB · Views: 3
That's strange. I haven't seen the definition switch before. Can you insert a breakpoint within the Item.ItemDefinition property to see what is causing the switch? I'm not sure how it would even know the ItemType from a different ItemCollection.
 
As I was! Ok. It's not runtime. But it's definitely happening after assigning from the Item Manager. That can't be right...

The item type under Items is correct outside of the mesh, but under the left arm object, the type is wrong.

Do I have a non-unique name somewhere? I'm straight up copying exactly what he does in the video...

Also, is it supposed to be assigning MyBowAgain TWICE once under the mesh before runtime and once under items? When I go to alter the item, which instantiation do I alter?
 

Attachments

  • itemassignbug9.PNG
    itemassignbug9.PNG
    267.3 KB · Views: 3
Those videos don't use the demo ItemCollection at all so before starting you should be able to completely remove it from your project. So you were assigning the Item Definition at runtime?

Do I have a non-unique name somewhere? I'm straight up copying exactly what he does in the video...
The name has to be unique within the Item Collection, but it won't let you create a new Item Type with a duplicate name.

Also, is it supposed to be assigning MyBowAgain TWICE once under the mesh before runtime and once under items? When I go to alter the item, which instantiation do I alter?
Good catch - no, the Item component should only exist under Character/Items. It should not be under the mesh. Have you gotten the assault rifle working? I'm curious if it's something specific to the bow.
 
Hey Justin' I think I figured out that issue; I was using a Prefab from your demo for Bow, and the prefab came with excess scripts. So that issue has been resolved. It didn't fix the errors though to change it to the Bow model and try again. It still doesn't show up at all and gives a Null error.

So i went back, and started a new project, and went through EVERY VIDEO up to the Third Party Item Creation Video and just did the Assault Rifle. I'm definitely seeing two instances of the items before I press play in the Hierarchy for the Nolan model. This is confusing too because if you go to Remove Existing Item in the Item Manager, you will also see two assault rifles there.

Pressing play with the Assault Rifle isn't creating any errors though. At least up to this point. That said, if I wanted to alter this item before runtime ,it's not clear which instance I would alter or if it should be showing up twice at all.

And just to reiterate: this is before run time.
 

Attachments

  • Inkeditemassignbug10_LI.jpg
    Inkeditemassignbug10_LI.jpg
    913.7 KB · Views: 1
Ahh. Now I'm seeing why there was two and why I was confused about which one to alter. The prefab for Bow I was adding had all those configuration scripts on it as well, so when I look at them in the inspector, they were very similar. So I just made the mistake of using the prefab.

I still haven't got the Bow to work with my own project. I'll press on in the video with this new project and post here if I encounter similar issues.

Thanks for your attention.
 
Ok. Sorry to have wasted your time. After going through the tutorials again and being VERY VERY careful about which elements I dragged, I was able to get the bow to work fine with my custom mesh. Please excuse my impatience.

I only have one last question: it seemed like with my first few times through the tutorials, the Item Set Manager Script would create an item set for each item I added as part of the default loadout. I also see that happening in the tutorials.

However, that's NOT happening on my end. I continued on to the melee tutorial and had to add the Sword Item Set manually in Item Set Manager to add the demo included melee state IK weights. While in the video tutorial, the Sword Set was already in the Item Set Manager.

So my question simply is: should the Item Manager be creating those Item Sets automatically on Build Item from the Item Manager?

Thanks again
 
Glad you got it figured out! I'll add an error checker to that portion of the manager to prevent future problems.

hould the Item Manager be creating those Item Sets automatically on Build Item from the Item Manager?
Yes, as long as you don't already have an ItemState that has the corresponding ItemType that is being added. If for example you have a completely empty ItemSetManager then it will add the new ItemType.
 
Top