Some dialogue questions

Post » Fri May 27, 2011 10:58 pm

...melian if you come across this post you might want to make a note of this for the next edition of MWSFD (if there is one :) )

I have this thread bookmarked for SfD info ;). One of these days I might even do something about it :P

For the disp modifier... You could just use a small global script run from dialogue results, to set disp back after you exit menumode. Something like this:
begin resetDispshort waitif ( MenuMode )    returnelseif ( wait < 3 )    set wait to ( wait + 1 )    returnendifModDisposition -5StopScript resetDispend

User avatar
Alister Scott
 
Posts: 3441
Joined: Sun Jul 29, 2007 2:56 am

Post » Sat May 28, 2011 4:57 am

I have this thread bookmarked for SfD info ;). One of these days I might even do something about it :P

For the disp modifier... You could just use a small global script run from dialogue results, to set disp back after you exit menumode. Something like this:
begin resetDispshort waitif ( MenuMode )    returnelseif ( wait < 3 )    set wait to ( wait + 1 )    returnendifModDisposition -5StopScript resetDispend



That's a nice way of handling it - however I know that will only work if that specific dialogue is called - for instance one of the items I want the script attached to is a perfume - in this mod the player doesn't drink it like some kind of potion, they wear it like an amulet - I have some dialogue where the inn keeper is explaining that the local Orc regular keeps trying to impress her with Telvanni Bug Musk, she should really tell him to wear it instead of drinking it

Anyway - I could enchant the bottle but I'd rather have the item have like a constant effect so that even if the player gets a different greeting than the clothes one - greeting 8 - the disposition of the person being spoken to does go up - not a lot but just a little.

I thought about adding a curse when the player is wearing the item and removing the curse when they take it off - however the spell I thought of using is charm and it is not listed under curses (curses)


Fortify personality has adverse effects - however I could use a curse to fortify speechcraft which makes sense as many find wearing a fragrance a boost to confidence though I'd prefer elevating the dispostion

I do like your little script and will file it away :)


Edit: having just looked again I can see charm sitting under curses - I could of sworn it wasn't there when I looked the first and second times - anyway I'll try adding charm as a curse to the player when wearing the perfume and see if that works. Will post results.

Edit 2: Well either charm isn't working or my script is not right - the filter in dialoue to check for the perfume is working however

Here's the script

Begin CT_PerfumeScript; script for Amelia's Perfume so people can react to you wearing it via dialogue greeting; adapted from bethesda's ordinator script by Illuminiel; uses the Global CT_Wearingperfumeshort OnPCEquipshort OnPC				if ( OnPCEquip == 1 )	set CT_Wearingperfume to 1	; this can now be filtered in dialogue for a response to the perfume	set OnPC to 1	player->addSpell CT_Eternal 	; uses a charm curse to make NPC's like the PC endif;this has been equipped by PC at some point, so check for it being unequippedif ( OnPC == 1 )	;Now it is unequipped	if ( OnPCEquip == 0 )		set CT_Wearingperfume  to 0		set OnPC to 0							; start looking again if it is equipped		player->removeSpell CT_Eternal	; removes the charm curse once the perfume is unequipped	endifendifend CT_PerfumeScript

User avatar
Dragonz Dancer
 
Posts: 3441
Joined: Sat Jun 24, 2006 11:01 am

Post » Sat May 28, 2011 7:16 am

Sorry, I didn't realise it was so general (I assumed it would have a specific greeting or something).

Problem with Charm is that you have to curse the NPC, not the player - which has the same issues as ModDisposition. I can't really think of anything better than a Fortify Personality enchantment (or scripted curse) - I'm pretty sure the MCP fixes the issue of lowering disp if it's gone over 100 when you remove it.

Otherwise - you could use a pre-greeting. That would have issues with any mod that relies on the Talked to PC flag though.
User avatar
Kim Bradley
 
Posts: 3427
Joined: Sat Aug 18, 2007 6:00 am

Post » Sat May 28, 2011 5:22 am

Sorry, I didn't realise it was so general (I assumed it would have a specific greeting or something).

Problem with Charm is that you have to curse the NPC, not the player - which has the same issues as ModDisposition. I can't really think of anything better than a Fortify Personality enchantment (or scripted curse) - I'm pretty sure the MCP fixes the issue of lowering disp if it's gone over 100 when you remove it.

Otherwise - you could use a pre-greeting. That would have issues with any mod that relies on the Talked to PC flag though.


