gallery music resources about contact


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.
  1. Went to the folder Data\meshes\characters\_1stperson in file manager
    1. Duplicated the file 1HPReloadA.kf to the folder Data\meshes\characters
    2. Renamed the duplicated file to PlasmaPistolReload1stPerson.kf
  2. Repeat step 1 for 1HPReloadA.kf file in Data\meshes\characters\_male
    1. Duplicated the file 1HPReloadA.kf to the folder Data\meshes\characters
    2. Renamed the duplicated file to PlasmaPistolReload.kf
  3. 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.
  1. Open up FO3Edit and load Fallout3.esm and the PlasmaPistol.esp
  2. 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)
    1. 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.
  3. Select the animation record in the .esp and change its name to PlasmaPistolReload and the MODL subrecord to Data\meshes\characters\PlasmaPistolReload.kf
    1. You can change values by selecting it and hitting F2
  4. Duplicate the above animation record and change its name to PlasmaPistolReload1stPerson and the MODL subrecord to Data\meshes\characters\PlasmaPistolReload1stPerson.kf
  5. Repeat the duplicatation and rename to PlasmaPistolJam and the MODL subrecord to Data\meshes\characters\PlasmaPistolJam.kf
  6. Repeat the duplicatation and rename to PlasmaPistolJam1stPerson and the MODL subrecord to Data\meshes\characters\PlasmaPistolJam1stPerson.kf
  7. Close FO3Edit and save your .esp


GECK Reload Effects


  1. Open up the GECK and navigate to "Game Effects" category in the object window
  2. Create new Base Effect called PlasmaPistolReloadEffect and select the following attributes for it
    1. Effect Archetype: Script
    2. Flags : Self and Painless
  3. Create new Actor Effect called PlasmaPistolReloadActorEffect and select the following attributes for it
    1. Type: Actor Effect
    2. Add new new Effect to the list and select the following attributes for it
    3. Effect: PlasmaPistolReloadEffect
    4. Range: Self
    5. Duration: 3
    6. Magnitude: 0
  4. Close all dialogs
  5. Might be a good idea to save again


Scripting


  1. Open up the GECK and go to script editor (the small pen in the tool bar).
  2. 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
  1. Save the script as Object script
  2. 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
  1. Save the script as Effect script
  2. Attach PlasmaPistolWeapScript script to PlasmaPistol weapon
  3. Attach PlasmaPistolReloadEffectScript to PlasmaPistolReloadEffect effect
  4. Save and test it in-game


Conclude and NifSkope


If you experience delays after reload, you can fix it by :
  1. open your appropriate 1st/3rd person animation file in NifSkope.
  2. Scroll to the NiKeyTextExtraData entry.
  3. In the Block Details window, expand the text entries and you'll see a text entry with Blend value and another with End value.
  4. 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.