|
Post by projectonegames on Sept 6, 2016 20:01:53 GMT
Is there an elegant way to modify the "lock on" button so the main player can click "lock on" and reuse the AI auto attack scripting? In other words, click lock on and it will auto attack using the primary weapon reusing the AI script? If the opponent dies or you click "lock on" again, it stops the auto fight.
How would you possibly approach this, please?
This is why.... During this auto attack, it would be great if we can add other actions like healing spells and magic attacks in between the auto attacks. I am working on creating this component as a reusable module. Fireball spells, magic missle, offensive and defensive magic spells, healing spells.
Also, is there anyway when you press the "LockOnButton" you can see what you are locking on to? Maybe some way to highlight the lock on target? Or a screen pointer? Or something that shows that you are locked on to a specific target? This is sometimes confusing, because I cannot tell if I am locked or not. And what I am locked on to. With a ranged weapon, this will become more important later.
By the way, your product is really great!!!!
|
|
|
Post by Invector on Sept 7, 2016 12:24:12 GMT
I see and I'm assuming that you want to this for mobile purposes right? On the upcoming update we will have a inventory system that will have 'quick slots' that you can customize with custom attributes, for example in Diablo exists a bottom bar with slots and you can use skills by pressing 1~2~3~4~5, etc.. We will add something like that and you can customize how many slots you need and what they do. I think that this will definitely help you to create this feature. About the highlight on the target, we already developed that and it's on the LockOn Component at the Camera, you can assign a sprite there and it will show up at the target
|
|
|
Post by projectonegames on Sept 7, 2016 14:23:20 GMT
yes, I am adding this for mobile. Thank you. Funny you mentioned the "quick slots". When I integrated your product with inventory pro, they have a feature which allows you to add a skill bar (or it can hold anything really). I am using it to put in such items. In their product, you can configure it and then when you pick up items by collision, it auto adds them to the slot if the items has predetermined attributes. What I like is that their product focuses only on inventory management. I am going to try to integrate their product with your equipment handler, but I understand that this might be changing on your end, so I am waiting to do this. Target highlight: I thought I saw something and could not recall where it resided. Will look for that LockOn component. Thank you! Jeff
|
|
|
Post by projectonegames on Sept 7, 2016 15:38:50 GMT
I posted instructions within the add-on section on how to use this feature to help others. Cheers. Do you possibly have an idea on an elegant way to modify the "lock on" button so the main player can click "lock on" and reuse the AI auto attack scripting? In other words, click lock on and it will auto attack using the primary weapon reusing the AI script?
|
|
|
Post by Invector on Sept 9, 2016 14:25:51 GMT
I posted instructions within the add-on section on how to use this feature to help others. Cheers. Do you possibly have an idea on an elegant way to modify the "lock on" button so the main player can click "lock on" and reuse the AI auto attack scripting? In other words, click lock on and it will auto attack using the primary weapon reusing the AI script? Basically the idea is exactly what you say, adapt the auto attack logic from the AI to the Player, you also need to check the distance of the target otherwise he will keep attacking even if the target is out of range.
|
|
|
Post by projectonegames on Sept 10, 2016 4:40:18 GMT
yes, it actually works just as you describe. Very nice! (Instructions for how to do this at the bottom).
Wait a sec. Maybe there is a simple method. How can I change the attack button so when you press it, the player keeps attacking until you press it again, or you press another button? This would allow you to lock on, auto attack, maintain your distance, and then consider other items in between attacks. Like a defense or spells or other attacks. Is there a way to modify this? I don't see where this can be done.
Note: This is how to reuse the AI Companion within your player. Copy the nav mesh agent, V_AI companion and a sphere sensor from the AI Companion into the 3rdPersonController. Make sure the coordinates are right or reset. Check the settings. For example, target the CompanionAI not Player. Leave these items off in the inspector and then switch them on when the button is pushed. Then shut off the third person controller script. When this happens, the player will follow the companion and will fight.
However, I think this would impact the health and stamina variables, so this would need to be modified. I am guessing I would have to modify the health and stamina variables by cloning the v_AiCompanion script and persisting the original values. Until this, all the other input would be lost until it is switched back, unless other items are changed.
|
|
|
Post by Invector on Sept 11, 2016 12:52:24 GMT
Another way to do it, is to change the animator variable 'trigger' that call the attack animation everytime you press the attack input, to a 'bool' this way you can turn this bool true when press the lock-on input and while is true the char will keep attacking, and when you press it again turn it false and stop attacking.
|
|
|
Post by projectonegames on Sept 15, 2016 4:26:23 GMT
I think this is what you are suggesting: Within animators/parameters, MeleeAttack would become a bool. The under "UI/Mobile Controls/Attack, the Event Trigger would change from the 2 attack button handlers (setdownstate and setupstate) to something else.
Within the script "vThirdPersonController.cs" within "LockOnInput()", right before sending the message to UpdateLockOn, switch the bool. (change on to off OR off to on) ?
|
|
|
Post by Invector on Sept 15, 2016 13:05:22 GMT
Yep, this is pretty much it but the mobile you just need to change the button handler name from RB to RightStickClick (button that lockson)
*it's just an idea (non tested)
|
|