Oh - no wonder charm wasn't working - I ended up changing the spell to fortify speechcraft, which I've decided is fair enough and in the interests of keeping things simple works well at least in testing it did what it was supposed to

I didn't know MCP fixed disposition - (I tend to use it for alpha issues)

Anyway thanks for jumping in again to help me - it's very much appreciated - I actually feel quite good that I worked out how to add a spell as a curse instead of using enchant - this will help me with other items as well as i have some which do not enchant well such as phijama's pauldrons and headress - so a script when wearing them makes a useful work around
User avatar
Ricky Meehan
 
Posts: 3364
Joined: Wed Jun 27, 2007 5:42 pm

Post » Sat May 28, 2011 7:06 am

I have an NPC who is unconcsious and has a lying down animation applied to her - I don't want her to use any of the verbal hello soundfiles until the quest is complete - if I set hello to 0 then I get the Goodbye message in dialogue which is not really what I want - as I was going to write a unique greeting with some reply options eg 1 "[You decide to leave her alone]" 2 "[Try and revive her]"

I have the same issue with another NPC who is younger than the generic voice files of the Bretons. I would prefer he never used an idle hello, thief or other such spoken noise.

So how do I prevent NPC's from making noise?
User avatar
Emily abigail Villarreal
 
Posts: 3433
Joined: Mon Aug 27, 2007 9:38 am

Post » Fri May 27, 2011 7:15 pm

Use the NoHello and NoAlarm short variables in their scripts. I don't if it's possible to prevent NPCs from saying their idle comments, but the two I mentioned will prevent them from vocally greeting the player and crying out in alarm.
User avatar
Mistress trades Melissa
 
Posts: 3464
Joined: Mon Jun 19, 2006 9:28 pm

Post » Fri May 27, 2011 6:18 pm

Use the NoHello and NoAlarm short variables in their scripts. I don't if it's possible to prevent NPCs from saying their idle comments, but the two I mentioned will prevent them from vocally greeting the player and crying out in alarm.


Thanks Jaac - after reading your post I did a search in the MWSFD and saw the section on NoHello - seems the vampires have this attached to their scripts - I was able to quickly pull together a small script that removes the idle, thief etc voices - I had always wondered why they were set to empty in the CS

Begin CT_Silence; Prevents young NPC's from using generic sound files; Also used on Unconscious NPC's to prevent them speaking; Unconscious NPC's also need a unique greeting which includes a groan sound for their race; Perien has a seperate version of this for his unique scriptShort NoIdleShort NoHelloShort NoIntruderShort NoThiefShort NoFleeEnd CT_Silence


When I check on the dialogue for the NPC's this is attahced to the EMPTY dialogue option appears first in thier options in the Voice tab showing that it is working correctly - thanks for the help
User avatar
Mélida Brunet
 
Posts: 3440
Joined: Thu Mar 29, 2007 2:45 am

Post » Sat May 28, 2011 3:44 am

Glad I could help. I never knew about the noIntruder, noThief and noFlee ones. I may have to use the first two for a mod of mine. :) I thought noAlarm would do it, but apparently not. :(
User avatar
DAVId MArtInez
 
Posts: 3410
Joined: Fri Aug 10, 2007 1:16 am

Post » Fri May 27, 2011 10:02 pm

I have an NPC who is unconcsious and has a lying down animation applied to her - I don't want her to use any of the verbal hello soundfiles until the quest is complete - if I set hello to 0 then I get the Goodbye message in dialogue which is not really what I want - as I was going to write a unique greeting with some reply options eg 1 "[You decide to leave her alone]" 2 "[Try and revive her]"

I have the same issue with another NPC who is younger than the generic voice files of the Bretons. I would prefer he never used an idle hello, thief or other such spoken noise.

So how do I prevent NPC's from making noise?

It appears you have worked out how to prevent the NPC from speaking, but I wonder from what you describe that you don't just place a script on the NPC that prevents the dialog window from opening until she is conscious. I think it would appear more natural. I am not certain what sorts of conditions you have available to check, but I will use a dummy local variable. You might have it set by journal, by a fatigue check or something else altogether.

Begin Illy_Unconscious; Attached to unconscious NPCshort notConscious ; set by unidentified meansshort messageOnshort buttonshort actionif ( OnActivate == 1 )   if ( notConscious == 0 ) ; or some other check such as journal index      Activate ; opens normal dialog window   elseif ( notConscious == 1 )      if ( messageOn == 0 ) ; make do once         set messageOn to 1         messagebox "This woman is unconscious. What will you do?" "You decide to leave her alone." "Try and revive her."      endif   endifendifif ( messageOn == 1 )   set button to ( GetButtonPressed )   if ( button == -1 ) ; no button pressed      return   elseif ( button == 0 ) ; do not disturb   elseif ( button == 1 ) ; try to revive      set action to 1   endif   set messageOn to 0 ) ; reset for next timeendifif ( action == 1 );  I do not know where you are going from here, but you get the idea.endifEnd

