|
Post by wesleywh on Jan 14, 2019 21:20:06 GMT
Has anyone noticed that the vItemManagerUtilities sets a new persistant listener to a SetLeftWeapon/SetRightWeapon every time you select the tpc controller? (Or is it just me?) (Fix is to also check for typeof(PUN_ShooterManager) in the relevant places where the listeners are added.) Not sure what you mean by this... I will have a look at the vItemManager component in play mode and probably get a better idea. Then i will try to implement your fix.
|
|
|
Post by rasto61 on Jan 17, 2019 20:42:50 GMT
Has anyone noticed that the vItemManagerUtilities sets a new persistant listener to a SetLeftWeapon/SetRightWeapon every time you select the tpc controller? (Or is it just me?) (Fix is to also check for typeof(PUN_ShooterManager) in the relevant places where the listeners are added.) Not sure what you mean by this... I will have a look at the vItemManager component in play mode and probably get a better idea. Then i will try to implement your fix. That every time you select the TPC controller gameobject, calls to the SetLeft/RightWeapon of the PUN_ShooterManager are added to the ItemManager's OnInstantiateEquipment events
|
|
|
Post by wesleywh on Jan 19, 2019 18:29:57 GMT
For those of you following my github repo you will have noticed that I released v0.7.8 a while ago. That was a massive revamp on the network manager. This opens a lot more possibilities of what you can do with it now. I added a ton of options for custom events that you can do. I also included a new and improved version of the UI. It looks a lot nicer and implements a lobby system that you can use. Very easy stuff.
Next I just released v0.7.9. This almost gets the left weapon equip working. You can equip them but not un-equip them. This is because I don't know where the ondestroy left weapon function is called in invector so I can't call the PUN version of it. So if anyone has any ideas where the on destroy left weapon might be called please let met know! Its important to know that there is a OnDestroyWeapon in the vShooterManager component but that actually does not get called when removing a left hand weapon.
As always report any errors that you may fine.
|
|
|
Post by ibuckly on Jan 20, 2019 2:10:54 GMT
I'm using your 0.67 release but the enemy doesn't take any damage from bullets. only from hitting. can you help me with this one?
|
|
|
Post by wesleywh on Jan 20, 2019 4:04:26 GMT
I actually haven't worked on anything related to the AI. I'm also assuming that you're trying to implement networking for AI damage. Have a look at the "ApplyDamage" function in the SyncPlayer. That's what is making it so other players can damage each other. You will need to implement something similar for the AI. So add a component that implements something similar to the "ApplyDamage" for the AI.
It's interesting to me though that you say melee damage is sent but not bullets. The damage for melee must be based on collision logic only. The shooter damage must be using raycasts for AI, that's probably the missing link here.
Just implement something that when the AI takes damage from any source he syncs it across the network just like "ApplyDamage" PunRpc does in the "SyncPlayer" component.
|
|
|
Post by ibuckly on Jan 21, 2019 4:30:18 GMT
I found the solution. just needed to select the "enemy" tag. Btw, I had a really annoying problem finding the solution for the DamageReceiver. for those who have the same problem. The DamageReceiver can't use override because it's a public partial class. To fix this problem you have to combine the vIAttackReceiver and vIDamageReceiver into one class and change the public partial class into public class. After this, you have to change "private vIHealthController healthController" into "public vIHealthController healthController" this was the solution for me.
|
|
|
Post by ibuckly on Jan 21, 2019 4:37:11 GMT
Have you already found the the solution for the weapons? Because the other player doesn't carry a weapon even if he does on his screen. Maybe you already made a new update for this. But it caused me a huge problem when I updated invector 1.2.3, so i won't take the risk to update it again to 1.3. I changed a lot of the scripts. that's the reason why and since your updates are only working for invector 1.3 and above, you will tell me what you changed in your code, so I can change it on the existed scripts? I'm using your 0.67 release
|
|
|
Post by wesleywh on Jan 22, 2019 2:03:25 GMT
I am pretty sure that v0.6.7 syncs weapons. It sounds to me a lot like you didn't supply a weapons list to the component that needs it in the Network Manager gameObject.
I had to make a new editor function to find all weapon prefabs with either the "vMeleeWeapon" or "vShooterWeapon" component and override it with the PUN version. The functions that I override are the Shoot action, reload, and empty click sounds I believe.... Then I added some PUN functions in the "PUN_SyncPlayer" component on the player to receive things sent from those components. It was quite a bit honestly. You can look at the "Convert Prefab" script in the "Editor" folder inside the "Scripts" folder of my github repo to see what that does to get a better idea.
|
|
|
Post by ibuckly on Jan 23, 2019 3:00:42 GMT
I just upgraded to Shooter Template 1.3.0 and updated also your lastest release. Well I got 2 errors.
Assets\PUNMultiplayerInvectorAddon\PUN_Scripts\PUN_NetworkManager.cs(319,26): error CS0115: 'PUN_NetworkManager.OnPlayerEnteredRoom(Player)': no suitable method found to override
Assets\PUNMultiplayerInvectorAddon\PUN_Scripts\PUN_NetworkManager.cs(324,26): error CS0115: 'PUN_NetworkManager.OnPlayerLeftRoom(Player)': no suitable method found to override
I tried to change 'PUN_NetworkManager.OnPlayerLeftRoom(Player)' to 'PUN_NetworkManager.OnPlayerLeftRoom(Photon.Realtime.Player)' as I did in the privious version. But now I get these errors
Assets\PUNMultiplayerInvectorAddon\PUN_Scripts\PUN_NetworkManager.cs(321,72): error CS1503: Argument 1: cannot convert from 'Photon.Realtime.Player' to 'Player'
Assets\PUNMultiplayerInvectorAddon\PUN_Scripts\PUN_NetworkManager.cs(326,69): error CS1503: Argument 1: cannot convert from 'Photon.Realtime.Player' to 'Player'
Hope you can help me with these?
|
|
|
Post by wesleywh on Jan 23, 2019 19:52:32 GMT
I will need to create a new project and re-run through the setup process again to see what errors might be occurring. I will do that when I get home today and let you know what I find.
|
|
|
Post by wesleywh on Jan 24, 2019 1:28:17 GMT
Well I setup a brand new project and it worked flawlessly for me. Here is what I did.
Invector Version: 1.3.0 Unity Version: 2018.3.0f2 Multiplayer Addon Version: v0.7.9
NOTE: Tested this with the "Shooter_DemoScene" scene in the invector package.
1. Imported Shooter Package 2. Import PUN2 3. Setup PUN2 4. Import "Modify Scripts" from Multiplayer Addon 5. Ran "Invector > Multiplayer > Convert Script To Multiplayer" 6. Imported the rest of the Multiplayer Addon Package 7. Ran through steps 1 - 4 Under Invector > Multiplayer - Manually fixed missing unity events from "PUN_Generic Action" - Manually applied changes from these steps (1 - 4) to prefabs 8. Did the "(Optional) Setup Example UI" step 9. Deleted Legacy "PUN_Lobby UI" COmponent from "Network Manager" Gameobject 10. Applied items component to "PUN_Item Manager" 11. Disable all players in the scene 12. Built project 13. Ran built project and unity editor together 14. Played around, climbed, crouched, punched, picked up weapons, switched weapons, shot each other.
I never encountered any of the errors that you are describing. Can you describe the steps that you wen through to reproduce your errors?
|
|
|
Post by Frosted Brain on Jan 24, 2019 18:36:44 GMT
Well I setup a brand new project and it worked flawlessly for me. Here is what I did. Invector Version: 1.3.0 Unity Version: 2018.3.0f2 Multiplayer Addon Version: v0.7.9 NOTE: Tested this with the "Shooter_DemoScene" scene in the invector package. 1. Imported Shooter Package 2. Import PUN2 3. Setup PUN2 4. Import "Modify Scripts" from Multiplayer Addon 5. Ran "Invector > Multiplayer > Convert Script To Multiplayer" 6. Imported the rest of the Multiplayer Addon Package 7. Ran through steps 1 - 4 Under Invector > Multiplayer - Manually fixed missing unity events from "PUN_Generic Action" - Manually applied changes from these steps (1 - 4) to prefabs 8. Did the "(Optional) Setup Example UI" step 9. Deleted Legacy "PUN_Lobby UI" COmponent from "Network Manager" Gameobject 10. Applied items component to "PUN_Item Manager" 11. Disable all players in the scene 12. Built project 13. Ran built project and unity editor together 14. Played around, climbed, crouched, punched, picked up weapons, switched weapons, shot each other. I never encountered any of the errors that you are describing. Can you describe the steps that you wen through to reproduce your errors? Awesome. Would this work with mobile controls on an android build?
|
|
|
Post by wesleywh on Jan 24, 2019 19:03:13 GMT
I would imagine so. I haven't ever tested it out. Give it a go and let me know what you find.
|
|
|
Post by ibuckly on Jan 25, 2019 1:02:09 GMT
Well I setup a brand new project and it worked flawlessly for me. Here is what I did. Invector Version: 1.3.0 Unity Version: 2018.3.0f2 Multiplayer Addon Version: v0.7.9 NOTE: Tested this with the "Shooter_DemoScene" scene in the invector package. 1. Imported Shooter Package 2. Import PUN2 3. Setup PUN2 4. Import "Modify Scripts" from Multiplayer Addon 5. Ran "Invector > Multiplayer > Convert Script To Multiplayer" 6. Imported the rest of the Multiplayer Addon Package 7. Ran through steps 1 - 4 Under Invector > Multiplayer - Manually fixed missing unity events from "PUN_Generic Action" - Manually applied changes from these steps (1 - 4) to prefabs 8. Did the "(Optional) Setup Example UI" step 9. Deleted Legacy "PUN_Lobby UI" COmponent from "Network Manager" Gameobject 10. Applied items component to "PUN_Item Manager" 11. Disable all players in the scene 12. Built project 13. Ran built project and unity editor together 14. Played around, climbed, crouched, punched, picked up weapons, switched weapons, shot each other. I never encountered any of the errors that you are describing. Can you describe the steps that you wen through to reproduce your errors? I did exact the same steps as you did, but the weapon didn't show up. I converted the weapon prefab to multiplayer (step 4) but it still doesn't show up. I Added the weapon in the vShooterMelee_ItemListData and attached the list to PUN_ItemManager. But still nothing. It drives me crazy. I can see the weapon only in the players screen not in the opponents screen.
|
|
|
Post by wesleywh on Jan 25, 2019 15:34:41 GMT
Ah I see now.
This happens with the machine gun prefab in the demo scene. This has to do with the PUN_ItemManager not being able to find your weapon. Have a look at that script to understand things a bit more. Basically when you pick up a weapon in your view it grabs the weapon name that your attempting to pickup and sends that name over the network. Then the PUN_ItemManager receives that name and does a lookup. If it cant find the name for whatever reason it wont make that weapon appear over the network.
Simple fix is to simply rename your weapon and try again. The more complicated fix is to find a way to send the weapon id, instead of the name, over the network.
|
|