Jump to content

Fallout New Vegas GECK & Scripting Help 101


Recommended Posts

Posted

OK.

The only FaceGen data I expect in save would be on the Player form, everybody else should take data from the esm/esp.

 

Try generating two "identical" saves while only changing what you are interested in. Then compare the output ignoring most changes in floats (those are generally timers and XYZ pos advancing in time).

 

 

Posted

Thank you Jaam. That's pretty technical for me, is there a fast way (some program) to compare two text files of 55 Mb?

Posted

Beyond Compare is very good at that.

 

Also use the option -do:0 to remove unneeded information when comparing saves.

Guest tomm434
Posted

I remember someone there asked for a method to check if result script is working for sure.(without BeginSayToDone block)

So here I am, waking up in the middle of the night when suddenly idea comes to my mind.

 

Method is

if stage ==1

if mq01sarahref.GetCurrentAIProcedure != 43
mq01sarahRef.startconversation greeting
endif

if mq01sarahref.GetCurrentAIProcedure == 4
set stage to 2
endif 

elseif stage ==2 

if mq01sarahref.GetCurrentAIProcedure != 4
HERE YOU GO
endif 

First, give NPC startconversation command

Procedure 43 is true when Sarah is moving to dialogue target.

Then when Sarah starts dialogue(says her topic) stage is set to 2

And then at stage 2 when Sarah is not talking(she finished talking) - do your script.

Posted

I just spent 3 hours to work out if you want to cause a CTD, just try have a UDF remove a token containing the script calling the UDF :)

Posted

I just spent 3 hours to work out if you want to cause a CTD, just try have a UDF remove a token containing the script calling the UDF :)

 

I've spent a lot of hours tracking down CTDs before as well. I decided to start an article on the GECK wiki, causes of CTDs, to detail all these potential causes/workarounds worth investigating (not necessarily definitively proven), discovered from hours of experience debugging.

 

I've added that one, along with CO nested function calls, nvse and/or conditions with multiple UDF/String functions, and infinite loops.

 

I know there are plenty more CTD causes, could anyone else mention some? This stuff really ought to be collected somewhere. Post here and I'll add them, or add them yourself.. it is a wiki for a reason ;).

Posted

Another guaranteed CTD is leaving the "f" of the end of a variable in a DebugStatement as so:

 

DebugPrint "GunScript %n: Shooting %2.0 bullets" rActor iBullets

 

instead of:

 

DebugPrint "GunScript %n: Shooting %2.0f bullets" rActor iBullets

 

Another really weird CTC is if you get an object script in a outfit worn by an NPC to add or remove any item from that NPC it causes CTD. It's not an immediate CTD, you get funny colours & sounds, it's CTD on Drugs, sometimes just freezes, no CTD.

Exactly the same script works fine on the Player though. I found this in doing damaged armor swapping the only way to get it to work was have the token add an effect & script then and the effect script can add or remove items without crashing

 

 

Just freezing/crashing a script (only that script, not CTS) will occur if you get the "f" right but skip putting iBullets there or add an extra variable

 

Another script freeze/crash is by screwing up conditions in an if function:

 

if A==B && D < 1 && && W >= 7

Posted

DebugPrint cannot handle an invalid combination of string pattern and variables.One too many is CTD, one less is nothing printed.

 

Posted

I just spent 3 hours to work out if you want to cause a CTD, just try have a UDF remove a token containing the script calling the UDF :)

 

This somewhat remind me a cat I had, she was spending hours trying to catch her own tail... :P

In this case, what was causing the CTD, RemoveItem? Was it a GameMode blocktype?

 

@Odessa

Not sure if you're checking only NVSE CTD but the most frequent reason in vanilla modding, in my opinion, is referencing to null references. While this seems obvious, it isn't that much its practical application when it comes to functions that require some frames to work. Some time ago I was doing something like this:

Player.PlaceAtMe Reference1
Reference2.MoveTo Reference1
Reference1.Disable
Reference1.MarkForDelete

This operation was randomly causing CTDs in game.

I solved entirely these kinds of issues when I started hiding them behind a conditional statement:

Does Reference exist? > Then do the code

