Jump to content

Fallout New Vegas GECK & Scripting Help 101


Recommended Posts

I've never seen an NPC ignore a startconversation because of a transition.  In fact I use startconvo sometimes to initiate transitions (like when I desire them to get up from sitting).  I'm guessing it's possible though, with some really unlucky timing.

Motorrunner will fail to startconversation consistently while he's walking back to his chair, if you've moved him from it. This is why the (currently disabled) fiends tryout intro scene with him has him walking back to his chair and sitting down between every callback -- sexout is calling startconversation repeatedly during that time.

 

There are others it fails with in a similar manner.

 

It's not an animation thing (he's just walking) and it's not during what I would consider a transition period either, but it's worth a shot to look at. I think it's package related as well.

 

It's possible (and likely) that there are many actor states that can cause it to fail.

Link to comment

I should add that the NPCs I used that on were not in transition.  They were just sitting.  However, it does seem to behave differently for different NPCs.  Most NPCs (mainly named NPCs that I can tell) don't need any coaxing, while some generics do.  For example a goodsprings settler sitting on a 'sit on the ground' idle ignores startconversation, but sitting on furniture they don't.  In contrast, NPCs like say Easy Pete (who sits a lot) startconversation works every time.

 

I've never seen an NPC ignore a startconversation because of a transition.  In fact I use startconvo sometimes to initiate transitions (like when I desire them to get up from sitting).  I'm guessing it's possible though, with some really unlucky timing.

 

I'm leaning towards prides assessment that it's package related.  It's not that startconvo isn't firing, I've at least confirmed that.  It is firing, but is then being rejected or overridden so fast that the NPC doesn't even twitch.  And that I suspect (but don't know) is due to AI packages refusing to let them re-eval.  I think the removescriptpackage simply forces them to re-eval, and since the next line is Startconversation, it picks it right up.  I expect resetAI would have the same effect.

 

Well this changes things. I was making that example because I didn't try it on FONV, but I can assure you that on Skyrim they refuse a manual start of dialogue (if you press E) while they are transitioning but not when they are looping their usual animation.

 

ResetAI breaks a sitting animation so I wouldn't use it to understand better this behaviour.

 

Prideslayer's example of motorrunner in my opinion really shows how is the package which is creating issues and not the transition itself. But I can tell something more about it, I wrote it few days ago in this thread. Why my single-one-shot-script with startconversation loops forever, leading to the npc continuing to greet me after I say goodbye, until I ResetAI him? why a simple evp doesn't work? he should sandbox, but after I trigger a single startconversation he won't stop speaking me.  I suppose this behaviour too, it is dumb-package related, animations don't really mean anything.

 

In substance, I suppose I was speaking about something else.

My concern about transitions is because they seems to have only two differences between the dynamic idle linked to them. The sit idle is a loop while the transition is clamp, and I'm sure this doesn't create issues. But the second difference is that transitions use a blend attribute to... (blend them together?) what I'm wondering is if two animations blended together create this lack of interaction with the "external world". It's not very much useful to know that concerning packages and animations, but it's useful for other things I have in mind that let me understand better the magic world of animations

Link to comment

 

It's not that the animation itself is causing the issue, the engine transition is. You could replace the stand and sit animations with other ones and the issue would remain.

 

GetSleeping and GetSitting both return many values though, not just true/false, which I didn't know until just looking them over. Checking the results of these may fix some of the sexout issues. For example, GetSitting returns:

 

0 = not sitting

2 = getting ready to sit

3 = sitting

4 = getting ready to stand.

 

I bet in 2 and 4, the engine has disabled interaction.

 

GetSleeping is similar.

 

 

I use loops in that way, when I need a transitional animation and then a loop, I include them in the same animation and then I use the loop on the last part. But it's because I really don't know how to split it in more single animation files, like vanilla does.

 

It is what I was meaning, Prideslayer. Not that the kf itself has the power to "block" the engine, but that the engine answers with a block because it notices there's a transitional animation. I think there should be something that links the 2 and 4 state with something more "concrete", less abstract, something that is visible in GECK or on the kf. Like the blend attribute in the kf. I think that because if one day they decide to replace a sit animation, they simply would change that file with another one giving the same attribute / or changing the same thing inside the geck. I can't believe that state 2 and 4 are hardcoded themselves, it would be silly in my opinion.

 

Link to comment

Well this changes things. I was making that example because I didn't try it on FONV, but I can assure you that on Skyrim they refuse a manual start of dialogue (if you press E) while they are transitioning but not when they are looping their usual animation.

Skyrim is a very different engine bud.. :)

 