User avatar
BRIANNA
 
Posts: 3438
Joined: Thu Jan 11, 2007 7:51 pm

Post » Sat May 28, 2011 10:01 am

Wow, this thread is a mine of infomation!

I'm really looking forward to your mod Illy, judging by the tidbits about it here it's going to be fantastic!

I'll add my own question rather than start a new thread. It has to do with ForceGreeting.
I'd like my majordomo to force greet the player on some occasions only (basically when the PC return home and something of note has happened).
I'm guessing I could give a script to the majordomo like this:

Begin majordomo_scriptif ( GetDistance, majordomo_npc <= 200 )     if ( GetJournalIndex, aa_event_journal == 10 )          majordomo_npc"->ForceGreeting     elseif ( GetJournalIndex, aa_event_journal == 20 )          majordomo_npc"->ForceGreeting;goes on for another dozens journal entries     endifendifend

Presumably, the majordomo would forcegreet the PC with whatever greeting has been set for each journal entry.

The majordomo already has a rather lengthy script and I'd rather have the force greeting triggered via dialogue, so I tried adding this in the result box
if ( GetDistance, majordomo_npc <= 200 )    majordomo_npc"->ForceGreetingendif

.... which resulted ingame with my pc freezing.

So, ... finally my question:

How do I forcegreet via dialogue? If script is the best way to go then...

