Jump to content

Fallout New Vegas GECK & Scripting Help 101


Recommended Posts

Posted

Is there a way to check armor or weapon effect? Not the object effect name\ID, but the effect itself, like "Melee +10", "DT +2", etc. Sure, I can make a list with all the effects and an array with strings and compare everything, but it will take forever and any mod that changes vanilla effects will make my values incorrect =\  And ofc it will not work for custom object effects =(

Posted

I don't think so. A lot of the "magic" got left behind in OBSE.

I would ask in the OBSE forum how would they do that. Based on the  answer we should know if it is feasable to port over.

 

Posted

I believe these are the functions jaam mentioned to get variables:

 

 

"nvse_whatsnew.txt"

     4.1 beta 01 ...  

     GetVariable            looks up the value of a variable by name. If called on a reference, the ref must be scriptable, but not necessary a quest.
            [ref.]GetVariable variableName:string [QUEST:quest]
            
        HasVariable            returns true if the script has a variable with the specified name
            [ref.]HasVariable variableName:string [QUEST:quest]
            
        GetRefVariable        looks up the value of a ref variable by name
            [ref.]GetRefVariable variableName:string [QUEST:quest]
            
        GetArrayVariable    looks up an array variable by name on the calling object or specified quest
            [ref.]GetArrayVariable variableName:string [QUEST:quest]
            
        CompareScripts        returns true if the compiled scripts are identical
            CompareScripts script:formID script:formID
            
        ResetAllVariables    sets all variables in a script to zero, unless called on a reference, apply to the calling script.
            [ref.]ResetAllVariables
            
        GetNumExplicitRefs    returns the number of literal references in a script
            GetNumExplicitRefs script:formID
            
        GetNthExplicitRef    returns the nth literal reference in a script
            GetNthExplicitRef script:formID
            
        RunScript
        GetCurrentScript


 

 

I think the [QUEST:quest] is a typo for some of them, and it should be a ref.

 

--

Sadly, as far as I can tell, the only way to change (not get) values in a reference's script via a variable is "ResetAllVariables". This:

 

ref SomeRef

let SomeRef.Waiting := 1

 

Unfortunately doesn't work even with the compiler override (if it did, then you could add valid refs to an array via buildref, but alas)

Posted

Looking back at it, it does seem strange. Some variables can be changed easily. (the ones that are stored as float). I'll browse through OBSE source code to see if they had something...

 

Posted

I don't think so. A lot of the "magic" got left behind in OBSE.

I would ask in the OBSE forum how would they do that. Based on the  answer we should know if it is feasable to port over.

 

That's strange that no one ever thought about using "Object effect" info before in Fallout games. Maybe because it's not the most important info, and there was no arrays and string vars before.

I hope people in OBSE forum will say something like "Yeah. It's easy." =))

Posted

Works like a charm

 

The only possibilities I can think that let the script not work is in the case of companions with TeamMate not setted to 1. Like Willow until she follows you but she's not still your friend, I guess she has not that setted (when the wheel doesn't appear), anyway it's just a feeling and I should check. Generally, the companions that follow and have no wheels, like the main guy in the Inheritance, the one you must kill, or like my Nina, I guess them all have no TeamMate setted to 1.

But that's definetely a generic and nice solution, I didn't think about a scanner to handle them all, I was thinking to Buildref them one by one and set the Waiting variable with Lutana's plugin (to not make patches with them as masters). I definetely will steal your idea. Just to say. :P

Posted

 

Works like a charm

 

The only possibilities I can think that let the script not work is in the case of companions with TeamMate not setted to 1. Like Willow until she follows you but she's not still your friend, I guess she has not that setted (when the wheel doesn't appear), anyway it's just a feeling and I should check. Generally, the companions that follow and have no wheels, like the main guy in the Inheritance, the one you must kill, or like my Nina, I guess them all have no TeamMate setted to 1.

But that's definetely a generic and nice solution, I didn't think about a scanner to handle them all, I was thinking to Buildref them one by one and set the Waiting variable with Lutana's plugin (to not make patches with them as masters). I definetely will steal your idea. Just to say. :P

 

 

Oh that's a point. I suppose one can't account for all possibilities given the limitations. I was mainly trying to handle Willow, Brisa and my Bittercup companion without adding masters or making patches. The thing is, with Bittercup I can add conversations specifically for her but can't tell her to wait. The best I can seemingly do with Brisa and Willow is make a generic female conversation that kicks in for ANY non-vanilla companion.

 

You know, I wonder if adding.. say a temporary sandbox or some other package would effectively override companions following the player around? Might give that a try for my next crazy scenario.

 

