KenJackson Posted March 26, 2013 Share Posted March 26, 2013 I'm trying to do something like this for an overall "companion system" mod but I'm needing to be able to simulate talking to any creature regardless of their various face heights (not to mention headless zombies. Yeah, good luck with that.) As for the zoom issue, does anyone know what the dialog routine uses for a target? Does it simply calculate the distance from the npc's position + (what the game knows to be the height of a skeleton * the character's scale)? Or could we possibly be lucky enough to have it target a specific skeleton node? Personally, I'd assume the first, but I've guessed wrong before. Link to comment Share on other sites More sharing options...
WarRatsG Posted March 26, 2013 Share Posted March 26, 2013 I would guess that the game just uses some trigonometry based on the scale of the actor. Since all the NPCs are pretty much identical shapewise, the height is easily worked out from the scale. Its harder for creatures though, since they are so variable. If the only creatures that can be spoken to are the ones added by your mod, then you can manually work out the height in the render window of the cs. Just put something next to its feet, get its z co-ordinate, then put something next to its head, or wherever it speaks from, and get that z co-ordinate too. Subtract them to get the height it game units of your creature. The rest will come down to how well you can do trigonometry ;) Link to comment Share on other sites More sharing options...
scarycave Posted March 26, 2013 Author Share Posted March 26, 2013 I I'm trying to do something like this for an overall "companion system" mod but I'm needing to be able to simulate talking to any creature regardless of their various face heights (not to mention headless zombies. Yeah, good luck with that.) As for the zoom issue, does anyone know what the dialog routine uses for a target? Does it simply calculate the distance from the npc's position + (what the game knows to be the height of a skeleton * the character's scale)? Or could we possibly be lucky enough to have it target a specific skeleton node? Personally, I'd assume the first, but I've guessed wrong before.Doing the same thing here. I don't think you'd have to worry too much about the head-less zombie though, or zombies really - they don't tilt their heads much, and their pretty much the same size. If you got something like what I have now, I'd say a zombie or skeleton would work really well with it got now.The zoom always goes in for a head-shot - which is what causes issues with creatures with non-humanish design, like the dog. Link to comment Share on other sites More sharing options...
KenJackson Posted March 28, 2013 Share Posted March 28, 2013 @WarRatsGAs a precision sheet metal manufacturing engineer, I lived and breathed trig for seven years. I can hold my own. :happy: @EveryoneBut no, I'd like to be able to "talk" to any creature, even custom ones, and as creatures use different skeletons, with heads at different angles and different distances from their NIFs' root nodes, without the ability to target something like a 'head' node, I'm really at a loss at how I'm going to simulate this. Also, in play, the PC may actually need to be "yelling" to them from across the room. In those situations, a close-up head shot may look a little weird, but some level of zoom would be useful for identifying the target of the dialog. Link to comment Share on other sites More sharing options...
WarRatsG Posted March 28, 2013 Share Posted March 28, 2013 (edited) KenJackson, on 28 Mar 2013 - 12:09, said:@EveryoneBut no, I'd like to be able to "talk" to any creature, even custom ones, and as creatures use different skeletons, with heads at different angles and different distances from their NIFs' root nodes, without the ability to target something like a 'head' node, I'm really at a loss at how I'm going to simulate this.You cannot enter a traditional "dialogue" state with creatures. The coding for it comes down to what is hardcoded in the game engine, so its not a moddable process.It is usually far simpler, easier and efficient to just trick the player into thinking that you made Oblivion your *censored*. In reality you will have to tip-toe around all of its various quirks until you come up with something that looks/feels like what you really want to mod. As far as I am aware, there is no way to use a NIF's information in game. I've heard that NifSE can bend the laws of the universe and allow dynamic modification of NIFs in game, although I know very little about what it actually does, how it does it, or how stable it is. If Deadly Reflex taught me anything, it's that NifSE may be too good to be true. All is not lost though. There are a few commands that may allow you to infer the height of a creature and thus the placement of its head. I think this actually could be possible. First, an OnActivate Event Handler will allow you to call your scripts upon activating anything. A few quick checks to ensure that it is a creature will allow efficiency, rather than checking every frame to see if the activate key has been pressed. Second, you can try one of the two commands that give dimensions of a reference, then from that try to infer the location of its head.:...... GetEditorSize - Not sure how this one works. CS wiki says it returns "rough scalar approximation of dimensions"...... GetBoundingRadius - Returns radius (in game units) of a sphere large enough to contain reference. Third, your trig functions: Math Functions. Note that you should turn the creature to face the player, and vice versa, before calculating the head position. Fourth, you will need some way to actually start a traditional conversation once you have located the head. I would recommend the method described earlier: Use SetRestrained on the player to prevent the camera moving during dialogue, then place a "Speaker" (an NPC with an alpha of 0 and a scale of 0.0001) next to the player./ Lock the player's crosshair to where you calculate the head to be using SetAngle X/Y. Turn the creature to face the player with SetAngle Z. Finally, use StartConversation to enter dialogue (note that the speaker must make his way over to you first, so there may be a delay) and voila, you have the appearance of a conversation. That's how I would try to do it. If you try this out, have fun :thumbsup: Edited March 28, 2013 by WarRatsG Link to comment Share on other sites More sharing options...
scarycave Posted March 28, 2013 Author Share Posted March 28, 2013 That get editor size sounds pretty interesting, but War-rats is right though - we can't talk to creatures like in Fo3, NV,Skyrim, which is whyI'm using an npc speaker. Also I don't think you have to use @Everyone, I think its just been me and war-rats in this thread so far: welcome to the party. :biggrin: Link to comment Share on other sites More sharing options...
KenJackson Posted March 29, 2013 Share Posted March 29, 2013 Yep! Those are precisely the difficulties I'm trying to overcome. If you'll notice, I had the word "talk" in quotes. I was trying to imply that I, too, am trying to simulate talking with a creature, to override the fact that it can't actually be done. I figure that would be obvious. I guess I figured wrong. :huh: Not to worry, I've been up to speed since I jumped in. But thanks for the heads up on the GetEditorSize and GetBoundingRadius. I hadn't stumbled across them yet. (I also hadn't thought of scaling down the dummy NPC.) Before I came across this thread, I was originally looking at using MenuQue to devise a false dialog menu, one that looked like the dialog menu but behaved like a message box, but while I've figured out how to get everything else to work right, I haven't been able to get the player's options to show up on the scroll pane. And I hadn't even begun to address zooming issues, yet. Now, I'd still like to know how to get text onto a scroll pane, but for the dialog situation, I think the one you're discussing here would be a lot easier than what I had in mind, as long as the dialog's results script can be manipulated to achieve the ends I need. Can a dialog's result script handle dynamic referencing? Or would I need to assign a placeholder script on the dummy NPC for any variable I need and then access them from outside? Link to comment Share on other sites More sharing options...
WarRatsG Posted March 29, 2013 Share Posted March 29, 2013 If by dynamic referencing you mean "refer to a dynamic reference" then yes, provided it has been saved to a variable.If you mean "declare, refer to and modify variables like other scripts" then no. Dialogue Result scripts can't declare variables, if that is what you mean. They can use and modify quest variables and variables on a persistent reference, but can have none of their own. The Speaker would be able to hold on to any variables you need, or you can make a quest to keep those variables separate. I've never used Menuque, so I don't think I can help with your previous method. I've found it is far better just to get the mechanics of Oblivion to work with you, allowing its own processes to do your work for you, rather than making a new process that tries to bypass those mechanics. Link to comment Share on other sites More sharing options...
KenJackson Posted March 29, 2013 Share Posted March 29, 2013 I knew declaring variables was out, but I actually was meaning ALL of the rest, "refer to dynamic reference", plus refer to and modify variables on dynamic references. but (I'm having problems with one of my lungs and I'm not getting enough oxygen to my brain so I'm not thinking too clearly, so please help me out here) if I recall correctly, that's pretty much beyond the range of standard scripts, too, right? I mean, you can get the ID of a dynamic reference, but the compiler isn't able to tell if there's a script attached to something who's reference isn't assigned yet, so therefor it's incapable of accessing any variables in that script. Right? Or did Oblivion somehow overcome that issue? As for MenuQue, I've been looking at the InsertXMLTemplate function. I'm thinking that it may be what I've been looking for (once I can get some oxygen to my brain and get it functioning again, so I can figure out how to use the command). Link to comment Share on other sites More sharing options...
scarycave Posted March 29, 2013 Author Share Posted March 29, 2013 I have the dog set up with Follow and Wait commands and they update the creatures packages accordingly.Since you brought up the talking zombies, I tried to test it with a Lich, and it worked perfectly. The fact that its already the same size, and doesn't have a neck like the dog, mountain lion, deer, etc. makes talking easy. There's still that bit of trouble with the fade up. I think I can actually get the npc to work for all creatures - if I use a global variable, get the creatures ID and use that for an IF statement.If not though, the npc and the script can be easily built up again in less than a minute, you just copy the script and change the coding in certain areas. I'm not familiar with menuque or dynamic references really, but I'm interested to see what they can do. Link to comment Share on other sites More sharing options...
Recommended Posts