Jump to content

Dialogue modding help


vivanto

Recommended Posts

Hey all

 

I've got into some problem which I'm not sure what is causing.

 

In short, I made a mod that I am now upgrading with place-specific dialogues. Basically it adds an extra dialogue option to NPC's as long as they are inside the specified cell, which is simple.

 

The dialogue uses several scripts which include saving the npc reference you are talking to into a quest ref variable and disabling / enabling different dialogue options based on that.

 

For example if you told NPC-A that it is their home, then you can not tell NPC-B the same thing, but now you have the option on NPC-A to evict him or her. The goal was to create an NPC-independant script that completely relies on its own quest variables and topics, hence I need to save everything as reference variable.

 

The problem is, that it isn't always working, and the problem seems to be caused by the specific npc itself, while the dialogue logic is running good. From the vanilla Fallout3 companions it works with Star paladin, Clover, Jericho, Charon, but not with Butch (only works on humanoids so didn't test with fawkes, rl3, dogmeat).

 

The dialogue always works, under any circumstances with the first 4 npc, but never with butch, and I believe it is caused by saving the reference. Like if Butch has a special attribute (or lack of) that lets/prevents his reference to be saved properly via dialogue.

 

What I don't get is that the reference is properly saved even on the problematic npc's, I even tested it by using the reference variable to perform various actions on them, but when evaluating the dialogue for the new topics (evict), it does not work.

 

I used a ref variable to store the actual reference with getSelf, and a short flag to simply check if the ref is in use. Other option would've been to set the ref to some static in "clear" state, but I prefer logical flags.

 

I'll attach a simplified .esp file of the mod, only containing the dialogue, if anyone can help please. (also deleted a condition for checking the cell, so the dialog now appears everywhere for humanoid npc)

The dialogue quest ID is MVCompanionDresserQuest.

 

Much appreciated!

Link to comment
Share on other sites

There may be some advantages to the method that you describe that I cannot see, but I got similar results by setting conditions with script variables resulting from dialogue choices rather than ref variables based on which NPC you have spoken with.
Link to comment
Share on other sites

Not sure what you mean. If you are talking about setting multiple variable conditions with script results, then yes, that's part of it too. It just so happens that some of those conditions must include at least one reference as the dialogue choice depends on wether you have spoken or not with the individual already, however, prior to making that dialog choice it is available to everyone.

 

Makes no difference wether I store in script variable or quest, only using the quest script for further processing.

 

I could easily make specific follower-based dialogue if I only want the vanilla companions, but as I plan it to be an independant mod, I have to store them as reference since any npc can be made into a follower with a companion mod, of which there are a dime a dozen.

 

[..]

 

After couple hours of playesting it now, I still can't find why it works flawlessly with ~90% of npcs, but only messes up at a select few constantly. Think I'll use it like this anyway and implement a failsafe mechanism for the buggy ones.

Link to comment
Share on other sites

It might help if you used Tokens (invisible armor) to keep track of this stuff rather than rely on GetSelf to return the proper values.

 

For reference, it's probably best if people can see what your mod does:

 

scn MVCompanionDresserQuestSCRIPT

; flags to see if any of the references are in-use
short companionSelected
short guestSelected

; helper flags for multiple variable dialogue conditions
short isTalkingToCompanion
short isTalkingToGuest
short companionFree
short guestFree

; saved references
ref companionREF
ref guestREF

-------------------------------

Topic: Let's chat about this Vault.
Response: What about it?
Conditions: S GetIsCreature != 1
Result Script (End):

ref talkingTo

set talkingTo to getSelf

set MVCompanionDresserQuest.isTalkingToCompanion to (talkingTo == MVCompanionDresserQuest.companionREF)
set MVCompanionDresserQuest.isTalkingToGuest to (talkingTo == MVCompanionDresserQuest.guestREF)

set MVCompanionDresserQuest.guestFree to 0
if (MVCompanionDresserQuest.guestSelected == 0)
if (MVCompanionDresserQuest.isTalkingToCompanion == 1)
	if (MVCompanionDresserQuest.companionSelected == 1)
		set MVCompanionDresserQuest.guestFree to 0
	else
		set MVCompanionDresserQuest.guestFree to 1
	endif
else
set MVCompanionDresserQuest.guestFree to 1
endif
endif

set MVCompanionDresserQuest.companionFree to 0
if (MVCompanionDresserQuest.companionSelected == 0)
if (MVCompanionDresserQuest.isTalkingToGuest == 1)
	if (MVCompanionDresserQuest.guestSelected == 1)
		set MVCompanionDresserQuest.companionFree to 0
	else
		set MVCompanionDresserQuest.companionFree to 1
	endif
else
set MVCompanionDresserQuest.companionFree to 1
endif
endif

-------------------------------

Topic: Use my Companion's Dresser for your clothes.
Response: Okay, thanks.
Conditions: S GetQuestVariable MVCompanionDresserQuest, companionFree == 1
Result Script (End):

set MVCompanionDresserQuest.companionSelected to 1
set MVCompanionDresserQuest.companionREF to getSelf

-------------------------------

Topic: You can use the Guest Dresser for your clothes.
Response: Okay, thanks.
Conditions: S GetQuestVariable MVCompanionDresserQuest, guestFree == 1
Result Script (End):

set MVCompanionDresserQuest.guestSelected to 1
set MVCompanionDresserQuest.guestREF to getSelf

-------------------------------

Topic: Get your stuff out from the dressers!
Response: If that's what you want.
Conditions: S GetQuestVariable MVCompanionDresserQuest, guestSelected == 1
S GetQuestVariable MVCompanionDresserQuest, isTalkingToGuest == 1
Result Script (End):

set MVCompanionDresserQuest.guestSelected to 0

-------------------------------

Topic: Actually, never mind.
Response: Whatever.

Link to comment
Share on other sites

Hmm, thats a bloody good idea of using tokens for the dialogue filter, will get to it today.

 

Tough I still need to save the reference with getself as I will need to know which npc has the token without asking them later, but that part already works.

 

The mod is a player home as a whole which I'm upgrading with a universal dressing script (already has a prototype but that only supports 1 npc and simple dressing methods)

 

No, it ain't gonna be a lets-make-every-female-nude mod. It assigns a special "dresser" to selected npcs which they use to put away their power armors and bigguns when at home and take up a comfy home suit, which can be customized by the player, and also handles an automatic sandbox scriptpackage.

 

So the reference is needed to create a dynamic link between these dressers and the npc.

 

Thanks for the idea! :)

Link to comment
Share on other sites

Yeah I did just that. But since it is a quest script that handles the actual dressing, it does not get any actionRef to work with, and test the actor's inventory with getItemCount.

 

What I did now is, conditionalize the dialogue with the tokens, and the triggers that track which room the actor with the token is currently in. Used the onTriggerEnter and onTriggerLeave blocks similarly to track keystrokes and mousebutton on modern languages with event listeners.

 

But then it is the trigger that tells the quest the reference, unless I am unaware of a block or function, there is no way for a quest script to handle dynamic actionRefs other than ref variable given by a 3rd party block.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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