Prideslayer's example of motorrunner in my opinion really shows how is the package which is creating issues and not the transition itself. But I can tell something more about it, I wrote it few days ago in this thread. Why my single-one-shot-script with startconversation loops forever, leading to the npc continuing to greet me after I say goodbye, until I ResetAI him? why a simple evp doesn't work? he should sandbox, but after I trigger a single startconversation he won't stop speaking me.  I suppose this behaviour too, it is dumb-package related, animations don't really mean anything.

Startconversation on its own will not do that. If you're calling it from within a script in a package, then it can. Calling EVP and the like when you're in menumode (which conversations are) does not work.

 

My concern about transitions is because they seems to have only two differences between the dynamic idle linked to them. The sit idle is a loop while the transition is clamp, and I'm sure this doesn't create issues. But the second difference is that transitions use a blend attribute to... (blend them together?) what I'm wondering is if two animations blended together create this lack of interaction with the "external world". It's not very much useful to know that concerning packages and animations, but it's useful for other things I have in mind that let me understand better the magic world of animations

This isn't how animations in FONV work. Are you still talking about skyrim? FONV cannot blend animations. One animation can play on a bone at a time, that's it. The only combining of animations that FONV supports is playing two animations at once that use different bones -- for example walking (legs) + reloading gun (hands).

Link to comment