Incidentally, does anyone know of a way to get the GECK to generate lip sync files that DOES NOT involve grabbing something from Skyrim. (I don't have Skyrim.) It's ... rather annoying having to use Oblivion's CK just for lip-syncing. (I was considering making voiced dialog for most of the vanilla NPCs but it was a major pain just getting Clover and Bittercup done for ONE scenario.)

Posted

You know, I wonder if adding.. say a temporary sandbox or some other package would effectively override companions following the player around? Might give that a try for my next crazy scenario.

Yes, but emphasis on the "temporary".

 

The engine automatically does an internal EVP on every actor every... <interval>. I think it's every game-world-clock 30 minutes. So your temporary package may stick around for 30 game minutes, or it may be removed in the next frame if you set it at 3:59:59.99999999 game time.

Posted

EVP does not remove added script packages,unless their conditions are false.

 

But the engine also teleport any teammate to the player if they are not explicitly set to waiting.

Posted

Figures. I suppose I'll have to concede to only having vanilla companions do the sandbox thing while waiting. (Provided one has the mods for it.)

 

Would teleporting a non-vanilla companion to another cell, then restraining them work? I've got a possible scenario coming up where it might make sense to have companions in another cell entirely.

Posted

EVP does not remove added script packages,unless their conditions are false.

 

But the engine also teleport any teammate to the player if they are not explicitly set to waiting.

I may be remembering wrong, but it's not a real 'evp', its some sort of package 'reset' that resets packages back to the default for the actor. It's been a while since I had any problems with that but I do remember them.. sort of.

Posted

Given even vanilla code uses AddScriptPackage (see the way Sunny is handled during Ringo quest) that would be very surprising :)

Posted

@Nessa:  Even if they don't have teammate, you could check if they have the player faction.  I think that's how I did it in one of my scripts...although I think I only tried it with Charon Improved converted for TTW and Wendy Gilbert, whom I don't remember if she has the comp wheel.

Posted

@prideslayer

that would interesting to understand too. I remember I've read in some Beth thread that the engine re-evaluates the packages automatically every 15 real time seconds

 

@jaam

are you sure that the engine teleports them? I mean, I remember modders writing the char is warping to you if remains too far, I remember some people were doing that by script (excluding the cell change, that should be automatic). So really, if you restrain a teammate it will port to you automatically even if you go more far away and not change the cell?

 

@nyaalich

Checking player faction isn't dangerous? checking on NV, playerfaction has many FO3 npcs, I'm wondering if in TTW they removed them

Posted

Sorry, I'm not being clear.

 

In the characters packages tab there is a list of packages, not a single package that is assigned. AddScriptPackage adds a new package in addition to that list, though you can only have one. AddScriptPackage twice in a row with different packages, only the last one actually gets added.

 

If it doesn't have 'must complete' (and I don't think sandboxes can have this), then the next time EVP is run, that package is removed and the package list is reevaluated to find the next one to run depending on conditions.

 

The sunny package almost certainly DOES have 'must complete' as it's not a sandbox. ;)

Posted

Oh, note that the must complete thing only applies to that 'internal' evp. Running an external evp (script or console) will abort/interrupt even 'must complete' packages.

Posted

Ah yes.  Follower faction indeed.  Apparently, talking to 3-4 NPCs to verify is not as good of a testing check as 20 (to find the player faction issue...although for non-TTW NV, it only lists a few robots for the player faction).

 

Trivia:  You can tell that at least 2 people worked on NV's companions.  Back whenever I was working on the mod that will never see the light of day, I did a comparison of how companions are dealt with upon hire.  Most are alike...and I don't recall exactly which ones are same/different, but after a quick look, Boone and Arcade are set rather differently.

Posted

 

Nessa, I can tell you my experience of trying to  add a package to Willow -for some unknown reason to me while her variables are set to 1 (IsFollowing etc.) she won't execute ANY packages I give her via "addscriptpackage" function (even if I execute "removeallscriptpackages" on her before giving her one). I tried adding some her slavery content to her and at first I was thinking WTF. Then I tried to give her a simple Dialogue package and that didn't work too.

 

"Startconversation" works on her though. Maybe restrain will work too.

 

 

I think Willow has some kind of auto-reset packages on her. Perhaps in one of her scripts. She is a real pain to deal with!

 

As for teleportation, so far in my tests, if the non-vanilla companion is restrained, they won't move around if the player is warped all over the same cell. However, if the player warps to another cell it appears they warp with you and continue to remain restrained. So I'm thinking the best way to handle this if you want to warp into a new cell, is first warp the player where you want the non-vanilla companions to be, then warp the player to another spot in the same cell. Or conversely, warp the companion to another spot in the same cell.

 

So in the case of my scenario idea about having ALL companions separate, they'll have to be in another room but in the same cell.

 

BUT... I seem to recall player slave might have solved this little issue so I might have another look there. (At least with the restraints.)

 

Is it possible to FIRE non-vanilla companions? (Probably not but I thought I'd ask.)

 

Guest tomm434
Posted
I think Willow has some kind of auto-reset packages on her. Perhaps in one of her scripts. She is a real pain to deal with!

Thought about it too but there are no script like that in her object script.

 

 

Is it possible to FIRE non-vanilla companions?

If you can build a script variable for each of them and set it to 0,then yes. But that's a lot of work and also dangerous.

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...