[WIPz] Lock-Forcer Mod

Post » Sat Feb 19, 2011 2:28 am

I've got this working more or less as I want it, and I'm hoping to release it today, but I have 2 problems:

1 - when an object with a script attached is crafted, the OnAdd block does not seem to run. In fact dropping that item doesn't seem to trigger the OnDrop block either. Are there any workarounds for this?

2 - I would like to be able to reference an item in a script that has just been dropped by the player - is there a neat way of doing this?

Thanks in advance!

Spoiler
Description
===========
A craftable device to force open those pesky locks, for those who don't want to invest those precious skill-points into Lockpick. HOWEVER, it is not without consecquences!

Location
========
Visiting Goodsprings School house will get you started

Details
=======
The "Induction Lock-Forcer" comes in 3 versions that are craftable. The two lowlier versions come with significant penalties and risks; the "refined" version is just relatively heavy (though still only 7lbs).

The recipes will only show up when you have appropriate skills. The skills which allow you to craft the Lock-Forcer are: Lockpick; Science; and Repair. In that order, skill-requirements progressively increase. For example: The "crude" version requires Lockpick 10 *or* Science 15 *or* Repair 20.

The Lock-Forcer operates through a menu choice that pops up when you activate a locked container ONLY if your lockpick skill is too low - otherwise the lockpick mini-game pops up as normal. Note that this will probably conflict with VMods Suite Container Sorters module - more on that later.

If you choose to try using the Lock-Forcer on a locked container, there are 3 possible outcomes: Success (painless); success (painful); or failure (painful). Your chance of success or failure depends on your levels of the 3 skills mentioned above, your luck, some randomness and the difficulty of the lock. As a baseline, I took 15 in all 3 skills and luck at 10. With those stats plus maximum score in TWO scripted dice-rolls, you will successfully open a level-100 lock! (For those of you interested in a bit more detail, read the next section - otherwise skip to the one after.)

The script controlling the succes of the attempt includes 2 random percentages (from a game-engine function). However, the first is modified to a 1/10 chance, and the second is limited to a 1/12 chance. It's a lot more complicated than that, but that was just by way of explaining that it doesn't require two consecutive scores of 100.

A note on Balance: This is supposed to be a way to do away with the lockpick skill to a fair extent, so if you don't like that idea, this ain't for you. However it's not just a handy way of implementing console-unlock, or anything like it. Firstly, the two lowlier versions add significant weight, impair your Agility and Sneak, as well as slowing you down considerably. Even when you succeed in opening a locked container, you may suffer for it - and that goes for the "refined" version too. However the refined version requires a high enough skill-level to create in the first place that using it will likely be more successful. There is one more caveat though: Your Lockpick skill contributes more to your chances of success - 5 times as much as Repair and almost twice as much as Science - so even if you get to build one of the refined versions based purely on your Repair skill, you'll still find 100-level locks quite painful, even if they do open more often!

User avatar
mishionary
 
Posts: 3414
Joined: Tue Feb 20, 2007 6:19 am

Post » Sat Feb 19, 2011 10:47 am

Ok, I've been playing around with this a bit more and I have a more specific question to ask: Why doesn't the following code produce the sound and visuals in the script?
Begin OnDrop Player                Disable                MarkForDelete                Player.UnEquipItem EpFtechPickCase1EffectToken 1 1                Player.RemoveItem EpFtechPickCase1EffectToken 1 1                set rNewForcer to Player.PlaceAtMe EpFtechPickCase1 ;---------all fine up to here                PlaySound3D OBJComputerTerminalArc ;--------------------------doesn't work                rNewForcer.PMS EpFpulseDisableFXShader ;----------------------doesn't work                rNewForcer.PMS EpFsmoke02 ;-----------------------------------doesn't work                set EpFtechPickQuest.rForcer to rNewForcer ;------------------but this does                set EpFtechPickQuest.sDropped to 1 ;--------------------------and so does thisEnd

I thought maybe the scrip was refusing to complete because at first I had 'rNewForcer.PlaySound3D etc.' which Cipscis' Validator flagged. But the script above gets validated but the effects don't play. It's frustrating because this was my solution to getting a formID from a dropped object.
User avatar
April
 
Posts: 3479
Joined: Tue Jun 20, 2006 1:33 am


Return to Fallout: New Vegas