|
Post by nfighter on Oct 6, 2018 14:32:23 GMT
And I just found that ammo mechanics didn't work for me. My gun firing only because of starting ammo settings on weapon prefab.
edit: Do I need something else except the equal AmmoID on ammo and weapon?
|
|
|
Post by nfighter on Oct 6, 2018 14:37:13 GMT
The values in the Inventory Pro editor are quaternion values. So when you place the item in the hand and rotate it as you want it don't copy the values from the inspector rotation, instead change the inspector to debug mode so it shows you quaternion rotation, and copy those values (x,y,z,w). But I already changed it so that you can use the 'Position Now' and this will be done for you. I'll update the package later. How is the weapon loaded when you start play? Is it loaded using Inventory Pro's save system, or did you add a collection auto populator to the character collection? Cool, thanks for the Position Now! I suppose it's Inventory Pro's save system. I just pick up the stuff, exit the scene and have a Saved Collection message on console. So it's all there when I start the scene once again
|
|
|
Post by rasto61 on Oct 6, 2018 15:37:23 GMT
And I just found that ammo mechanics didn't work for me. My gun firing only because of starting ammo settings on weapon prefab. edit: Do I need something else except the equal AmmoID on ammo and weapon? Do you have the max stack size set one the ammo item (greater than 1, can just set to 999)? One ammo item in inventory pro means 1 bullet.
|
|
|
Post by nfighter on Oct 6, 2018 15:39:58 GMT
Going further and implementing a bow. Is there convenient way to add a LeftHand_Shooter type? I'm following the same steps as for pistol, but it doesn't work for left hand.
Thanks for your effort! Sorry for spamming this topic.
|
|
|
Post by rasto61 on Oct 6, 2018 15:54:37 GMT
The values in the Inventory Pro editor are quaternion values. So when you place the item in the hand and rotate it as you want it don't copy the values from the inspector rotation, instead change the inspector to debug mode so it shows you quaternion rotation, and copy those values (x,y,z,w). But I already changed it so that you can use the 'Position Now' and this will be done for you. I'll update the package later. How is the weapon loaded when you start play? Is it loaded using Inventory Pro's save system, or did you add a collection auto populator to the character collection? Cool, thanks for the Position Now! I suppose it's Inventory Pro's save system. I just pick up the stuff, exit the scene and have a Saved Collection message on console. So it's all there when I start the scene once again That's related to the Inventory Pro save system. It loads the item back into the character collection, but doesn't equip it automatically, since that requires to 'Use' the item. I'm using my own save system so I will deal with this later on for my use case. But I can probably add a saver that does this for you.
|
|
|
Post by nfighter on Oct 6, 2018 16:00:45 GMT
Going further and implementing a bow. Is there convenient way to add a LeftHand_Shooter type? I'm following the same steps as for pistol, but it doesn't work for left hand. Thanks for your effort! Sorry for spamming this topic. I had just a plenty of ammo objects in inventory. Now I turn the stacking on and they got stucked, but it didn't change a lot. That's how it works: 1. I start a scene, and my vAmmoManager_InventoryPro show Ammo size: 02. I picked up an ammo, and manager switch to Ammo size :1, showing my Ammo Name, AmmoID and Count: 0 Changing this count manually in inspector didn't do anything. Instead, manual changing the ammo directly on Weapon prefab (currently equipped) gives me ability to shoot. After each shoot the amount ammo on weapon prefab going down. It does not have any correlation with numbers on vAmmoManager_InventoryPro or inventory
|
|
|
Post by nfighter on Oct 6, 2018 16:08:37 GMT
I'm using my own save system so I will deal with this later on for my use case. But I can probably add a saver that does this for you. Oh, thanks you! Don't worry, I'll be tweaking this a lot with Playmaker and EasySave later, so I'll change it anyway. For now I just trying to understand what am I dealing with and how it works natively.
|
|
|
Post by rasto61 on Oct 6, 2018 17:59:15 GMT
Going further and implementing a bow. Is there convenient way to add a LeftHand_Shooter type? I'm following the same steps as for pistol, but it doesn't work for left hand. Thanks for your effort! Sorry for spamming this topic. I had just a plenty of ammo objects in inventory. Now I turn the stacking on and they got stucked, but it didn't change a lot. That's how it works: 1. I start a scene, and my vAmmoManager_InventoryPro show Ammo size: 02. I picked up an ammo, and manager switch to Ammo size :1, showing my Ammo Name, AmmoID and Count: 0 Changing this count manually in inspector didn't do anything. Instead, manual changing the ammo directly on Weapon prefab (currently equipped) gives me ability to shoot. After each shoot the amount ammo on weapon prefab going down. It does not have any correlation with numbers on vAmmoManager_InventoryPro or inventory The vAmmoManager_InventoryPro doesn't show how much ammo you actually have. Its taken from the inventory. Also changing the ammo directly on the ammo manager does nothing, as it does not add the ammo to inventory pro. The ammo is added through inventory pro items. Try to add the ShooterDisplayWeapon_Standalone to the scene and check the ammo count when you shoot.
|
|
|
Post by nfighter on Oct 6, 2018 18:10:54 GMT
Try to add the ShooterDisplayWeapon_Standalone to the scene and check the ammo count when you shoot. It shows zero, nevertheless I have a bunch of ammo in inventory. But I can increase the amount directly on a weapon and it will show the new amount. So, the ShooterDisplayWeapon_Standalone definitely works.
|
|
|
Post by rasto61 on Oct 6, 2018 18:39:26 GMT
Try to add the ShooterDisplayWeapon_Standalone to the scene and check the ammo count when you shoot. It shows zero, nevertheless I have a bunch of ammo in inventory. But I can increase the amount directly on a weapon and it will show the new amount. So, the ShooterDisplayWeapon_Standalone definitely works. And inventory pro shows the correct amount of ammo? How do you have the ammo prefab setup?
|
|
|
Post by nfighter on Oct 6, 2018 19:04:54 GMT
And inventory pro shows the correct amount of ammo? How do you have the ammo prefab setup? IP show just how much this unusable items I have in inventory. It does not have any relationship with shooting. here is my ammo setup and here is ammoinventory script
|
|
|
Post by rasto61 on Oct 6, 2018 19:26:48 GMT
That's ok. You can ignore the AmmoManager, its important what Inventory Pro has. Try to add auto collection populator to your collection that adds the ammo. And then shoot until the weapon is empty and then reload. Does it reload? That would mean it works. (Then try, can you do the same when you pickup the item?)
|
|
|
Post by nfighter on Oct 6, 2018 20:43:20 GMT
That's ok. You can ignore the AmmoManager, its important what Inventory Pro has. Try to add auto collection populator to your collection that adds the ammo. And then shoot until the weapon is empty and then reload. Does it reload? That would mean it works. (Then try, can you do the same when you pickup the item?) ok, I see where the problems can be... First of all - I can't add ammo via populator. I got some error about missing the collider, but it was only once... I can't replicate that error. Second - I can't add any objects to inventory via populator (even the pretty default test TrashCube). I can pick them up from the ground, but not from the component at scene start. Third - now, I got 3 NullReferenceException errors on scene start all the time. Even the DemoScene from InventoryPro start with this errors. So, something gone very bad after I tried to use populator... UPD. I cleaned up everything and made fresh iPro reinstall. Populating via component still didn't work, so it might be a problem on this side. I'll contact the DevDog guys and will be back! NullReferenceException: (null)
UnityEditor.SerializedObject..ctor (UnityEngine.Object[] objs, UnityEngine.Object context) (at C:/buildslave/unity/build/Editor/Mono/SerializedObject.cs:26)
UnityEditor.Editor.GetSerializedObjectInternal () (at C:/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:523)
UnityEditor.Editor.get_serializedObject () (at C:/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:440)
Devdog.InventoryPro.Editors.InventoryEditorBase.OnEnable () (at Assets/Devdog/InventoryPro/Scripts/Other/Editor/InventoryEditorBase.cs:18)
Devdog.InventoryPro.Editors.InventoryItemBaseEditor.OnEnable () (at Assets/Devdog/InventoryPro/Scripts/Items/Editor/InventoryItemBaseEditor.cs:47)
Devdog.InventoryPro.Editors.EquippableInventoryItemEditor.OnEnable () (at Assets/Devdog/InventoryPro/Scripts/Items/Editor/EquippableInventoryItemEditor.cs:29)
|
|
|
Post by rasto61 on Oct 7, 2018 5:30:43 GMT
I think that erorr you posted you just need to restart the unity editor. I get something similar sometimes, its something in Inventory Pro when you delete items from the database I think. Can you enter play?
|
|
|
Post by nfighter on Oct 7, 2018 11:49:32 GMT
I think that erorr you posted you just need to restart the unity editor. I get something similar sometimes, its something in Inventory Pro when you delete items from the database I think. Can you enter play? ok, I rebuild my scene with the most default settings and I have no errors. (Except I still can't use populator. I saw a lot of guys with the similar issues on the DevDog discord, so I suppose it's a problem on the populator side).I have working Pistol and not working ammo. I can set ammo amount directly on weapon prefab (without having any ammo in inventory), and it will shoot until zero. I can pick up the ammo item from the ground but it have no influence on weapon at all. So, I can't shoot and can't reload. PS. Anyway, I think I could write a custom ammo manager to solve this issue. But I need your help with a Bow equip to left hand. Is it possible to add a LeftHand_Shooter equipment, or how it should be solved?
|
|