Foreword
This tutorial was based on veliv's custom reload tutorial
I've extended it so it also effects NPC's, and jamming animation which works very well like normal jams.
It is used in my mod Plasma Weapons Redesign Rebalance, and also in the example file.
Please don't contact me for questions and such, instead post in the file thread over at Nexus.
I won't go into the details of making your weapon, but you can either use existing weapons in GECK, or duplicate them to use new ones.
Animations (.kf Files)
Those are the animations, for this tutorial I've copied from the original ones.
- Went to the folder Data\meshes\characters\_1stperson in file manager
- Duplicated the file 1HPReloadA.kf to the folder Data\meshes\characters
- Renamed the duplicated file to PlasmaPistolReload1stPerson.kf
- Repeat step 1 for 1HPReloadA.kf file in Data\meshes\characters\_male
- Duplicated the file 1HPReloadA.kf to the folder Data\meshes\characters
- Renamed the duplicated file to PlasmaPistolReload.kf
- I repeated the above for the jamming animations, using 1HPJamJ.kf and renaming to PlasmaPistolJam.kf and PlasmaPistolJam1stPerson.kf.
Adding the Idle animations
You need to add 4 idle animations to the game (1st and 3rd person for both reload and jamming animations) I found it best to use Elminster's FO3Edit for this task, since GECK is bit buggy with the idle anims.
- Open up FO3Edit and load Fallout3.esm and the PlasmaPistol.esp
- Copy one Idle Animation from Fallout3.esm to the PlasmaPistol.esp (I used LooseFingerUp, but any Loose idle animation should do as long as they don't have any conditions on them)
- You can do it by selecting the animation in FO3Edit, right click on it and select "Copy as new record into..." and selecting the .esp form the pop-up.
- Select the animation record in the .esp and change its name to PlasmaPistolReload and the MODL subrecord to Data\meshes\characters\PlasmaPistolReload.kf
- You can change values by selecting it and hitting F2
- Duplicate the above animation record and change its name to PlasmaPistolReload1stPerson and the MODL subrecord to Data\meshes\characters\PlasmaPistolReload1stPerson.kf
- Repeat the duplicatation and rename to PlasmaPistolJam and the MODL subrecord to Data\meshes\characters\PlasmaPistolJam.kf
- Repeat the duplicatation and rename to PlasmaPistolJam1stPerson and the MODL subrecord to Data\meshes\characters\PlasmaPistolJam1stPerson.kf
- Close FO3Edit and save your .esp
GECK Reload Effects
- Open up the GECK and navigate to "Game Effects" category in the object window
- Create new Base Effect called PlasmaPistolReloadEffect and select the following attributes for it
- Effect Archetype: Script
- Flags : Self and Painless
- Create new Actor Effect called PlasmaPistolReloadActorEffect and select the following attributes for it
- Type: Actor Effect
- Add new new Effect to the list and select the following attributes for it
- Effect: PlasmaPistolReloadEffect
- Range: Self
- Duration: 3
- Magnitude: 0
- Close all dialogs
- Might be a good idea to save again
Scripting
- Open up the GECK and go to script editor (the small pen in the tool bar).
- Paste in the following code:
SCN PlasmaPistolWeapScript
; Custom reload animations script
; Authors: VeliV - www.project-valhalla.org / chai - www.svartberg.com
; If you use this script in your mod, please keep these lines intact
begin gamemode
ref rContainer
set rContainer to GetContainer
if rContainer.GetAnimAction == 9
if rContainer.GetEquipped WeapPlasmaPistol == 1
rContainer.CastImmediateOnSelf PlasmaPistolReloadActorEffect
endif
endif
end
- Save the script as Object script
- Create new script and paste in the following code:
scn PlasmaPistolReloadEffectScript
; Custom reload animations script
; Authors: VeliV - www.project-valhalla.org / chai - www.svartberg.com
; If you use this script in your mod, please keep these lines intact
short doOnce
float jamPercent
short weapCond
short chance
float timer
begin ScriptEffectUpdate
ref rContainer
if doOnce == 0 ; reload animation
set timer to 40 ; this timer works on gamelogic ticks and it just for creating safety delay
set rContainer to GetSelf
if rContainer == player
if IsPC1stPerson == 1
player.PlayIdle PlasmaPistolReload1stPerson
else
player.PlayIdle PlasmaPistolReload
endif
EnablePlayerControls 1 1 1 1 1 1 1
set doOnce to 1
else
rContainer.PlayIdle PlasmaPistolReload
set doOnce to 2 ; no jamming for NPC's so skip the jam loops
endif
elseif doOnce == 1 ; only run jamming timer if it's the player
if timer > 0
set timer to timer - 1
elseif rContainer.IsIdlePlaying == 0 ; timer ran out
set weapCond to player.GetWeaponHealthPerc
if weapCond < 50 ; only run if equiped weapon is below 50%
if weapCond > 40
set jamPercent to GetGameSetting fWeaponConditionReloadJam5
elseif weapCond > 30
set jamPercent to GetGameSetting fWeaponConditionReloadJam4
elseif weapCond > 20
set jamPercent to GetGameSetting fWeaponConditionReloadJam3
elseif weapCond > 10
set jamPercent to GetGameSetting fWeaponConditionReloadJam2
else
set jamPercent to GetGameSetting fWeaponConditionReloadJam1
endif
set jamPercent to (jamPercent * 100)
set chance to getRandomPercent
if chance < jamPercent
if IsPC1stPerson == 1
player.PlayIdle PlasmaPistolJam1stPerson
else
player.PlayIdle PlasmaPistolJam
endif
endif
endif
set doOnce to 2 ; stop loop
endif
endif
end
- Save the script as Effect script
- Attach PlasmaPistolWeapScript script to PlasmaPistol weapon
- Attach PlasmaPistolReloadEffectScript to PlasmaPistolReloadEffect effect
- Save and test it in-game
Conclude and NifSkope
If you experience delays after reload, you can fix it by :
- open your appropriate 1st/3rd person animation file in NifSkope.
- Scroll to the NiKeyTextExtraData entry.
- In the Block Details window, expand the text entries and you'll see a text entry with Blend value and another with End value.
- Simply changing the end value to lower will allow the player to resume control earlier, and I give the Blend one about 0.08sec lower value as it allows for smoother animation blending.
It might take a bit of testing until you get it right, as mispelling entries can easily render things bad.
Again, if you have any questions - please post in the
thread over at nexus rather than contacting me.