Jump to content

Fallout New Vegas GECK & Scripting Help 101


Recommended Posts

Well, it seems to work:

 

This is my little effect script. Now I have to add some variables to start some approaches from the affected creatures.

scn aaSAMperfumeGeckoSCRIPT



ref rZActor
ref rCreatureFaction
int iDoOnce

begin ScriptEffectStart

	if iDoOnce == 0
		showmessage aaSAMperfumeGeckoOnMSG
		set iDoOnce to 1
		set rZActor to PlayerRef
		Set rCreatureFaction to GeckoFaction
		rZActor.addToFaction aaSAMfaction 1
		SetAlly aaSAMfaction rCreatureFaction 1 1
	endif
End

begin ScriptEffectFinish
	if iDoOnce == 1
		showmessage aaSAMperfumeGeckoOffMSG
		set iDoOnce to 0
		set rZActor to PlayerREF
		Set rCreatureFaction to GeckoFaction
		rZActor.RemoveFromFaction aaSAMfaction
		SetEnemy aaSAMfaction rCreatureFaction 1 1
	endif

end

But thats all for this weekend. I am happy enough to switch some Geckos from hostile to peacefull by gulping a potion ... and by switching them back by waiting two hours game time ...

 

Once again: Thank you all!

Link to comment

@A.J.:  The Google one is the one that I used to use until I ran into his site on accident.  His site (the one I linked earlier) has a more recent date on it (Feb as opposed to Nov) and actually has some (all?) of the NX functions on it.  Hopefully it will load for you today.

Link to comment

 

@DoctaSax:

Making a custom faction! Adding and removing the Player/Ally/Enemy-faction as I need it ... That sounds brilliant! If it works I would not have to care about anything another mod does!

 

Well, yes, that's the advice I'd give with mod compatibility in mind - and if you change faction relations between vanilla factions, including the playerfaction, those changes would stick in your save game even if a player uninstalled your mod. So you'd not only need to keep track of the previous relationship between factions if you want to revert your changes at some point in your questline or whatever, but also need to revert it as part of some sort of pre-uninstall sequence. Custom factions on the other hand, when you uninstall the mod, they're gone.

 

I'm not absolutely sure on how to answer A.J.'s comment though. Information on how all this works is rather scarce - the only things I've found so far were in the Oblivion CS wiki & things have changed since then (they didn't have setally, setenemy, & some of those drop-down entries in the AI tab back then), and NPCs deciding to attack or not is not just dependent on faction relations, but personal AI (aggression, assistance, confidence) too.

What I've done so far in Spunk is hedge my bets by using both SetAlly & SetFactionReaction:

SetAlly VanillaFaction CustomFaction ; banking on "Allies cannot attack each other under any circumstances" in this wiki page.
SetFactionReaction VanillaFaction CustomFaction 100 ; extra massive disposition boost

