Scripting Woes

As ever I have been having major woes with bugs and this mod.

Last night I revealed an alpha vid of the Sonic Screwdriver in Action, and received pretty positive feedback over at the Nexus.

I like a bit of critique every now and then, and points made were fair. You can view the video below.

Back to bugs though, and my major woe at current is the bloody Randomiser script for Flight.

The semantics for the procedure basically go through a 3 step process:

1) Select the Randomiser option from the TARDIS scanner
2) Prime the Helmic Regulator
3) Pull the Dematerialisation handbrake.

Step 1 basically calls a GetRandomPercent on the TARDISrndm variable I created which is then called by a series of if statements checking the variable. I.e. if it's between 20 and 25 enable the locked interior door and enable the destination door for that range (e.g. Fort Constantine).

Step 2 is more a mcguffin step simply there to pad out the experience.

Step 3 is where the meat happens. Pulling this does many many things. The primary action it emplaces is starting the timer. The length of time it takes for the TARDIS to 'travel' is dependant on the global var 'tardisspeed'. This starts at 30 (measured in seconds) and can vary depending on upgrades made to the TARDIS' temporal velocitor.

My problem at current suddenly occured with Step 1. As of Thursday afternoon, the randomiser stopped calling its value. The returned variable was always 0. This pissed me off. So I created a global Randomiser variable to set and tried that. Perfect. It worked.

But upon landing, the locked exterior door vanishes (as it should), yet the destination door (let's say in the previous instance Fort Constantine) - hasn't reenabled.

Now I have two theories:

1) I'm calling the if statement at the wrong time (perhaps setting the globalvar's random value and calling the if result on that var at the same time cancels itself out always returning 0?). But surely the door to the range of at least 0 - 5 in the 'if block' should have enabled?

2) I've disabled all the doors in another process somewhere. The last script I modified to do with travel was Space Travel. Perhaps I've done something in here which permanently disables all the locations teleport doors?

Either way, it's cocked up travel a treat and I need to pull it apart to make sense of it.

I won't be progressing with anything else until I've ironed out this crease.

My goals are simple: Get it working, keep it simple. That's what killed LCoG version 1.0 and I'm not making the same mistake twice.


No comments: