C-Finder bug CRUSHED!

Post » Sun Jan 02, 2011 10:18 pm

Never underestimate the destructive powers of a hastily written if. Always be prepared for functions that cause a script to terminate early if they fail to execute. These two pitfalls are the reason why the C-Finder sometimes fails to fire, and spawns targeting lasers all over your face until you reload the game. The bug itself is the worst kind: ridiculously simple to fix, and terribly hard to track down.

Here is the culprit, located in vEuclidQuestScript:

if (nPointerTargets > 0 && rPointer.GetDistance Player > EuclidRange)  rPointer.Disable;  rPointer.MarkForDelete;  set bInitialized to 0;  set bEnablePointer to 0;  set bPointerInitialized to 0;  set nExit to 1;  StopQuest VEuclidQuest;endif


The intentions are good: if the gun has spawned at least one pointer (it spawns one every frame to keep track of where you're aiming), and that pointer is out of range, stop targeting and exit the quest. The problem is that this is a script, not a compiled program. If this were C/C++ for instance, this if would test the first condition and then exit if it was false, without testing the second one. The script however, tests all of the conditions until there are none left regardless of what the first one returns. Since it takes a little while for a pointer to load, it may not always be ready when this check occurs, which results in the script trying to get the distance of a non-existing object.

This request is viewed as such a capital crime by the script parser that it doesn't just cause the if-check to fail, in fact it bluntly exits the script without parsing a single extra line and will never run that script again for this game session, which means none of the variables in the block are set, the quest never gets stopped and the gun will keep spawning pointers indefinitely. The reason why exiting and re-entering the game works is that the game then tries anew at running the script, sees that the pointer is now there (because we spawned it in the last game) and then proceeds to run the script as normal.

The fix is so simple it's almost embarassing:
if (nPointerTargets > 0)  if (rPointer.GetDistance Player > EuclidRange)    rPointer.Disable;    rPointer.MarkForDelete;    set bInitialized to 0;    set bEnablePointer to 0;    set bPointerInitialized to 0;    set nExit to 1;    StopQuest VEuclidQuest;  endifendif


I've tested this with all my C-Finder saves - no more failures. I'll upload the fix on the Nexus in a few minutes.

EDIT: http://www.newvegasnexus.com/downloads/file.php?id=38256
User avatar
Karen anwyn Green
 
Posts: 3448
Joined: Thu Jun 15, 2006 4:26 pm

Post » Sun Jan 02, 2011 8:24 pm

Nice catch. It really is apparent from this and some of the other scripts the devs were thinking in C when scripting- some scripts even end each line with a semicolon.
User avatar
Cameron Garrod
 
Posts: 3427
Joined: Sat Jun 30, 2007 7:46 am

Post » Sun Jan 02, 2011 8:03 pm

Thanks! I try to write my scripts like that as I do a lot of C at college and have to avoid getting into bad habits :D
User avatar
Tiff Clark
 
Posts: 3297
Joined: Wed Aug 09, 2006 2:23 am

Post » Sun Jan 02, 2011 8:43 pm

Durp, I didn't notice you were ending each line with a semicolon too :P. Read->Comprehend->Post, I failed at step 1.
User avatar
Amy Gibson
 
Posts: 3540
Joined: Wed Oct 04, 2006 2:11 pm

Post » Sun Jan 02, 2011 1:32 pm

Very nice catch - I hated that bug.

Great description!
User avatar
Max Van Morrison
 
Posts: 3503
Joined: Sat Jul 07, 2007 4:48 pm

Post » Sun Jan 02, 2011 2:35 pm

Have you reported the solution to this using Steam's report a bug feature yet? It would be nice to see the fix in the comprehensive patch if they haven't patched it yet.
User avatar
Chris Ellis
 
Posts: 3447
Joined: Thu Jul 26, 2007 10:00 am

Post » Sun Jan 02, 2011 3:10 pm

My experiences with the Steam customer service have been what I imagine getting oral six by a Deathclaw would feel like. I'll give it a try though, as that would be dope :D I actually noticed a bug in Borderlands regarding guns with Melee attacks and posted a similar description of how I thought it could be fixed, but no one bothered to reply, and the bug's still there :P I could have been wrong, though.

Here is the C-Finder fix:
http://www.newvegasnexus.com/downloads/file.php?id=38256


EDIT: Uhh, how DO you report a bug with Steam? I'm guessing they're my only hope since Bethesda is run by an AI from the future and doesn't have any contact with the outside world.
User avatar
Kelsey Anna Farley
 
Posts: 3433
Joined: Fri Jun 30, 2006 10:33 pm

Post » Sun Jan 02, 2011 2:41 pm

Would someone mind explaining what a C-finder is? I havent played NV much more than 30 hrs and I have no clue what your talking about. :P Thanks!
User avatar
SUck MYdIck
 
Posts: 3378
Joined: Fri Nov 30, 2007 6:43 am

Post » Sun Jan 02, 2011 8:55 pm

Would someone mind explaining what a C-finder is? I havent played NV much more than 30 hrs and I have no clue what your talking about. :P Thanks!


Spoiler
If you arm the Archimedes II Orbital Solar Cannon Satellite at Helios ONE you can use the C-Finder to emit a targeting laser from the station above, followed by a blast of energy. If your a C&C fan, think of this as your own personal Ion Cannon.

User avatar
Wanda Maximoff
 
Posts: 3493
Joined: Mon Jun 12, 2006 7:05 am

Post » Sun Jan 02, 2011 4:37 pm

Spoiler
If you arm the Archimedes II Orbital Solar Cannon Satellite at Helios ONE you can use the C-Finder to emit a targeting laser from the station above, followed by a blast of energy. If your a C&C fan, think of this as your own personal Ion Cannon.


Ahh I love C&C, thanks for the explanation.
User avatar
rebecca moody
 
Posts: 3430
Joined: Mon Mar 05, 2007 3:01 pm

Post » Sun Jan 02, 2011 9:49 am

Ahh I love C&C, thanks for the explanation.


No prob :tops:
User avatar
Sarah Kim
 
Posts: 3407
Joined: Tue Aug 29, 2006 2:24 pm


Return to Fallout: New Vegas