In testing DRL, I eventually gave up on sitting during conversations because I'd sometimes get caught off-guard by an NPC starting a conversation, which I assume, was the reason behind some crashes.  I didn't feel that it was worth pursuing, especially since after you have a conversation, your character gets up immediately anyway (or that's my experience).

 

PS - Don't do anything, T.  This was many moons/versions ago, and I haven't gotten around to firing up the latest version. 

 

And now for something completely different:

 

In the GECK, Arcade has a total of 42 SPECIAL points.  While I can set them for mine, when I set my companion to level with the player, it defaults them down to 36.  When I opened it in FNVEdit, I didn't see the SPECIALs or Skill value listed.  I realize that I could setav the stats for her when the mod initializes.  I looked at Arcade's script, and nothing affected his values.

 

I don't have Willow or Niner installed currently to see if/how they handle it.  I've got Wendy installed, but she's just got the base 36.

Link to comment

"Skyrim is a very different engine bud.. :)"

 

ok don't look at the graphic itself or the skeletons or papyrus, but... Creation Kit  doesn't make you think the contrary? :D

 

"Startconversation on its own will not do that. If you're calling it from within a script in a package, then it can. Calling EVP and the like when you're in menumode (which conversations are) does not work."

 

I call it on a OnTriggerEnter - doonce. After that, the only way to stop conversation is resetai inside the End dialogue script, or it will start conversation forever. I still have to understand WHY, but resetAI is the only reliable solution I've found till now. These little incongruities make me really LOVE the geck...

 

This isn't how animations in FONV work. Are you still talking about skyrim? FONV cannot blend animations. One animation can play on a bone at a time, that's it. The only combining of animations that FONV supports is playing two animations at once that use different bones -- for example walking (legs) + reloading gun (hands).

 

Yes I was speaking about FONV. Blend attribute is used in transitional/clamp animations. While you're right one animation can play a single bone, I suppose they use it to blend the bones they have not animated in the second animation.

Oh and by the way, I know about group animations and their interactions, but if you manage to work with them inside the Idle Settings menu (i.e. changing SpecialIdle to Attack etc.) please tell me where's the trick. I realized only changing that doesn't work, but I really would love to work with group animations.

Link to comment

I use loops in that way, when I need a transitional animation and then a loop, I include them in the same animation and then I use the loop on the last part. But it's because I really don't know how to split it in more single animation files, like vanilla does.

 

It is what I was meaning, Prideslayer. Not that the kf itself has the power to "block" the engine, but that the engine answers with a block because it notices there's a transitional animation. I think there should be something that links the 2 and 4 state with something more "concrete", less abstract, something that is visible in GECK or on the kf. Like the blend attribute in the kf. I think that because if one day they decide to replace a sit animation, they simply would change that file with another one giving the same attribute / or changing the same thing inside the geck. I can't believe that state 2 and 4 are hardcoded themselves, it would be silly in my opinion.

There isn't.. there's nothing in the geck that links those states together, it's buried within the engine. The engine (and scripts) can check to see if an animation is playing, so replacing one sitting animation with another of a different length might still work, but it might not. Note I said it can check, not that it is doing so.

 

There's lots of silly in the geck, do not let that be a barrier to believing it behaves the way it does. ;)

 

The states are hardcoded because the animation is not actually linked to (or important to) the act of sitting. You're approaching it from a sort of anthropomorphic viewpoint, but game engines don't work that way. The core of the difference between sitting and not sitting is a simple flag on the actor that doesn't have anything to do with their skeleton, animations, or other aspects of the appearance of the 3D model.

 

Likely what happens is simply a Sit() type function on the actor is called which looks something like this.

 

1. If sitting_state != 0, return
2. sitting_state = 2
3. PlayIdle sitdown
4. While IsAnimPlaying SpecialIdle, wait.
5. sitting_state = 3
6. return
There are also other animation states an actor can be in. See the GetAnimAction and IsAnimPlaying functions, as well as the AnimGroup page.
Link to comment

"Skyrim is a very different engine bud.. :)"

 

ok don't look at the graphic itself or the skeletons or papyrus, but... Creation Kit  doesn't make you think the contrary? :D

In many respects I believe they wholesale copied from gamebryo. However, skyrim uses havok behaviors for actor animations, which are much more complex and powerful. FONV uses netimmerse (gamebryo) animations, which skyrim only uses for 'dumb' objects like doors.

 

I call it on a OnTriggerEnter - doonce. After that, the only way to stop conversation is resetai inside the End dialogue script, or it will start conversation forever. I still have to understand WHY, but resetAI is the only reliable solution I've found till now. These little incongruities make me really LOVE the geck...

What do you mean doonce? Triggers will fire repeatedly if you don't check a condition inside them, and change it.

 

Yes I was speaking about FONV. Blend attribute is used in transitional/clamp animations. While you're right one animation can play a single bone, I suppose they use it to blend the bones they have not animated in the second animation.

Oh and by the way, I know about group animations and their interactions, but if you manage to work with them inside the Idle Settings menu (i.e. changing SpecialIdle to Attack etc.) please tell me where's the trick. I realized only changing that doesn't work, but I really would love to work with group animations.

The group is in the KF file and the GECK both. I have no idea which one takes priority, maybe they both have to match. I'm digging into that in more detail now, to try and get the FAFF stuff working. The NiControllerSequence has a txt name field that is (usually) set to the same name as the anim group, but I've seen them say different things or be completely missing.

 

There is a chance that other TXT blocks in the kf's could be influencing the engine as well I suppose; have you looked at any of the ones that behave differently for you to see if that's the case?

Link to comment

What do you mean doonce? Triggers will fire repeatedly if you don't check a condition inside them, and change it.
 

begin ontriggerenter player

 

if doonce == 0

 npc.start conversation player

 set doonce to 1

endif

 

after passing through the trigger, the npc walks toward me, and me toward him. he starts speaking. after that, the only way for me to not make him startconversation again is "breaking" him with a resetai inside the goodbye topic. this happens everytime I make a trigger zone like that. Now this example is explained in many tutorials, with the same code etc. It's one of the first things I did in a mod. But they all use evp inside the end result script of the dialogue, they don't use resetai

 

There is a chance that other TXT blocks in the kf's could be influencing the engine as well I suppose; have you looked at any of the ones that behave differently for you to see if that's the case?

I checked the sitting on floor animation, is the only one I remember with a begin and a end (enter and exit). I really would loved to know how to switch automatically between an animation to another. The enter and exit are clamps and they have this inside NiTextKeyExtraData: Value - String - Blend. Other dynamic loops miss the Blend data.

 

Referring to your example about sitting and how it is tied to the code, look at this:

4. While IsAnimPlaying SpecialIdle, wait.

I can agree there could be dumb things inside the code, but I really think the engine checks the kf itself or you couldn't change the animation with another one. If it was so much hardcoded, it means the code would have at least some timing like "don't do anything in the next 2 seconds because I triggered the transitional animation and it leasts 2 seconds", then the animator had no possibility to make that animation leasting 3 seconds because the code would have break the transition to replace it with the other animation (if the code doesn't check the animation, how it is supposed to know how it leasts). If, as I think, the engine works with the animation in a biunivocal way, it triggers it but also checks if it's still playing. For the same reason, maybe it could understand if it's a transitional animation or a loop and act in a different way. Awww sorry it's hard for me to explain this all

Link to comment

What do you mean doonce? Triggers will fire repeatedly if you don't check a condition inside them, and change it.

 

begin ontriggerenter player

 

if doonce == 0

 npc.start conversation player

 set doonce to 1

endif

You have this in the wrong order. Doonce is never getting set and startconversation is getting called repeatedly *if* the actor is close enough that startconversation happens immediately. Do it like this instead:

 

if doonce == 0
 set doonce to 1
 npc.startconversation player
endif
 

Referring to your example about sitting and how it is tied to the code, look at this:

4. While IsAnimPlaying SpecialIdle, wait.

I can agree there could be dumb things inside the code, but I really think the engine checks the kf itself or you couldn't change the animation with another one. If it was so much hardcoded, it means the code would have at least some timing like "don't do anything in the next 2 seconds because I triggered the transitional animation and it leasts 2 seconds"

No, it wouldn't. The engine can easily determine if the animation it said to play with the internal version of PlayIdle has completed or not, no matter how long it takes. Not everything it does or can do is exposed in the GECK.

 

It would be more along the lines of what I put there.. not "wait 2 seconds" but "wait until anim finished." The GECK does expose IsAnimPlaying, all the engine has to do is wait until that goes from true -> false.

Link to comment

You have this in the wrong order. Doonce is never getting set and startconversation is getting called repeatedly *if* the actor is close enough that startconversation happens immediately. Do it like this instead:


if doonce == 0
set doonce to 1
npc.startconversation player
endif

 

I sometimes have to capside the order of doonce, setting it on top, but usually when there are many things happening in the same frame. In this specific case I admit I didn't try because the actor is quite far and the conversation starts after he walks toward me and many seconds pass before this happens. This would mean that the script finds startconversation and interrupts its execution only because the npc is ordered to walk toward me. But I'll try that, I tried so many things that if it solves the issue you really made my day.

Link to comment

 I wonder if this call works any differently for you than the standard call?  GECK PU will complain but it does work.

ref.StartConversation player, DialogueTopic ref.ref ref.Player 1 1

Also, whats the max distance for Startconversation?  I've gotten it to trigger at a fair distance (farther than I would expect it to) by setting the movement flag to 0.  I haven't tested every distance but I think it worked at something like 512 or so, which is out of melee.

Link to comment

You have this in the wrong order. Doonce is never getting set and startconversation is getting called repeatedly *if* the actor is close enough that startconversation happens immediately. Do it like this instead:

 

if doonce == 0

set doonce to 1

npc.startconversation player

endif

 

I sometimes have to capside the order of doonce, setting it on top, but usually when there are many things happening in the same frame. In this specific case I admit I didn't try because the actor is quite far and the conversation starts after he walks toward me and many seconds pass before this happens. This would mean that the script finds startconversation and interrupts its execution only because the npc is ordered to walk toward me. But I'll try that, I tried so many things that if it solves the issue you really made my day.

If there is a lot going on in the frame, use a stage instead of a simple 0/1 to split it up so it can run in multiple frames. The script not completing in the frame and being terminated will also prevent your var from being set at the end -- so always set it first.

Link to comment

I wonder if this call works any differently for you than the standard call?  GECK PU will complain but it does work.

ref.StartConversation player, DialogueTopic ref.ref ref.Player 1 1

 

Sweet jesus.. ;)

 