While this code could seem redundant in some places, in practical examples it is not. If you remember these famous SCOF files you sent me to track down that CTD in my functions... there was NVSE telling at start you couldn't reference to a null function etc. well this was varialbe, sometimes it was repeating twice, 4 times in other cases, etc. this depends by how much time it really needs to execute functions. Reason why in my opinion tweaking scripts introducing delays is not a reliable solution.

Posted

I had an object script on OvaTokens that basically checked the actor was valid and every 30minutes called a UDF to count the Semen and decide if the actor got knocked up. If the UDF decided conception occurred it would try remove the Ova Token.

I got round this by setting a rActor.NX variable with the OvaType REF and when the Ova Script sees itself in the NX variable it deletes itself now.

 

I always out of habit now do:

 

Set iCount to iCount + 1

if iCount > 199

Set iCount to 0

if rActor && iRemoving < 1

<Do Stuff>

Set iRemoving to 1

RemoveMe

endif

endif

 

Because I've seen on a few occasions where scripts running in early game startup or sometimes just on their first scan return <NULL> for an actor. With all the DLC's booting up, I've experienced such failures up to 10 seconds after gamestart, things like the player returning Zero for GetIsSex Female.

 

Instead of delays I run a lot of my scripts only every 9th to 500th scan dependant on how critical they are.

 

I can't remember for sure which is the result but I know I had Script Freezes or CTD's caused by then doing functions like <NULL>.GetIsSex or <NULL>.GetDistance

Posted

The hilarious thing is that several of these recent posts are some of the same exact posts that started this thread.  :P

 

/scampers off to go cause trouble somewhere else  ;)

Posted

The hilarious thing is that several of these recent posts are some of the same exact posts that started this thread.  :P

 

Well that's 80 pages... it's plenty of same questions answered more than once... ;)

Posted

The hilarious thing is that several of these recent posts are some of the same exact posts that started this thread.  :P

 

/scampers off to go cause trouble somewhere else  ;)

LOL, but who reads OP's :)

Posted

Hah.  I do...although I don't read them (or other posts for that matter : P ) thoroughly all the time.  :blush:

Besides...ouroboroses  are AWESOME!

 

 

nTBzg5GTA.png

 

 

 

Posted

Cool, added those ones people mentioned.

 

I know its repeating stuff thats already been said in the thread, but scanning 1615 posts isn't the ideal format to find it. I've been trying to add interesting stuff posted here to the wiki for a little while.

 

@AJ: I'm adding all of them, not just NVSE- those just happened to be the ones I recently spent hours tracking down.

Posted

Wonderful work. And god bless you to resurrect a dead wiky.

 

I would like to add that my experience with wrong and/or never CTDed for me, it was more subtle. I didn't try your example ( && && ), that probably will crash, but in the past when I was making mistakes in syntax with and/or I used to compile the script which then was breaking in game. This wasn't causing the CTD, it was breaking script execution in the middle, which was worse for me... I had the hardest times in the past to track down mistakes like these.

 

Oh another one I remembered, even if it's not that interesting... Calling GetEquippedObject on some specific slots like hair and pipboy. Scanning the player's equipment I had to create an array with only the other slots.

Posted

Woah, astonishing... I'm so excited for this!

 

https://www.youtube.com/watch?v=IMEFbarRySM

Posted

Woah, astonishing... I'm so excited for this!

 

[MEDIA]

Wow that is pretty awesome, not sure I would bother with it myself though but it is cool :)
Posted

Would be nice to tie something like clothing eval into something like that. Going to MCM & limiting yourself to what you have on is a bit of a drag.

Posted

Hal... think to when in NV you're going to a date and at the right moment, when everything's ready... poof, a pop up appears with the list of contraceptives you have in your pockets and you just need to click on the desired one, instead of using a uber sophisticated and complicated computer you wear on your arm... +1 Immersion :D

Posted

Woah, astonishing... I'm so excited for this!

!!!!

 

A decent inventory interface instead of that ridiculously idiotic Pipboy piece of #47#*&!? *dies*

 

:angel: :angel:

 

Now THAT is a mod I'll be installing! :heart:

Guest tomm434
Posted

Don't understand pother about that mod - nothing special I think.

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