Toggleable Powers

Post » Sat Nov 17, 2012 5:48 am

I'm working on a mod called Better Racials- Khajit Edition. I want to make the night eye power toggleable. How do I go about creating this?
User avatar
Aman Bhattal
 
Posts: 3424
Joined: Sun Dec 17, 2006 12:01 am

Post » Sat Nov 17, 2012 8:52 am

Create two abilities. Let's call them NightEyeToggler and NightEyeActual.

NightEyeActual is the real continuous night eye effect, but you don't give that to the player.

NightEyeToggler is a spell that checks to see if the player has NightEyeActual. If the player has NightEyeActual. then the toggler removes it. If not, it adds the Actual ability to the player.

Hope that made sense
User avatar
Alycia Leann grace
 
Posts: 3539
Joined: Tue Jun 26, 2007 10:07 pm

Post » Sat Nov 17, 2012 6:57 am

you could also make a constant effect ability (which contains the NV effect) and then an equippable lesser power with 2 mgef's that are used to manupulate a condition boolean by alternating the value on each button press.

the NV ability has a conditional that only allows the effect to be visible when the condition is true
User avatar
Aman Bhattal
 
Posts: 3424
Joined: Sun Dec 17, 2006 12:01 am

Post » Sat Nov 17, 2012 1:23 am

Bool bNVOnBool bIsNVKeyPressedInt iNVHotkey = 49 ; 'N';Actor Property PlayerREF AutoImageSpaceModifier Property NightvisionIMAD Auto;TextureSet Property DefaultEyeTXST Auto;TextureSet Property NightvisionTXST AutoEvent OnInit()	RegisterForSingleUpdate(0.25)EndEventEvent OnUpdate()	If bIsNVKeyPressed != Input.IsKeyPressed(iNVHotkey)		bIsNVKeyPressed = !bIsNVKeyPressed		If bIsNVKeyPressed			bNVOn = !bNVOn			If bNVOn				NightvisionIMAD.Apply()				;PlayerREF.SetEyeTexture(NightvisionEyeTXST)			Else				NightvisionIMAD.Remove()				;PlayerREF.SetEyeTexture(DefaultEyeTXST)			EndIf		EndIf	EndIf	RegisterForSingleUpdate(0.25)EndEvent
...at least that's how I'd do it until Input events are available.
User avatar
SamanthaLove
 
Posts: 3565
Joined: Mon Dec 11, 2006 3:54 am

Post » Sat Nov 17, 2012 8:53 am

Thanks for the input. I will try out your ideas.
User avatar
Rob Davidson
 
Posts: 3422
Joined: Thu Aug 02, 2007 2:52 am


Return to V - Skyrim