Jump to content

also need an assist with scripting


sullyvanj93

Recommended Posts

Hey guys, I am so close to finalizing a companion mod of mine, but I am having an awful time with getting the idle chatter dialogue to work right. As of right now, he talks way too much. Like he will cut himself off to start saying another line.

 

I've reverse engineered a few other companion mods to see how they did it and have gotten a few ideas on how I need to shape my own, but I am so far away from understanding script.

 

I am hoping to have him say a random chatter every 180 seconds (if I could have a script that makes it a 50% chance to say something every 120 seconds, that'd be all the better. But not a necessity.)

 

I was thinking a script like:

 

scn [scriptname]

 

short status ;0=sandbox, 1=waiting, 2=following, 3=issneaking, 4=isininterior, 5=isincombat

 

begin GameMode

If Timer > 1

Set Timer to timer - getsecondpassed

 

if Timer <= 1

 

[REF].Say [ChatterDialogueLine]

set Timer to 180

end if

end

Then I have my [ChatterDialogueLine] contain dozens of lines of dialogue flagged at random and say once a day, with the conditions including: following, not sandboxing, not waiting, not sneaking, not indoors, and not in combat.

But something isn't right about the script (again, I'm very new to scripting). Anyone able to help me make above script work? or even better adding the 50% chance into the script?

 

thanks either way

Link to comment
Share on other sites

That's the right idea. The more conditions you check in the chatter quest script itself, the less conditions you have to copy & paste between your chatter infos. Something like this.

SCN ChatterQuest

FLOAT Timer

BEGIN GameMode

if TheREF.IsInCombat == 0 && TheREF.IsSneaking == 0
   // you can also check wait/sandbox command status here
   if Timer > 120
      if GetRandomPercent < 50
         TheREF.say [ChatterDialogueLine]
      endif
      set Timer to 0
   else
      set Timer to Timer + GetSecondsPassed
   endif
endif

END

Then you can use GetInCell and similar conditions in the infos to enable location-specific chatter.

Link to comment
Share on other sites

Thanks so much for the response.

As far as location-specific chatter, I have those guys using a separate script, and they are working just fine. This one is just for the random chatter the companion will say while traveling.

I tried using your example script, using my own REF and dialogue line of course, and while I didn't have any geck PU errors, when I went in game it didn't initiate the dialogue at all.

I wanted to check to see if I was just really unlucky with the GetRandomPercent, so I removed that temporarily so that every 2 minutes, he should say something, but he still was silent :/ not sure whats going on.

 

 

 

 

scn TJMTemuIdleChatterScript

Float Timer
Begin GameMode
if TJMTemuREF.IsInCombat == 0 && TJMTemuREF.IsSneaking == 0
if Timer > 120
if GetRandomPercent < 50
TJMTemuREF.say TJMTemuChatterDialogue
endif
set Timer to 0
else
set Timer to Timer + GetSecondsPassed
endif
endif
END

 


Any ideas as to whats preventing the dialogue from firing?
Link to comment
Share on other sites

That's the right idea. The more conditions you check in the chatter quest script itself, the less conditions you have to copy & paste between your chatter infos. Something like this.

SCN ChatterQuest

FLOAT Timer

BEGIN GameMode

if TheREF.IsInCombat == 0 && TheREF.IsSneaking == 0
   // you can also check wait/sandbox command status here
   if Timer > 120
      if GetRandomPercent < 50
         TheREF.say [ChatterDialogueLine]
      endif
      set Timer to 0
   else
      set Timer to Timer + GetSecondsPassed
   endif
endif

END

Then you can use GetInCell and similar conditions in the infos to enable location-specific chatter.

 

 

I did get your script working after all. For some reason the <50 get random percent was hardly EVER happening. I mean I heard one piece of chatter in 20 minutes of play time (which was why I thought it wasn't working at all).

 

So I changed it to >33% and every 60 seconds, and I like the frequency a lot better.

 

Either way, his idle chatter is functional and at an (I think) expectable and realistic rate.

 

Thanks for your help Belthan!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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