(Edit: bloody code box didn't save my link)

And, well, haven't had any complaints there - although that doesn't necessarily mean much.

 

(Alternatively, you could add everyone from the vanilla faction to the custom faction, boost the faction reaction from custom faction to custom faction, and add the player there too, in which case that *should* also override any negative feelings, but would require some looping etc.)

Link to comment

Random:  From the Geck Wiki, Frenzied NPCs (Confidence setting) can't ally with anything. ("Will attack anyone else. Cannot be set to be Friend or Ally to anyone. Will never form combat groups with any other actor. (This is mainly for use with creatures [ants and some robots?] that can have their "brain" destroyed, but certain actors could be set up as Frenzied aggression level.)")

 

DoctaSax:  Would you like to give me the pitch for why as a player I would want to use Spunk right now?  I know that it is being/will be integrated into more mods and will either be bundled into Sexout or will be mandatory like SCR.

Link to comment

Random:  From the Geck Wiki, Frenzied NPCs (Confidence setting) can't ally with anything. ("Will attack anyone else. Cannot be set to be Friend or Ally to anyone. Will never form combat groups with any other actor. (This is mainly for use with creatures [ants and some robots?] that can have their "brain" destroyed, but certain actors could be set up as Frenzied aggression level.)")

 

DoctaSax:  Would you like to give me the pitch for why as a player I would want to use Spunk right now?  I know that it is being/will be integrated into more mods and will either be bundled into Sexout or will be mandatory like SCR.

 

I'm not sure if it's much of a pitch, but here it is:

 

 

On its own, at the moment it does cum textures and the creature smell faction thing; I'm also working on moving over lust & arousal in a way that all that is nicely integrated (ie post-orgasm application of cum textures while sex is still ongoing etc) as well as fixing up a few other things. Other uses depend on how fast we can get to a method of applying textures on a per-location basis, which is where I hope the underlying scripting will really/finally be made to shine because it already tracks everything per location - it just doesn't show it yet. But that's still up in the air. And of course, Pregnancy should at some point move to use Spunk as a carrier/delivery system for sperm, facilitating paternity testing and the use of custom races there. Add to that that everything in it is toggleable (the same will go for whatever I add) and that it's already fully TTW/all DLC-compatible when it comes to taking into account their species, races, & factions. Ideally, I'd also like to look into how to interface with SOSReplacer & the intimacy project for some of the lust/arousal stuff. So yeah, lots of things to juggle, not all of them nearly done yet, but quite exciting nonetheless, even if it's more of a modder's mod than a player's mod - atm.

 

Link to comment

Hmmm.  I think I may have stumbled onto a trick. 

 

Problem: Startconversation does not work with some NPCs while they are sitting.

Standard Solution: Put a travel/do nothing package in front of the startconversation.

 

However, I just got this working on NPCs who previously had this problem, only without using a package.  I simply toss a 'ref.RemoveScriptPackage' at them (no package needed) before startconversation, and all of a sudden the startconversation works for sitting NPCs.

 

Someone should confirm this though, so I know I'm not imagining things.

Link to comment

Using GetRandomPercent in Dialogue Conditions:

 

I want a companion to choose one of four different destinations to go to when fired.  If  0<= num <= 24, go here, etc.  Do I put two GetRandomPercent conditions with the min and max for each dismiss to location dialogue, or do I need to assign the random number to a quest var before that and then use quest var >= or <?

 

Essentially, does anyone know if GetRandomPercent is used in more than one condition if a random number is generated for EACH condition or if just ONE number is generated and then compared in both conditions?

Link to comment

Using GetRandomPercent in Dialogue Conditions:

 

I want a companion to choose one of four different destinations to go to when fired.  If  0<= num <= 24, go here, etc.  Do I put two GetRandomPercent conditions with the min and max for each dismiss to location dialogue, or do I need to assign the random number to a quest var before that and then use quest var >= or <?

 

Essentially, does anyone know if GetRandomPercent is used in more than one condition if a random number is generated for EACH condition or if just ONE number is generated and then compared in both conditions?

 

You'll get a new number every time it's called.  Why not just make the dialogue entries random, and eliminate GRP?

 

Link to comment

Be...because...the hard way is...awesome?  I guess if I put them all with the random flag but they had different conditions (has the L38 suite yet, Y/N?), those conditions would still be evaluated.

 

Yeppers.  Then section them off with random ends, if for nothing else to keep track of random sets.

 

Link to comment

Hmmm.  I think I may have stumbled onto a trick. 

 

Problem: Startconversation does not work with some NPCs while they are sitting.

Standard Solution: Put a travel/do nothing package in front of the startconversation.

 

I was wondering: why not using a Find package instead, or a dialogue package in an extended range? or did I misunderstand what you are going to do?

Link to comment

 

Hmmm.  I think I may have stumbled onto a trick. 

 

Problem: Startconversation does not work with some NPCs while they are sitting.

Standard Solution: Put a travel/do nothing package in front of the startconversation.

 

I was wondering: why not using a Find package instead, or a dialogue package in an extended range? or did I misunderstand what you are going to do?

 

 

Yep. lol

 

I was pointing something out from a few posts back where jaam and pride were talking about startconversation not working on sitting NPCs.  The package doesn't matter so much.

 

Link to comment

Be...because...the hard way is...awesome?  I guess if I put them all with the random flag but they had different conditions (has the L38 suite yet, Y/N?), those conditions would still be evaluated.

 

In some quest GameMode block add

set iRand to GetRandomPercent

set iRand2 to GetRandomPercent

 

Then you can add a MyQuest.iRand < 25 dialogue condition. I do this, because I want rands for various things sometimes. I haven't used the following, but they are perhaps smarter.

 

Skip the GameMode block part, just have the variables.

Create a scripted token with OnAdd / set MyQuest.iRand to GetRandomPercent / RemoveMe. Then do an additem MyToken to generate MyQuest.iRand during dialogue.

 

Or you could use a quest with a MenuMode 1009 block, that should run only during dialogue, but I had trouble getting that to work.

Link to comment

 

 

Hmmm.  I think I may have stumbled onto a trick. 

 

Problem: Startconversation does not work with some NPCs while they are sitting.

Standard Solution: Put a travel/do nothing package in front of the startconversation.

 

I was wondering: why not using a Find package instead, or a dialogue package in an extended range? or did I misunderstand what you are going to do?

 

 

Yep. lol

 

I was pointing something out from a few posts back where jaam and pride were talking about startconversation not working on sitting NPCs.  The package doesn't matter so much.

 

I will look into this. It's not just when they're sitting though, it's when they're moving to sit down as well -- executing some other package. The biggest jerk in this whole thing was motorrunner in fiends tryout. He has (had) an extensive callback sequence with dialogue and it would break quite often because he'd be walking back to his throne after sex when the startconversation fired.

 

I made that whole thing to get the last conversation partner to overcome this, and the dialogue callbacks call startconversation repeatedly until it finally happens.

Link to comment

 

I made that whole thing to get the last conversation partner to overcome this, and the dialogue callbacks call startconversation repeatedly until it finally happens.

 

 

One time I had this issue, at last I added a top-level-topic-line similiar to the callback conversation to the npc. So the player can talk to the npc if the callback doesn't work. This is not realy smart, but you can keep on playing without reloading ;)

 

Link to comment

Yeah there are other ways as well.

 

Sewerslave used to use quest stages for this. It would so something like set the quest stage to 20, and it's quest script running on the normal 5s clock (maybe 1second) kept issuing startconversation. The dialogue itself then raised the stage to say 25. After sex completed it would go to 30, which would be doing a different startconversation.

 

That's something that is simple and works fine in a standalone mod, but sexout itself can't use it, since any number of acts can be going on at once and I can't have an infinite number of quests all in different stages.

Link to comment

T:  Are you accomplishing this by creating a blank travel/something package, getting the NPC as a target, and then assigning the package and .evp?  I will eventually need to do this, and understanding is awesome.

 

Not anymore.  I still use a travel package in certain situations, sometimes I use a sandbox or wander.  But only when I need them to get up from sitting, or as a simulated wait/pause, or to get them in range of the PC for various reasons.

 

For startconversation on sitting/idled NPCs, now I just toss a 'ref.RemoveScriptPackage' at the NPCs right before startconversation.  The result has been that the sitting/idled NPCs that previously either A. Ignored the startconvo altogether, or B. Got up from sitting when I didn't want them to, now work flawlessly (so far).

 

None of these NPCs are running any added packages, only AI packages.

 

Link to comment

mr t3589

you know what, I think it makes sense that it doesn't work when they are going to sit on a chair. I don't remember if this happens on Fallout (but I feel it happens), I don't play since a while... but on skyrim in game you can't speak with a character that is starting/ending an idle like "lean on the wall" or "sit on chair". When they are doing a start/end transitional animation, if you activate them nothing happens even if you spam the E command. Thinking about it, I guess it happens to all the start/end animation kinds, those that are used only for transition, because when the "real" animation (like the character sitting on the chair) is looping, a dialogue works. So yes after this long unuseful stream of consciousness I would say it's an hardcoded thing: dialogue package but also other kinds of interaction won't occur when a start/end animation is playing. I would underline that "other kinds of interaction", I expect you can have other issues like the one of the dialogue

Link to comment

That's what I've seen as well, but it's got to do with the packages as he says and not simply the animation. Playing a particular idle doesn't, in itself, inhibit interaction. The walking idle played when walking to a chair to sit is no different from the normal walking animation. Something in the engine is probably preventing conversations from starting depending on the package being executed.

 

Fiddling with package flags and testing might reveal which flags (or combination of flags) causes this to happen.

Link to comment

That's what I've seen as well, but it's got to do with the packages as he says and not simply the animation. Playing a particular idle doesn't, in itself, inhibit interaction. The walking idle played when walking to a chair to sit is no different from the normal walking animation. Something in the engine is probably preventing conversations from starting depending on the package being executed.

 

Fiddling with package flags and testing might reveal which flags (or combination of flags) causes this to happen.

 

I think I explained bad. There are many vanilla animations that are made by different "phases", like a start (from standing up to sitting on the chair), then a loop (he sits, and he moves slightly, he looks around him etc.) and then an end (he stands up to go away). now I don't know how to make these transitional animations nor how to link them, but I feel there's something inside of them. If a npc is using a travel package with destination a chair or a sandbox package with a linked chair etc.etc.etc. when he is walking there, you still can interact with him, but when he approaches the chair and the new animation triggers, you stop your interaction with him until he is completely sitting on the chair. It's just this little transition that leasts like 2 seconds that prevents it, that's why I think it's something inside the transition animation and not in the package itself. Another example is attacking someone who's sitting on the floor, it's nice how in skyrim I can approach 3 bandits around a campfire and kill them all with my bow before they manage to stand up and run away/attack back. I mean I shoot an arrow to someone sitting, he starts to stand up, I shoot a second arrow while the animation is playing, it doesn't break the animation or what, he continues on it until he's completely on feet. Now it would be nice to try what happens during this transition if I trigger a pushactor... I feel it won't work... I'm going to FONV and throw a grenade during this transition, let's see if it works or not...

 

But... anyway packages involving movement on skyrim seem working slightly different than in fallout from what I've seen, so this could be different of course.

Link to comment

 

That's what I've seen as well, but it's got to do with the packages as he says and not simply the animation. Playing a particular idle doesn't, in itself, inhibit interaction. The walking idle played when walking to a chair to sit is no different from the normal walking animation. Something in the engine is probably preventing conversations from starting depending on the package being executed.

 

Fiddling with package flags and testing might reveal which flags (or combination of flags) causes this to happen.

 

I think I explained bad. There are many vanilla animations that are made by different "phases", like a start (from standing up to sitting on the chair), then a loop (he sits, and he moves slightly, he looks around him etc.) and then an end (he stands up to go away). now I don't know how to make these transitional animations nor how to link them, but I feel there's something inside of them.

 

..snip..

 

I'm going to clarify something and then move on to a bit of stream of consciousness. So we're not talking past one another, when you say something "inside of them", if "them" means the actual animation files (the .kf's), then that isn't it. The file format is simply not complex enough to support that kind of behavior. They can't affect NPC behavior any more than textures can, from an AI/interactivity standpoint.

 

The animation settings in the geck are likely not to blame either; again, too simple.

 

The looping behavior is actually really simple. If an animation is 50 frames long and 30fps, it may have a 10 frame 'intro' and a 10 frame 'outro', with a 30frame middle section. The animation file does have two values in it that tell the engine where to start and stop looping, if the animation loops. In the settings in the GECK you can say "loop forever" (all sexout animations have this set), or you can set the min and max # of times to loop the animation.

 

Those settings don't affect AI or interactivity though.

 

Now, the engine might do something special depending on the group the animation is placed in. (This makes me think of a potential fix to the FAFF thing, gah!)

 

What I suspect is actually going on is something internal to the engine. For example sleeping and sitting are not just transitional from the point of view of an animation, they are transitional within the actor state as well. Somewhere, the engine is deciding what to return when you ask it GetSleeping or GetSitting. I'll bet dollars to donuts that when an actor is told to stand from sitting (or laying), that the engine "locks" them for interaction until that's done -- and the duration of that lock was simply modeled around how long the animations for those actions take.

 

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.

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.

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