Could I attach my script (assuming it's a good one) to a hidden dummy activator in the same cell as the majordomo rather than attach it to the majordomo himself? (phew, that was a long question)

Thanks for any insight you can provide.
User avatar
Michael Russ
 
Posts: 3380
Joined: Thu Jul 05, 2007 3:33 am

Post » Fri May 27, 2011 9:29 pm

You can't force greet in dialog. I'd go with an activator script:

Begin forcegreet_scriptshort doOnceif ( MenuMode == 1 )     returnelseif ( GetDistance Player > 200 )     returnendifif ( GetJournalIndex aa_event_journal == 10 )	if ( doOnce == 0 )		"majordomo_npc"->ForceGreeting		set doOnce to 1	endifelseif ( GetJournalIndex aa_event_journal == 20 )	if ( doOnce == 1 )		"majordomo_npc"->ForceGreeting		set doOnce to 2	endif;goes on for another dozens journal entriesendifend


If the majordomo is supposed to say things sequentially (say one thing has to happen before another), keep incrementing the doOnce variable and checking for the next #. In the above script, the majordomo has to talk to the player about aa_event_journal index 10 before he'll talk about 20. The doOnce check is to prevent him from talking to the player over and over about the same topic. If you update the journal index after he's talked to the player, you can do away with the doOnce checks.
User avatar
ladyflames
 
Posts: 3355
Joined: Sat Nov 25, 2006 9:45 am

Post » Sat May 28, 2011 9:55 am

You can't force greet in dialog. I'd go with an activator script:

Begin forcegreet_scriptshort doOnceif ( MenuMode == 1 )     returnelseif ( GetDistance Player > 200 )     returnendifif ( GetJournalIndex aa_event_journal == 10 )	if ( doOnce == 0 )		"majordomo_npc"->ForceGreeting		set doOnce to 1	endifelseif ( GetJournalIndex aa_event_journal == 20 )	if ( doOnce == 1 )		"majordomo_npc"->ForceGreeting		set doOnce to 2	endif;goes on for another dozens journal entriesendifend


If the majordomo is supposed to say things sequentially (say one thing has to happen before another), keep incrementing the doOnce variable and checking for the next #. In the above script, the majordomo has to talk to the player about aa_event_journal index 10 before he'll talk about 20. The doOnce check is to prevent him from talking to the player over and over about the same topic. If you update the journal index after he's talked to the player, you can do away with the doOnce checks.


Thank you Jac.I'll go with the activator then. I do have a journal update after each forced greeting but it's good to know it doesn't have to be like that. Ah, and I always forget the menumode/return lines...
I tried the dialogue result because of this from SfD:

Using ForceGreeting in dialogue results for a greeting can be a useful trick in some circumstances, usually to have a resultbox script executed without providing extra, unique text for it .


Now I'm guessing that the dialogue result box can be used to start the script with the force greeting... It won't be the first time I feel to dumb for Scripting for Dummies... Anyway, thanks again !
User avatar
Victoria Bartel
 
Posts: 3325
Joined: Tue Apr 10, 2007 10:20 am

Post » Sat May 28, 2011 5:08 am

You're welcome. :)

I was looking at the script I posted and discovered that you could use the same doOnce check for each forcegreeting, just reset doOnce back to 0 after the majordomo talked to the player. If you do that, make sure all of the doOnce checks are for it equaling 0 and that you reset the variable in dialog. You can still use journal entries if you want after the majordomo talked to the player depending upon what he's talking about.
User avatar
x_JeNnY_x
 
Posts: 3493
Joined: Wed Jul 05, 2006 3:52 pm

Post » Fri May 27, 2011 11:16 pm

I have a question about factions in dialogue

I have a unique faction CT_Dunhaven and in dialogue I want to add a result ModPCFacRep 5 "Dunhaven" - however I am unsure how the engine reads the faction - do I use CT_Dunhaven or just Dunhaven - for instance if a character says they work in Dunhaven I use %faction and the game reads that as Dunhaven for ingame dialogue - hope that makes sense - do I use the unique Id or do I use the faction name?
User avatar
Lizs
 
Posts: 3497
Joined: Mon Jul 17, 2006 11:45 pm

Post » Sat May 28, 2011 12:08 am

In any function (including ModPCFacRep) you'd use the unique ID.

PS I'm still thinking about that animation thing, I just want to get a couple of things done first ;)
User avatar
Natasha Callaghan
 
Posts: 3523
Joined: Sat Dec 09, 2006 7:44 pm

Post » Sat May 28, 2011 7:14 am

Why don't just make ID and name the same? It'll work and there won't be doubts what to use. :D
User avatar
Kaley X
 
Posts: 3372
Joined: Wed Jul 05, 2006 5:46 pm

Post » Fri May 27, 2011 7:02 pm

Ok I know this is the completely wrong spot for this post but I have been looking everywhere for the answer. If I buy Morrowind on Steam, it say's it does not come with the TES construction set. Can I download it somewhere cause the only one I see on the elder scrolls site is the oblivion one? are they the same?
User avatar
Sheila Esmailka
 
Posts: 3404
Joined: Wed Aug 22, 2007 2:31 am

Post » Fri May 27, 2011 8:20 pm

In any function (including ModPCFacRep) you'd use the unique ID.

PS I'm still thinking about that animation thing, I just want to get a couple of things done first ;)


Double thanks Melian :) No hurries


Why don't just make ID and name the same? It'll work and there won't be doubts what to use. :D


You know Kir - I always brace myself for and then enjoy your level headed replies - it's a reasonable call - I suppose I was on a naming convention binge at the time and determined to avoid any cross contamination from other mods for instance I have Great House Dres representatives in the mod - however they belong to CT_House Dres to avoid messing with Tamriel rebuilt and anyone else who uses House Dres

Ok I know this is the completely wrong spot for this post but I have been looking everywhere for the answer. If I buy Morrowind on Steam, it say's it does not come with the TES construction set. Can I download it somewhere cause the only one I see on the elder scrolls site is the oblivion one? are they the same?


Um... welcome to the forum - you're quite correct this is the wrong spot for a random question unrelated to the thread - if you use the search function you'll find half a dozen threads asking this question on the second page of this forum I found a thread asking your question about http://www.gamesas.com/index.php?/topic/1099800-cant-find-morrowind-cs-downloaded-from-steam/ and it refers the OP to the sticky at the start of this forum http://www.gamesas.com/index.php?/topic/24-comprehensive-tutorial-and-useful-link-list/ which has a nice link to the http://www.tesnexus.com/downloads/file.php?id=29388 - I'm sure you'll find your way around and its features soon enough though
User avatar
Flesh Tunnel
 
Posts: 3409
Joined: Mon Sep 18, 2006 7:43 pm

Post » Sat May 28, 2011 2:17 am

Okay I have a question about randomness in scripting

In dialogue I am quite comfortable with using rand100 to get different options in dialogue

How does that work in a script though - for instance I have an NPC who is learning how to be a Guild Guide - in a quest the player can act as a volunteer so she can train on you - I know how to do a script from dialogue that transports the player and I also know how to use rand100 via dialogue so a different script could be picked each time she is asked

