staalo18 Posted February 15, 2023 Share Posted February 15, 2023 Seems like an easy-to-answer question, but I haven't figured it out: I have added a Shout Package to a ReferenceAlias ("Alias_1"), and I want the Shout to be targeted at the ReferenceAlias' current combat target. What I did so far is to set the package's Shout target to another ReferenceAlias ("Alias_2"), and synchronize "Alias_2" with the combat target of "Alias_1" via script. The downside is that this synchronization can fail. I can synchronize "Alias_2" just before the package starts. But in case "Alias_1" switches the combat target while the Shout package is running, this is not reflected in the Shout's combat target. And I haven't found a way to detect a combat target switch via script (there seems no event catching it). So I cannot even stop the package in that case. I believe this is the cause of some issues with my package, and I would like to find a clean solution for this. Any help is much appreciated! Link to comment Share on other sites More sharing options...
Sphered Posted February 16, 2023 Share Posted February 16, 2023 IMO this isnt best solved at the package level. The key here, is to give them the shout as one of their built in capabilities, and tailor it in a way they will want to use it. Put another way, use the system, dont fight against it. They will want to use it, if it meets certain criteria. Like if it does x more damage than anything else they can do at given time, etc. Shouts have cooldowns you can set to any amount, so its the perfect candidate here for this approach so that you avoid over-usage And dont worry about the word level. No need to assign a word or teach a word to a npc. Just the shout, and if it seems to help, the enable shout perk. Though I dont recall ever needing to give anyone that Link to comment Share on other sites More sharing options...
staalo18 Posted February 17, 2023 Author Share Posted February 17, 2023 Thanks, but in my case I need to use a package. The package is triggered via user control. The ReferenceAlias (a dragon) shouts when the user commands him to attack, via pressing a key. Link to comment Share on other sites More sharing options...
Sphered Posted February 17, 2023 Share Posted February 17, 2023 What I would probably do in your situation, is a fake shout. Not worry with a pack or his abilities. Instead use AnimEvents of Shout start and release, then a script cast for whatever breath or spell, from the dragon to his target Tested since I have a drake AI module I mess with sometimes. Works incredibly well. Dont actually need a combat target technically but you can point to them if you want. Breath has a decent collision area Event OnKeyDown(Int Code) If !Utility.IsInMenuMode() && Code == WhateverBindYouUse Actor ComTar = Drake.GetCombatTarget() If ComTar as Bool; && DistanceChecksEtcAsWanted() Debug.SendAnimationEvent(Drake,"ShoutStart") Utility.Wait(0.5) Debug.SendAnimationEvent(Drake,"ShoutRelease") (Game.GetForm(0x90355) as Spell).Cast(Drake,ComTar) EndIf EndIf EndEvent Link to comment Share on other sites More sharing options...
maxarturo Posted February 18, 2023 Share Posted February 18, 2023 Utilize the 'Quest Scene' tool. Link to comment Share on other sites More sharing options...
staalo18 Posted February 18, 2023 Author Share Posted February 18, 2023 Thanks, these are two good suggestions, I will try them both out. I actually had planned to use the AnimationEvent approach anyways for some other controls anyways. But I somehow had shied away from it for the shout case. Maybe because I thought that a package how it _should_ be done... Link to comment Share on other sites More sharing options...
Sphered Posted February 18, 2023 Share Posted February 18, 2023 Max dude why would we want to start a scene every time he shouts OP I hear ya on the package aspect. That is ideal when practical but this is definitely one of those situations (you wanting synced precision without delays) where you cant rely on a package stack to handle this well I also suspect you might encounter a snag with breath duration, if you ever want one longer than a usual blast. His mouth will close after a moment, so if you want it to remain open longer, you might have to explore some graph data or another workaround for that component Link to comment Share on other sites More sharing options...
maxarturo Posted February 18, 2023 Share Posted February 18, 2023 I suggested the OP to use the 'Quest Scene' tool because from his post I suspect that he has a controlled fight scene inside a quest with 2 npcs, he is not doing it randomly. 'Quest Scenes' are used for the majority of this kind of applications in game, if done correctly they are reliable and fast. Plus they automaticaly solve the direction in which the actor will cast the shout or spell, it will always target the actor the 'quest scene' dectates. Well... at least is faster than having a 'cast magic' package in the npc and then forcing through script to use that package. Plus: The function 'GetCombatTarget()' obtains ONLY the npc the actor is in combat with and not the crucial position and casting magic direction, to make the script work properly you also need to obtain the position and align the actor to the npc, otherwise the actor will shout to the direction he is facing at that point, which could be anywhere. Link to comment Share on other sites More sharing options...
Sphered Posted February 18, 2023 Share Posted February 18, 2023 Orig question was for shouting to an already engaged opponent. Being engaged means the target is present and most likely already being focused on. I notice he has mounted flying projects so assumed its something he wants to invoke while mounted. Should work well either way Link to comment Share on other sites More sharing options...
staalo18 Posted February 19, 2023 Author Share Posted February 19, 2023 Thanks again for the answers so far. As Sphered is guessing, this is to provide manual mounted dragon combat. So it needs to be highly interactive. Scripted shout will definitely solve this, so I know that I do have a solution. But I haven't given up yet on package-based shout. After some more testing it seems that it's not necessarily the change of the combat target which is the issue. Looks more that changing the package while the shout is ongoing is derailing the dragon. Link to comment Share on other sites More sharing options...
Recommended Posts