kingtitan Posted April 28, 2013 Share Posted April 28, 2013 Hello all. Been awhile since I was last around, but I need some help learning about NPC conversation. What I want to do is have a certain NPC say only two or three different random "Greetings" to me when I walk by them. Basically I want to cut out the generic "I don't have time for you" and what not and make the NPC greet me with something custom like "Modding is cool" (not really, but purely for the sake of example). Essentially, I want that NPC to never use the built in "hello's" and use only my custom Hello's that I assign them. I think I have the majority of this figured out already but just need a couple kinks figured out to help me out. I already added the default "HELLO" topic under the conversation tab and added 4 of my own "Hello's". Ideally I would like to remove the other vanilla conversation hello's, so only my four custom ones are used. Any insight is greatly appreciated! Link to comment Share on other sites More sharing options...
Lanceor Posted April 29, 2013 Share Posted April 29, 2013 Since the Hello conversation topic is flagged as "random", the game will randomly pick amongst all the Hello's that are available including your own. The way to override this is to add a non-random topic with a higher priority. The side effect of this is that the NPC will always say the same thing each time. To make them randomly choose amongst the topics that I added, I created a script to generate a random number regularly, and set conditions on each of my Hello Topics where randomnumber == x. Link to comment Share on other sites More sharing options...
kingtitan Posted May 1, 2013 Author Share Posted May 1, 2013 Since the Hello conversation topic is flagged as "random", the game will randomly pick amongst all the Hello's that are available including your own. The way to override this is to add a non-random topic with a higher priority. The side effect of this is that the NPC will always say the same thing each time. To make them randomly choose amongst the topics that I added, I created a script to generate a random number regularly, and set conditions on each of my Hello Topics where randomnumber == x.If its not too much trouble, could you provide me with a base script of what you have in mind? I'm sure I can fine tune it to my needs but it would definitely be a big help to me! Link to comment Share on other sites More sharing options...
Lanceor Posted May 3, 2013 Share Posted May 3, 2013 Easy. Create a dummy quest (I'll name it RNGQuest) and flag it to Start Game Enabled so that it is running as soon as you start the mod. Create a simple quest script for it:Scriptname RNGScript short RandomNumber BEGIN GAMEMODE set RandomNumber to rand 1.0000 10.9999 END The function rand above basically generates a random float between 1.0000 and 10..9999 every five seconds. By assigning the random number to a short, we effectively chop off all the decimal places and get an integer between 1 and 10. In other words: 1.8 gets rounded down to 13.1415 gets rounded down to 310.9999 gets rounded down to 10 For each conversation line, set the condition RNGQuest.RandomNumber == x so that the non-random topic is dependent on the random number generated. NOTE: The function rand requires OBSE! Without OBSE, you'll need to find a way to generate a random number yourself. For example, the time of day * the angle of the player or similar. Link to comment Share on other sites More sharing options...
Recommended Posts