Fumegate Posted May 9, 2018 Posted May 9, 2018 Hi all. I want to use poses and animations (both vanilla and mods) assigned to idle markers to create immersive scenes in the game. While some mods, like Dave´s Poses use a gun, I want to create everything in the CK, otherwise the poses eventually resets and the actor is using the idle. If I disableAI the textures and/ or actor offset eventually gets messed up eventually. I've managed to add the poses and animations to work with idle markers like I want them (by changing the Anim Event under Gameplay -> Animations...). But now I can't place idle markers to close to each other because of collision. So when I want a crowded bar counter, shop, or just actors around a pool table the collision makes some, or most, of the assigned actors unable to reach the idle marker. While there are some tutorials, guides and somewhat related content to find, many of them doesn't go all the way into actually show how to use the code in the game. For example TranslateTo() is mentioned as a workaround to disable collision for NPCs via papyrus, and that needs to be in a function.(?) But all-in-all I don't know how to use a line like that in FO4. I know there is content on creationkit.com but I have yet to managed to put the pieces together to do what I what to. Would much appreciate some code examples if anyone knows how to disable collision for NPCs in CK or another workaround.
Evan555alpha Posted May 9, 2018 Posted May 9, 2018 Papyrus handles a lot of things through these things called Events. so say, when a magic effect is applied to an NPC, then that will send out an OnMagicEffectStart() event to anything that is told to listen for that particular magic effect to start. A suggestion on how to do what I believe it is that you want to do would be to: - have a triggerbox in the area where the player enters the cell that the bar is in - Have that triggerbox send out an OnTriggerEnter() event when the player enters it. - Inside that event, have the various NPCs translated to the positions that you want. So it would be something like: Spoiler Scriptname MyNameSpace:MyScript extends ObjectReference Actor Property NPC1 Auto ... Actor Property NPCN Auto Event OntriggerEnter(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() NPC1.TranslateTo(x, y, z, a, b, c, w, 0.0) ... NPCN.TranslateTo(d, e, f, j, k, l, o, 0.0) EndIf EndEvent However, bear in mind that I have no experience with triggerboxes, and only moderate experience with Papyrus as a whole. You'd be better off listening to someone such as @Halstrom as they know much more about the language than I do.
Halstrom Posted May 9, 2018 Posted May 9, 2018 7 hours ago, Evan555alpha said: Papyrus handles a lot of things through these things called Events. so say, when a magic effect is applied to an NPC, then that will send out an OnMagicEffectStart() event to anything that is told to listen for that particular magic effect to start. A suggestion on how to do what I believe it is that you want to do would be to: - have a triggerbox in the area where the player enters the cell that the bar is in - Have that triggerbox send out an OnTriggerEnter() event when the player enters it. - Inside that event, have the various NPCs translated to the positions that you want. So it would be something like: Hide contents Scriptname MyNameSpace:MyScript extends ObjectReference Actor Property NPC1 Auto ... Actor Property NPCN Auto Event OntriggerEnter(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() NPC1.TranslateTo(x, y, z, a, b, c, w, 0.0) ... NPCN.TranslateTo(d, e, f, j, k, l, o, 0.0) EndIf EndEvent However, bear in mind that I have no experience with triggerboxes, and only moderate experience with Papyrus as a whole. You'd be better off listening to someone such as @Halstrom as they know much more about the language than I do. LOL, better to ask in the CK help thread or just here, I'm just bumbling through learning Papyrus for the first time still, there are a few guys who have been through the process with Skyrim, you could ask in the Skyrim forums too as Skyrim papyrus is 99% the same as FO4
dagobaking Posted May 10, 2018 Posted May 10, 2018 You can make custom mount points on furniture where those actors can be snapped to. You could also use AAF to lock them to the furniture. Though there remains some issues to work out when that involves the player character.
Fumegate Posted May 10, 2018 Author Posted May 10, 2018 On 5/9/2018 at 5:33 PM, Evan555alpha said: So it would be something like: (code) Thank you for the example. So far all that happen is that a clone appears(?). Here's the example i want to do: I´m having an NPC, Idle marker and a patrol assigned by the NPC to that idle marker. The patrol is set to always (or something like that) and with only one way point the NPC now always and only uses this idle marker. Second, I'm not entirely sure of how to use the translateTo() params. I mean, i do not technically want to move the NPC, since it's already is placed by the idle marker, I just want to get rid of the collision so that some of the NPCs poses/anims don't get interrupted by other NPC who's marker was (slightly) to close. I get that using Furniture would be better, easier in some ways. But first, I don't know how to create my own furniture (add poses/ anims etc). Second, do we have the same control of NPCs using them in sandboxing? I guess we can limit to no sleep etc but to assign specific NPCs to a specific furniture? I feel like the control using the idleMarkers is good enough, for me it just boils down to this collision. I could clutter a lot of idles all over, like two guards standing by a door, but I don't want to test every single marker to see if the collision interrupts one of them or not.
Evan555alpha Posted May 11, 2018 Posted May 11, 2018 5 hours ago, Fumegate said: Thank you for the example. So far all that happen is that a clone appears(?). Here's the example i want to do: I´m having an NPC, Idle marker and a patrol assigned by the NPC to that idle marker. The patrol is set to always (or something like that) and with only one way point the NPC now always and only uses this idle marker. Second, I'm not entirely sure of how to use the translateTo() params. I mean, i do not technically want to move the NPC, since it's already is placed by the idle marker, I just want to get rid of the collision so that some of the NPCs poses/anims don't get interrupted by other NPC who's marker was (slightly) to close. I get that using Furniture would be better, easier in some ways. But first, I don't know how to create my own furniture (add poses/ anims etc). Second, do we have the same control of NPCs using them in sandboxing? I guess we can limit to no sleep etc but to assign specific NPCs to a specific furniture? I feel like the control using the idleMarkers is good enough, for me it just boils down to this collision. I could clutter a lot of idles all over, like two guards standing by a door, but I don't want to test every single marker to see if the collision interrupts one of them or not. You could always use the TranslateToRef() function, which is more or less the same, but with different parameters (ObjectReference arTarget, float afSpeed, float afMaxRotationSpeed = 0.0) and just use the actor themselves as the translate reference. However, the use of any of the translateto functions may be a moot point, as it's possible that using them would break animations from playing.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.