Also, whats the max distance for Startconversation?  I've gotten it to trigger at a fair distance (farther than I would expect it to) by setting the movement flag to 0.  I haven't tested every distance but I think it worked at something like 512 or so, which is out of melee.

The trigger distance? I don't know what the maximum is, but it's quite far. Look at the guy that talks to you the first time you exit the Lucky38 for example, he's a good 512+ away as well. Same with that female fiend manning the door in vault 3.

Link to comment

 

I wonder if this call works any differently for you than the standard call?  GECK PU will complain but it does work.

ref.StartConversation player, DialogueTopic ref.ref ref.Player 1 1

Sweet jesus.. ;)

 

lol  It's the call SmallerTalk uses.

 

Link to comment

 

Also, whats the max distance for Startconversation?  I've gotten it to trigger at a fair distance (farther than I would expect it to) by setting the movement flag to 0.  I haven't tested every distance but I think it worked at something like 512 or so, which is out of melee.

The trigger distance? I don't know what the maximum is, but it's quite far. Look at the guy that talks to you the first time you exit the Lucky38 for example, he's a good 512+ away as well. Same with that female fiend manning the door in vault 3.

 

 

They use AI packages. You can set those to trigger at any distance you want, in theory.

Link to comment

 

 

I wonder if this call works any differently for you than the standard call?  GECK PU will complain but it does work.

ref.StartConversation player, DialogueTopic ref.ref ref.Player 1 1

 

Sweet jesus.. ;)

 

 

lol  It's the call SmallerTalk uses.

 

Far be it from me to question astymma but.. that looks a little mental. ;)

Link to comment

 

 

 

I wonder if this call works any differently for you than the standard call?  GECK PU will complain but it does work.

ref.StartConversation player, DialogueTopic ref.ref ref.Player 1 1

Sweet jesus.. ;)

 

 

lol  It's the call SmallerTalk uses.

 

Far be it from me to question astymma but.. that looks a little mental. ;)

 

 

I think it had something to do with being FO3 compatible or something like that.  I've confirmed it does work.  But what if anything extra it gives you I can't tell.

 

Link to comment

I'm trying to make my scripts more readable after I returned to some after a while. And, judging by the length of my name IDs, Yes.;)

 

I also figured I could make a quest with a short name and getgameloaded block for typedefs, rather than having magic numbers all over the place.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use