Jump to content

I'm trying to make Jaxonz Lights Please compatible with Enderal and I need help with the script


Recommended Posts

At first I thought that changing the values of the FormIDs in the Quest section to the correct one would do the trick.

 

But then I realized that the problem is the script. Magelight in Enderal has a different name so the script can't call it so it just returns "Unable to cast because you don't know that spell". Anyway I opened up the script for Jaxonz Lights Please:

scriptName JaxonzLightsPlease extends Quest
{Simple utility to improve Candlelight and Magelight casting}
;-- Properties --------------------------------------
sound property sndFail auto
globalvariable property giMageLightHotkey auto
spell property splMageLight auto
globalvariable property giCandleLightHotkey auto
actor property actPlayer auto
globalvariable property gfTimeScale auto
spell property splCandleLight auto
;-- Variables ---------------------------------------
Bool bCandleLightOn = false
;-- Functions ---------------------------------------
; Skipped compiler generated GetState
function CastCandleLight()
if actPlayer.GetActorValue("Magicka") >= splCandleLight.GetEffectiveMagickaCost(actPlayer) as Float
actPlayer.DamageActorValue("Magicka", splCandleLight.GetEffectiveMagickaCost(actPlayer) as Float)
splCandleLight.Cast(actPlayer as objectreference, none)
self.RegisterForSingleUpdate((splCandleLight.GetNthEffectDuration(0) - 1) as Float)
else
sndFail.Play(actPlayer as objectreference)
debug.Notification("Insufficient magicka to renew Candlelight, retry in 5 seconds...")
self.RegisterForSingleUpdate(5.00000)
endIf
endFunction
function OnUpdate()
if bCandleLightOn
self.CastCandleLight()
endIf
endFunction
function OnKeyDown(Int KeyCode)
if !utility.IsInMenuMode()
if KeyCode == giCandleLightHotkey.GetValueInt()
if actPlayer.HasSpell(splCandleLight as form)
bCandleLightOn = !bCandleLightOn
if bCandleLightOn
self.CastCandleLight()
else
actPlayer.DispelSpell(splCandleLight)
endIf
else
debug.Notification("Unable to cast Candlelight because you don't know that spell")
endIf
elseIf KeyCode == giMageLightHotkey.GetValueInt()
if actPlayer.HasSpell(splMageLight as form)
if actPlayer.GetActorValue("Magicka") >= splMageLight.GetEffectiveMagickaCost(actPlayer) as Float
actPlayer.DamageActorValue("Magicka", splMageLight.GetEffectiveMagickaCost(actPlayer) as Float)
splMageLight.Cast(actPlayer as objectreference, none)
else
sndFail.Play(actPlayer as objectreference)
endIf
else
debug.Notification("Unable to cast Magelight because you don't know that spell")
endIf
endIf
endIf
endFunction
; Skipped compiler generated GotoState
function OnSettingsChanged()
self.UnregisterForAllKeys()
self.RegisterForKey(giCandleLightHotkey.GetValueInt())
self.RegisterForKey(giMageLightHotkey.GetValueInt())
endFunction
function OnInit()
self.OnSettingsChanged()
endFunction

What's the correct variable for Enderal Magelight so that it can be called properly? I know there are other mods like Quick Light that can accomplish what I want, but I want to take this chance to learn how it works.
Edited by jamerkane34
Link to comment
Share on other sites

To make this work on Enderal, looks like you just need to change the spell properties, and by change I mean fill the properties with the light spells used in Enderal in the Creation Kit. To do this, open the quest this script is attached to, go to the scripts tab and double click on the script to switch the property values.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...