Zorkaz Posted March 18, 2023 Share Posted March 18, 2023 Has anyone experience with adding AI packages to NPCs, in my case the player?Does it work properly? Basically I'd like to add and remove a package using a script without editing the NPC manually Link to comment Share on other sites More sharing options...
Fantafaust Posted March 18, 2023 Share Posted March 18, 2023 Is this to perform a scene or something? You'd have to disable player controls I would think or it won't do anything even when the conditions are fulfilled.iirc there's an ai control toggle as well, at least in Skyrim, I assume that would help Link to comment Share on other sites More sharing options...
LarannKiar Posted March 18, 2023 Share Posted March 18, 2023 The console commands SetPlayerAIDriven and ToggleControlsDriven don't work as far as I know. Moving the player as if they were controlled by an AI package would be possible with a dummy (invisible) furniture, a custom furniture animation and FurnitureRef.Activate(PlayerRef). Link to comment Share on other sites More sharing options...
Zorkaz Posted March 18, 2023 Author Share Posted March 18, 2023 SetPlayerAIDriven does work as far as I remember as I've used it to control a cat instead of the player Game.Getplayer().RemoveItem (CFCatFood, 1) Game.ForceThirdPerson() CatMinkaActor.SetPlayerControls(true) CatMinkaActor.EnableAI(True, False) Game.SetPlayerAIDriven(true) Game.SetCameraTarget(CatMinkaActor) KmyQuest.CatControl()The real issue is that I propably can't add and remove a package to the playerref as there is no script for that Link to comment Share on other sites More sharing options...
84Cronos Posted March 18, 2023 Share Posted March 18, 2023 SetPlayerAIDriven does work as far as I remember as I've used it to control a cat instead of the player Game.Getplayer().RemoveItem (CFCatFood, 1) Game.ForceThirdPerson() CatMinkaActor.SetPlayerControls(true) CatMinkaActor.EnableAI(True, False) Game.SetPlayerAIDriven(true) Game.SetCameraTarget(CatMinkaActor) KmyQuest.CatControl()The real issue is that I propably can't add and remove a package to the playerref as there is no script for that I take control of the player in a couple of my scenes as well - albeit only for a couple of seconds, because it's super janky. The way I apply AI packages to the player is in scenes. It's pretty much the same approach as with NPCs in scenes. That's probably not what you're looking for since you want to do it script based, but maybe you can make it work for you. Link to comment Share on other sites More sharing options...
Zorkaz Posted March 19, 2023 Author Share Posted March 19, 2023 @84Cronos How do you do that? Link to comment Share on other sites More sharing options...
84Cronos Posted March 19, 2023 Share Posted March 19, 2023 @84Cronos How do you do that?I followed this tutorial for Skyrim which I found and adjusted a couple of things: https://www.youtube.com/watch?v=rter3FIzvZs Link to comment Share on other sites More sharing options...
Zorkaz Posted March 19, 2023 Author Share Posted March 19, 2023 Thank you Link to comment Share on other sites More sharing options...
84Cronos Posted March 19, 2023 Share Posted March 19, 2023 Don't forget to post what you come up with. I'm eager to see what kind of interesting stuff you're creating. Link to comment Share on other sites More sharing options...
Zorkaz Posted March 20, 2023 Author Share Posted March 20, 2023 So far no luck. Using Game.ForceThirdPerson() Game.SetPlayerAIDriven(true) utility.wait(0.1) PSPlayerSandboxQ.start() PSPlayerSandboxQScene.start()in a magic effect and having a scene where the player has a sandbox package applied only lets the player stand around immovable Link to comment Share on other sites More sharing options...
Recommended Posts