Jump to content

Oblivion Player Random Conversation with NPCs Mod


thejazzcat117

Recommended Posts

Hi all, a bit of a weird request.


I'll cut to the chase. I am looking to make a mod that allows the actor to engage in randomly generated generic dialogue conversations with NPCs.


While I have used the construction set for other things, I am not sure it is possible due to the way TES IV handles conversations (when talking to an NPC, opens the dialogue menu, correct me if I'm wrong). Trying to make it where in 3rd person view, HUD disappears like a cutscene and goes through various Idle topics with NPC of choice with a hotkey press.



While scripting advice would be fantastic, I would also commission someone to make this for me, $200 with half up front and half after. Let me know! <3


Link to comment
Share on other sites

I think a Quest that use RAND will do it as the dialogues are inside a quest anyway. :D

 

Lest make it simple:

 

Scn TheJazzRandomizerQuestSCR

Short RandomDIialogueINT

Begin GameMode

	Set RandomDIialogueINT to RAND 0 <NumberOfDialogues>

End
For the Dialogues, you set the QuestVariable RandomDialogueQST.RandomDIialogueINT == <something> as a condition

 

There is a random function as well in the Dialogue editor, but I am not sure how good it really is. RAND belongs to OBSE and uses the best algoritms available for a random number. Read here: https://cs.elderscrolls.com/index.php?title=Rand

 

It is up to you to exchange <NumberOfDialogues> with an actual value or a number. If you have 16 dialogues then type:

 

Set RandomDIialogueINT to RAND 0 15

Edited by Pellape
Link to comment
Share on other sites

 

Do not forget that every new topic requires you to add it in game with

 

Addtopic <Topic>

 

Do not spread it around to too many NPC, polluting them... :wink:

I will give this a try, thanks so much!!!

 

 

I think a Quest that use RAND will do it as the dialogues are inside a quest anyway. :D

 

Lest make it simple:

 

Scn TheJazzRandomizerQuestSCR

Short RandomDIialogueINT

Begin GameMode

	Set RandomDIialogueINT to RAND 0 <NumberOfDialogues>

End
For the Dialogues, you set the QuestVariable RandomDialogueQST.RandomDIialogueINT == <something> as a condition

 

There is a random function as well in the Dialogue editor, but I am not sure how good it really is. RAND belongs to OBSE and uses the best algoritms available for a random number. Read here: https://cs.elderscrolls.com/index.php?title=Rand

 

It is up to you to exchange <NumberOfDialogues> with an actual value or a number. If you have 16 dialogues then type:

 

Set RandomDIialogueINT to RAND 0 15

 

Here is my next question, how would I set up pressing a hotkey to use disableplayercontrols, and link Infogeneral to say a positive response, in the same RNG way as NPCs do?

Link to comment
Share on other sites

Well setting up the hotkey for disable the controls is easy. Setting up one that enables them might be impossible

Have you looked at the Enhanced Hotkey mod? https://www.nexusmods.com/oblivion/mods/34735

It is best to not fiddle with hotkeys in case you use this mod. :wink:

 

OBSE has a function called GetButtonPressed and how will you access the code?

  1. Spell
  2. Quest

Quest might be best but if you ask me, it is useless if you cannot enable them the same way :D'

 

I never tried this function myself

 

GetKeyPress - The Elder Scrolls Construction Set Wiki

 

You also have a complete list of functions here: List of Functions - The Elder Scrolls Construction Set Wiki

All are very much self explained what they actually do :wink:

 

The button V is not used in the hotkey mod, so lets use it and it has number 47 according to the list

Scn ThejazzDisableControlSCR

; ***  For Quest   ****

Short Button

begin GameMode

	Set Button to GetKeyPress 47
	
	If ( Button == 47 )
		DisablePlayerControls
	Endif 
	
	PrintC "You did press %.0f", Button
	Message "You did press %.0f", Button
	
End

	

test this code and change the script IF to whatever result you see in the message or console. I do not plan to test this script, so you have to test it :D The Wiki say it returns the scancode and it is 47 dec and 2f hex. Report back. Set the quest to run every frame. So add this:

float fQuestDelayTime  ;  above begin gameMode



Set fQuestDelayTime to 0.001   ; After begin GameMode
Edited by Pellape
Link to comment
Share on other sites

if isKeyPressed3 Quick1 == 1 && SpeakOnce == 0
disableplayercontrols
set SpeakOnce to 1
endif
if isKeyPressed3 Quick2 && SpeakOnce == 0
EnablePlayerControls
set SpeakOnce to 1
endif
if isKeyPressed3 Quick3 == 1 && SpeakOnce == 0
PLayer.say hello
set SpeakOnce to 1
endif
if isKeyPressed3 Quick4 && SpeakOnce == 0
player.say noticed
set SpeakOnce to 1
endif
if isKeyPressed3 Quick5 && SpeakOnce == 0
player.say assault
set SpeakOnce to 1
endif
if isKeyPressed3 Quick6 && SpeakOnce == 0
player.say Yield
set SpeakOnce to 1
endif
if isKeyPressed3 Quick7 && SpeakOnce == 0
player.say InfoRefusal
set SpeakOnce to 1
endif
if isKeyPressed3 Quick8 && SpeakOnce == 0
player.say Idle
set SpeakOnce to 1
endif

Did a more modular approach and this allows the player to decide their own hotkey (code not pasted but works after test), here are some specific dialogue lines that I have gotten to work (Note that SpeakOnce is a short and I opted for IsKeyPressed3 as it worked)..

 

This works fantastic with individual (*randomly picked from conversation topic, so all the Idles for example, etc.) lines, but how to I expand into inputing the randomly generated dialogue conversations the game is so infamous for? As mentioned in first post, I have run into a block from the way bethesda codes convos with the actor; StartConversation ALWAYS pulls up the dialogue menu, so that's a no.

 

If this works at some point, I will insist on paying you!!! Also also, enableplayercontrols in this context works with hotkeys

 

 

Edited by thejazzcat117
Link to comment
Share on other sites

What is your email @pellape? I will send what I have so far!

Pekkape01 at gmail.com

 

yes do that. So what about the Object ID´s? Or do you send them in email too? It could be fun to complete the script in this thread, as it might be useful for many more, to use as a Templet more or less.

Edited by Pellape
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...