However rather than having 4 seperate scripts I was wondering about having a single script for teleporting that has random options

In the MWSFD there is only a couple of paragraphs on using random variables and quite frankly it did my head in trying to understand it compared to using the dialogue method - but I gathered it could be done - effectively i am looking for 4 options but unclear on the correct syntax for the randomness?

I can just write 4 scripts and use dialogue - however I am interested in learning how randomness can be achieved in a single script - so any help welcome :)
User avatar
Benji
 
Posts: 3447
Joined: Tue May 15, 2007 11:58 pm

Post » Fri May 27, 2011 7:42 pm

Begin random_scriptshort numberset number to random 4 ;pick a number between 0 and 3.if ( number == 0 )     (first random option)elseif ( number == 1 )     (second random option)elseif ( number == 2 )     (third random option)else     (fourth random option)endifEnd


Hope this helps. :)
User avatar
Sarah MacLeod
 
Posts: 3422
Joined: Tue Nov 07, 2006 1:39 am

Post » Sat May 28, 2011 1:04 am

Just a question about localdayspassed - I am using it in dialogue similar to how Kaye uses it in his Cult missions these are typically for a come back tomorrow situation - however I was thinking of using it for an extended time - 21 days

The NPC who has the dialogue is not yet on a schedule - will the way MW clears out data every 72hrs impact the localdayspassed script? If so if I put the NPC on a schedule will that prevent the problem?

Thanks in advance for any replies - Illy
User avatar
Rinceoir
 
Posts: 3407
Joined: Thu Jun 29, 2006 1:54 am

Post » Sat May 28, 2011 1:12 am

Here's something from this thread's early days (Has it really been 1.5 years since you started it? :blink:)

For anybody interested, I've found in my archives an interesting post by CDCooley explaining variables persistance much better than myself :)
Variables in local scripts (attached to items from the CS) keep their values forever. The true global variables keep their state forever. Variables in global scripts (the ones that are listed if you use SV in the console with no objects selected) can forget their values under one very specific case. If the script isn't used between the time the game is loaded and then saved again, any old values from the previous save game file will be lost since the game assumes that if you didn't run it this time, it must not be important. So if you want a global script to remember it's values you have to make sure it gets run at least once every time a game is loaded.

The "72 hour bug" affects NPC stats and other values you might change from within scripts, but the scripts themselves aren't affected. Companion mods actually use the variables in a script to keep track of the companion's stats and skills since any changes to the NPC itself can disappear if you leave it alone too long.


So your local variable should be safe from the 72 hour cleaning operations.

B
User avatar
Noely Ulloa
 
Posts: 3596
Joined: Tue Jul 04, 2006 1:33 am

Post » Sat May 28, 2011 3:54 am

Here's something from this thread's early days (Has it really been 1.5 years since you started it? :blink:)


So your local variable should be safe from the 72 hour cleaning operations.

B


Thanks BHL - groan I can't believe my question was already answered earlier in my own thread - sigh - however I can believe that the thread is 1.5 years old though - it feels a lot longer and I still haven't finished the mod - bigger sigh

Anyway it was a good quote - it needs to be in the next MWSFD if there ever is one as it is useful info - and makes some of my quests easier.

Good to see you still around :)
User avatar
Maria Garcia
 
Posts: 3358
Joined: Sat Jul 01, 2006 6:59 am

Post » Sat May 28, 2011 8:39 am

I have a quest where the player needs to be wearing Exquisite Clothing while in a room.

Now the emphasis is on wearing the item not just having it in their inventory

In dialogue I want the quest giver to be able to check a local variable in the script to see if they are wearing the clothes or not - I know how to filter the dialogue for this and I know how to do the ordinator style ONPCequip script

However I don't want to put a script on all exquisite clothing as it is only required for this one quest in one room.

So is it possible to have the script on an activator in the room instead of on the item in order to check if it is equipped or not?
User avatar
Charlotte Henderson
 
Posts: 3337
Joined: Wed Oct 11, 2006 12:37 pm

Post » Sat May 28, 2011 6:36 am

Make a special greeting for that character (put it into Greetings 1 so that it wouldn't be overridden by other possible greetings) and StartScript from its action box a script that checks HasItemEquipped for your items and sets the local var accordingly.
User avatar
Cat
 
Posts: 3451
Joined: Mon Dec 18, 2006 5:10 am

PreviousNext

Return to III - Morrowind