1st Person Legs - No activator item and automatic activation

Post » Sun Dec 11, 2011 1:35 am

I would like to have no first person legs activator item (it`s a skull) in my inventory. Instead I would like to have the legs automatically activated when I start a game or load a save game. Unfortunately I don`t have much experience with scripts, but I`m sure you can help me:

The plugin has 4 scripts, a rather long one and three short ones. You can directly edit the scripts and I will try it afterwards. Thanks.


01SP1stPLegs

Spoiler
SCN 01SP1stPLegs

short Once
short COnce
short isLoad

;== Update tokens
short ValueUpdate
short MultiSlotUpdate
short ChangeUpdate
short LUpdate
short FUpdate
short HUpdate
short FFullnUpdate
short LFullnUpdate
short HUpdate

short LEquip
short FEquip

short LUpdateEnchantment
short FUpdateEnchantment
short ULUpdateEnchantment
short LUpdateMesh
short FUpdateMesh
short LNUpdateMesh
short FNUpdateMesh

short ReturnRings
Short ReturnLeftRing
short ReturnRingsNoReturn

short PathDebug

ref SPFootBodyRingRef
ref SPLowerBodyRingRef
ref SPClearHandsRef

ref RightRingSlotOLD
ref LeftRingSlotOLD

ref LEnchantment
ref FEnchantment

;== nvde equipment
ref Lowern
ref Handn
ref Footn
ref Fulln
ref UpperLowerFootn
ref UpperLowern
ref LeftRingSlotn
ref RightRingSlotn

;== Current euipments
ref LowerCUR
ref HandCUR
ref FootCUR
ref FullCUR
ref UpperLowerFootCUR
ref UpperLowerCUR

;== Original equipments
ref LowerOrigin
ref FootOrigin
ref HandOrigin
ref FullOrigin
ref UpperLowerFootOrigin
ref UpperLowerOrigin
ref RightRingSlotCUR
ref LeftRingSlotCUR

begin gamemode
if SP1stPLegsVariables.Run == 1
if IsThirdPerson
if COnce == 0
set ReturnRings to 1
set ReturnLeftRing to 1
set Once to 0
set COnce to 1
endif
else
;=========================================
;If a Load is detected, resets Once
;=========================================
set isLoad to GetGameLoaded
if isLoad == 1
set ValueUpdate to 0
set MultiSlotUpdate to 0
set ChangeUpdate to 0
set LUpdate to 0
set FUpdate to 0
set LUpdateMesh to 0
set FUpdateMesh to 0
set HUpdate to 0
set ReturnRings to 0
set ReturnLeftRing to 0
set ReturnRingsNoReturn to 0
set LEquip to 0
set FEquip to 0
set Once to 0

set isLoad to 0
endif

;=========================================
;Run once, resets values
;=========================================
if Once == 0
set COnce to 0
;== Set references
set SPClearHandsRef to SPClearHands
set SPLowerBodyRingRef to SPLowerBodyRing
set SPFootBodyRingRef to SPFootBodyRing

;== Set updates
set ValueUpdate to 1
set MultiSlotUpdate to 0
set ChangeUpdate to 0
set LUpdate to 0
set FUpdate to 0
set LUpdateMesh to 0
set FUpdateMesh to 0
set HUpdate to 0
set ReturnRings to 0
set ReturnLeftRing to 0
set ReturnRingsNoReturn to 0
set LEquip to 0
set FEquip to 0

;== Set original slots to nvde
set LowerOrigin to SP1stPLegsVariables.Lowern
set FootOrigin to SP1stPLegsVariables.Footn
set HandOrigin to SP1stPLegsVariables.Handn
set FullOrigin to SP1stPLegsVariables.Fulln
set UpperLowerFootOrigin to SP1stPLegsVariables.UpperLowerFootn
set UpperLowerOrigin to SP1stPLegsVariables.UpperLowern

;== Set nvde slots to nvde
set Lowern to SP1stPLegsVariables.Lowern
set Footn to SP1stPLegsVariables.Footn
set Handn to SP1stPLegsVariables.Handn
set Fulln to SP1stPLegsVariables.Fulln
set UpperLowerFootn to SP1stPLegsVariables.UpperLowerFootn
set UpperLowern to SP1stPLegsVariables.UpperLowern
set RightRingSlotn to SP1stPLegsVariables.RightRingSlotn
set LeftRingSlotn to SP1stPLegsVariables.LeftRingSlotn

;== Disable self
set Once to 1
endif

;=========================================
;Slot Updates
;=========================================
if ValueUpdate == 1
set SP1stPLegsVariables.LowerCUR to Player.GetEquippedObject 3
set SP1stPLegsVariables.HandCUR to Player.GetEquippedObject 4
set SP1stPLegsVariables.FootCUR to Player.GetEquippedObject 5
set SP1stPLegsVariables.RightRingSlotCUR to Player.GetEquippedObject 6
set SP1stPLegsVariables.LeftRingSlotCUR to Player.GetEquippedObject 7
set SP1stPLegsVariables.UpperLowerCUR to Player.GetEquippedObject 18
set SP1stPLegsVariables.UpperLowerFootCUR to Player.GetEquippedObject 19
set SP1stPLegsVariables.FullCUR to Player.GetEquippedObject 20

set MultiSlotUpdate to 1
set ValueUpdate to 0
endif

;=========================================
;Multislot checks
;=========================================
if MultiSlotUpdate == 1
if SP1stPLegsVariables.FullCUR == Fulln
if SP1stPLegsVariables.UpperLowerFootCUR == UpperLowerFootn
if SP1stPLegsVariables.UpperLowerCUR == UpperLowern
set LUpdate to 1
else
if SP1stPLegsVariables.UpperLowerCUR != UpperLowerOrigin
set UpperLowerOrigin to SP1stPLegsVariables.UpperLowerCUR
set ReturnRings to 1
set ReturnLeftRing to 0
set ReturnRingsNoReturn to 1
endif
endif
set FUpdate to 1
set ChangeUpdate to 1
else
if SP1stPLegsVariables.UpperLowerFootCUR != UpperLowerFootOrigin
set UpperLowerFootOrigin to SP1stPLegsVariables.UpperLowerFootCUR
set ReturnRings to 1
set ReturnLeftRing to 1
set ReturnRingsNoReturn to 1
else
set ValueUpdate to 1
endif
endif
else
if SP1stPLegsVariables.FullCUR != FullOrigin
set FullOrigin to SP1stPLegsVariables.FullCUR
set ReturnRings to 1
set ReturnLeftRing to 1
set ReturnRingsNoReturn to 1
else
set ValueUpdate to 1
endif
endif
set MultiSlotUpdate to 0
endif

;=========================================
;Checks whether items have changed
;=========================================
if ChangeUpdate == 1
if LUpdate == 1
if SP1stPLegsVariables.LowerCUR != Lowern
if SP1stPLegsVariables.LowerCUR != LowerOrigin
set LowerCUR to SP1stPLegsVariables.LowerCUR
setMaleBipedPath Meshes\magiceffects\null.nif SPLowerBodyRing
setFemaleBipedPath Meshes\magiceffects\null.nif SPLowerBodyRing
set LNUpdateMesh to 0
set LUpdateMesh to 1
set LUpdate to 0
endif
else
if SP1stPLegsVariables.LowerCUR != LowerOrigin
set LowerCUR to SP1stPLegsVariables.LowerCUR
setMaleBipedPath Meshes\magiceffects\null.nif SPLowerBodyRing
setFemaleBipedPath Meshes\magiceffects\null.nif SPLowerBodyRing
set LNUpdateMesh to 1
set LUpdateMesh to 1
set LUpdate to 0
endif
endif
set LUpdateEnchantment to 1
endif

if FUpdate == 1
if SP1stPLegsVariables.FootCUR != Footn
if SP1stPLegsVariables.FootCUR != FootOrigin
set FootCUR to SP1stPLegsVariables.FootCUR
setMaleBipedPath Meshes\magiceffects\null.nif SPFootBodyRing
setFemaleBipedPath Meshes\magiceffects\null.nif SPFootBodyRing
set FNUpdateMesh to 0
set FUpdateMesh to 1
set FUpdate to 0
endif
else
if SP1stPLegsVariables.FootCUR != FootOrigin
set FootCUR to SP1stPLegsVariables.FootCUR
setMaleBipedPath Meshes\magiceffects\null.nif SPFootBodyRing
setFemaleBipedPath Meshes\magiceffects\null.nif SPFootBodyRing
set FNUpdateMesh to 1
set FUpdateMesh to 1
set FUpdate to 0
endif
endif
set FUpdateEnchantment to 1
endif
endif

;=========================================
;RightRing Recheck
;=========================================
if LUpdateEnchantment == 1
set SP1stPLegsVariables.RightRingSlotCUR to Player.GetEquippedObject 6
if SP1stPLegsVariables.RightRingSlotCUR != RightRingSlotn
if SP1stPLegsVariables.RightRingSlotCUR != SPLowerBodyRingRef
set SP1stPLegsVariables.RightRingSlotOLD to SP1stPLegsVariables.RightRingSlotCUR
set RightringSlotOLD to SP1stPLegsVariables.RightRingSlotCUR

set RightRingSlotCUR to SP1stPLegsVariables.RightRingSlotCUR
RemoveEnchantment SPLowerBodyRingRef
set LEnchantment to RightRingSlotCUR.GetEnchantment RightRingSlotCUR
SPLowerBodyRingRef.SetEnchantment LEnchantment SPLowerBodyRingRef

CopyName RightRingSlotCUR SPLowerBodyRingRef

set LUpdate to 0
set ChangeUpdate to 0
set LUpdateMesh to 1
else
if LUpdateMesh == 0 && FUpdateMesh == 0
set LUpdate to 0
set ChangeUpdate to 0
set ValueUpdate to 1
endif
endif
else
RemoveEnchantment SPLowerBodyRingRef
SetName "Lower Body"
set LUpdateMesh to 1
endif
set LUpdateEnchantment to 0
endif

;=========================================
;LeftRing Recheck
;=========================================
if FUpdateEnchantment == 1
set SP1stPLegsVariables.LeftRingSlotCUR to Player.GetEquippedObject 7
if SP1stPLegsVariables.LeftRingSlotCUR != LeftRingSlotn
if SP1stPLegsVariables.LeftRingSlotCUR != SPFootBodyRingRef
set SP1stPLegsVariables.LeftRingSlotOLD to SP1stPLegsVariables.LeftRingSlotCUR
set LeftRingSlotOLD to SP1stPLegsVariables.LeftRingSlotCUR

set LeftRingSlotCUR to SP1stPLegsVariables.LeftRingSlotCUR
RemoveEnchantment SPFootBodyRingRef
set FEnchantment to LeftRingSlotCUR.GetEnchantment LeftRingSlotCUR
SPFootBodyRingRef.SetEnchantment FEnchantment SPFootBodyRingRef

CopyName LeftRingSlotCUR SPFootBodyRingRef

set FUpdate to 0
set ChangeUpdate to 0
set FUpdateMesh to 1
else
if LUpdateMesh == 0 && FUpdateMesh == 0
set FUpdate to 0
set ChangeUpdate to 0
set ValueUpdate to 1
endif
endif
else
RemoveEnchantment SPFootBodyRingRef
SetName "Foot"
set FUpdateMesh to 1
endif
set FUpdateEnchantment to 0
endif

;=========================================
;Lower Mesh change
;=========================================
if LUpdateMesh == 1 && LUpdateEnchantment == 0
if LNUpdateMesh == 1
SetMaleBipedPath "Meshes\characters\_male\lowerbody.nif" SPLowerBodyRing
SetFemaleBipedPath "Meshes\characters\_male\FemaleLowerBody.nif" SPLowerBodyRing
else
CopyMaleBipedPath LowerCUR SPLowerBodyRing
CopyFemaleBipedPath LowerCUR SPLowerBodyRing
endif
set LEquip to 1
set ValueUpdate to 0
set MultiSlotUpdate to 0
set ChangeUpdate to 0
set LUpdateMesh to 0
endif

;=========================================
;Foot mesh change
;=========================================
if FUpdateMesh == 1 && FUpdateEnchantment == 0
if FNUpdateMesh == 1
SetMaleBipedPath "Meshes\characters\_male\foot.nif" SPFootBodyRing
SetFemaleBipedPath "Meshes\characters\_male\FemaleFoot.nif" SPFootBodyRing
else
CopyMaleBipedPath FootCUR SPFootBodyRing
CopyFemaleBipedPath FootCUR SPFootBodyRing
endif
set FEquip to 1
set ValueUpdate to 0
set MultiSlotUpdate to 0
set ChangeUpdate to 0
set FUpdateMesh to 0
endif

;=========================================
;Equip
;=========================================
if LEquip == 2
set LowerOrigin to LowerCUR
set RightRingSlotCUR to Player.GetEquippedObject 6
if SP1stPLegsVariables.RightRingSlotCUR != RightRingSlotn
Player.UnEquipItemNS RightRingSlotCUR
endif
Player.EquipItemNS SPLowerBodyRing
set HUpdate to 1
set LEquip to 0
endif
if LEquip == 1
Set LEquip to 2
endif

if FEquip == 2
set FootOrigin to FootCUR
set LeftRingSlotCUR to Player.GetEquippedObject 7
if SP1stPLegsVariables.LeftRingSlotCUR != LeftRingSlotn
Player.UnEquipItemNS LeftRingSlotCUR
endif
Player.EquipItemNS SPFootBodyRing
set HUpdate to 1
set FEquip to 0
endif
if FEquip == 1
Set FEquip to 2
endif

;=========================================
;Clear Hands
;=========================================
if HUpdate == 4
if SP1stPLegsVariables.HandCUR != SP1stPLegsVariables.Handn
player.EquipItemNS HandCUR
endif
set LUpdate to 0
set FUpdate to 0
set ValueUpdate to 1
set HUpdate to 0
endif

if HUpdate == 3
player.UnEquipItemNS SPClearHandsRef
set HUpdate to 4
endif

if HUpdate == 2
set FullCUR to Player.GetEquippedObject 20
if FullCUR == SP1stPLegsVariables.Fulln
set SP1stPLegsVariables.HandCUR to Player.GetEquippedObject 4
set HandCUR to SP1stPLegsVariables.HandCUR
if HandCUR != SP1stPLegsVariables.Handn
Player.UnEquipItemNS HandCUR
endif
Player.EquipItemNS SPClearHandsRef
set HUpdate to 3
else
set ValueUpdate to 1
set HUpdate to 0
endif
endif

if HUpdate == 1
set HUpdate to 2
endif
;== End of camera check
endif

;=========================================
;Return Rings
;=========================================
if ReturnRings == 1
set SP1stPLegsVariables.RightRingSlotCUR to Player.GetEquippedObject 6
set SP1stPLegsVariables.LeftRingSlotCUR to Player.GetEquippedObject 7
if SP1stPLegsVariables.RightRingSlotCUR == SPLowerBodyRingRef
Player.UnEquipItemNS SPLowerBodyRingRef
Player.EquipItemNS RightRingSlotOLD
endif
if ReturnLeftRing == 1
if SP1stPLegsVariables.LeftRingSlotCUR == SPFootBodyRingRef
Player.UnEquipItemNS SPFootBodyRingRef
Player.EquipItemNS LeftRingSlotOLD
endif
set ReturnLeftRing to 0
endif
if ReturnRingsNoReturn == 1
set ValueUpdate to 1
set ReturnRingsNoReturn to 0
endif
set ReturnRings to 0
endif

;== Disabled
else
;=========================================
;Return Rings, once
;=========================================
if SP1stPLegsVariables.ReturnRings == 1
set Once to 1
set SP1stPLegsVariables.RightRingSlotCUR to Player.GetEquippedObject 6
set SP1stPLegsVariables.LeftRingSlotCUR to Player.GetEquippedObject 7
if SP1stPLegsVariables.RightRingSlotCUR == SPLowerBodyRingRef
Player.UnEquipItemNS SPLowerBodyRingRef
Player.EquipItemNS RightRingSlotOLD
endif
if SP1stPLegsVariables.LeftRingSlotCUR == SPFootBodyRingRef
Player.UnEquipItemNS SPFootBodyRingRef
Player.EquipItemNS LeftRingSlotOLD
endif
Set SP1stPLegsVariables.ReturnRings to 0
endif
endif
end



01SP1stPLegsNudistScript

Spoiler
SCN 01SP1stPLegsNudistScript

;== Initiates nvde values
short once

begin gamemode

if once == 0

set SP1stPLegsVariables.LeftRingSlotn to GetEquippedObject 7
set SP1stPLegsVariables.RightRingSlotn to GetEquippedObject 6
set SP1stPLegsVariables.Lowern to GetEquippedObject 3
set SP1stPLegsVariables.Handn to GetEquippedObject 4
set SP1stPLegsVariables.Footn to GetEquippedObject 5
set SP1stPLegsVariables.UpperLowern to GetEquippedObject 18
set SP1stPLegsVariables.UpperLowerFootn to GetEquippedObject 19
set SP1stPLegsVariables.Fulln to GetEquippedObject 20
set once to 1

;== Remove the nudist
disable

endif

end



01SP1stPLegsVariablesScript

Spoiler
SCN 01SP1stPLegsVariablesScript

;== Nudist
ref Lowern
ref Footn
ref UpperLowern
ref UpperLowerFootn
ref Fulln
ref LeftRingSlotn
ref RightRingSlotn
ref Handn

;== Player
ref UpperLowerCUR
ref UpperLowerFootCUR
ref FullCUR
ref FootCUR
ref LowerCUR
ref HandCUR
ref RightRingSlotCUR
ref LeftRingSlotCUR

;== Old rings
ref RightRingSlotOLD
ref LeftRingSlotOLD

;== States
Short Init
Short Run
Short Button
Short ReturnRings

;== Init the system
begin gamemode

if Init == 0

RemoveEnchantment SPClearHands
player.AddItemNS SP1stPLegsRunner 1
player.AddItemNS SPLowerBodyRing 1
player.AddItemNS SPFootBodyRing 1
player.AddItemNS SP1stPActivator 1
player.AddItemNS SPClearHands 1
set Init to 1

endif

end



01SPActivatorScript

Spoiler
SCN 01SPActivatorScript

short ButtonPressed

begin onEquip Player
messagebox "1st Person Legs script status", "On", "Off"
set ButtonPressed to 1
end

begin gamemode

if ButtonPressed == 1
set SP1stPLegsVariables.Button to GetButtonPressed
if SP1stPLegsVariables.Button > -1
if SP1stPLegsVariables.Button == 0
set SP1stPLegsVariables.Run to 1
elseif SP1stPLegsVariables.Button == 1
set SP1stPLegsVariables.Run to 0
set SP1stPLegsVariables.ReturnRings to 1
endif
set ButtonPressed to 0
endif
endif

end

User avatar
Ebony Lawson
 
Posts: 3504
Joined: Fri Feb 16, 2007 11:00 am

Post » Sun Dec 11, 2011 8:57 am

01SP1stPLegs

Spoiler
...

begin gamemode
if SP1stPLegsVariables.Run != 99 ; if SP1stPLegsVariables.Run == 1 <- Change this line
if IsThirdPerson
if COnce == 0
...


And:

01SP1stPLegsVariablesScript

Spoiler
...

if Init == 0

RemoveEnchantment SPClearHands
player.AddItemNS SP1stPLegsRunner 1
player.AddItemNS SPLowerBodyRing 1
player.AddItemNS SPFootBodyRing 1
; player.AddItemNS SP1stPActivator 1 <- Remove this line
player.AddItemNS SPClearHands 1
set Init to 1

endif

end


That should do the trick.
User avatar
Tammie Flint
 
Posts: 3336
Joined: Mon Aug 14, 2006 12:12 am

Post » Sun Dec 11, 2011 1:52 am

When I start a new game the second script change seems to work - no more skull item in the inventory. However, there are no 1st Person Legs.
User avatar
Stephy Beck
 
Posts: 3492
Joined: Mon Apr 16, 2007 12:33 pm

Post » Sun Dec 11, 2011 1:41 am

Did you ever use this mod:

Immersive First Person View - Loup Sombre
http://tesnexus.com/downloads/file.php?id=20891

Movie:
http://www.youtube.com/watch?v=OvovdSnj1Rw
User avatar
Rebekah Rebekah Nicole
 
Posts: 3477
Joined: Fri Oct 13, 2006 8:47 pm

Post » Sun Dec 11, 2011 2:42 am

I`m actually using Deadly Reflex 6, what made the mod by Loup Sombre obsolete.
User avatar
OJY
 
Posts: 3462
Joined: Wed May 30, 2007 3:11 pm

Post » Sun Dec 11, 2011 10:44 am

@ Mr. Furious

Did you check your first script change? Is everything correct?
User avatar
Scared humanity
 
Posts: 3470
Joined: Tue Oct 16, 2007 3:41 am

Post » Sat Dec 10, 2011 8:56 pm

Ah, now it was actually adding and removing everything whenever the script ran. Try this instead:

01SP1stPLegsVariablesScript

Spoiler
...

if Init == 0

RemoveEnchantment SPClearHands
player.AddItemNS SP1stPLegsRunner 1
player.AddItemNS SPLowerBodyRing 1
player.AddItemNS SPFootBodyRing 1
; player.AddItemNS SP1stPActivator 1 ; <- Remove this line
player.AddItemNS SPClearHands 1
set Init to 1

set Run to 1 ; <- Add this line

endif

end

User avatar
Lory Da Costa
 
Posts: 3463
Joined: Fri Dec 15, 2006 12:30 pm

Post » Sun Dec 11, 2011 8:37 am

Ah, now it was actually adding and removing everything whenever the script ran. Try this instead:

01SP1stPLegsVariablesScript


The game crashes after loading. Maybe you can try it for yourself: http://www.tesnexus.com/downloads/file.php?id=18595

Of course you can make the changes, test it and send me the edited esp. I will see the differences in the scripts with Beyond Compare.
User avatar
J.P loves
 
Posts: 3487
Joined: Thu Jun 21, 2007 9:03 am

Post » Sat Dec 10, 2011 9:34 pm

It works fine for me. I don't see how adding and removing one line can crash your game. Was it working before you edited the .esp? Did the CS give any errors when you saved the script/.esp?
User avatar
Melis Hristina
 
Posts: 3509
Joined: Sat Jun 17, 2006 10:36 pm


Return to IV - Oblivion