Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts

Well you've got a few problems. First of all, if you use OnUpdateGameTime, it will only fire once after the player waits or rests. In the interim, resting or waiting automatically refills the player's magicka.

 

0.000023 is a tiny, tiny number. That works out to 0.138 points of magicka per minute for a level 1 character, a little bit over 8 points of magicka per hour.

 

What you'll need to do is add a check to the current game time in your update block to detect if the game time has changed by more than the update interval, then multiply the damage.

Link to comment
Share on other sites

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

Well you've got a few problems. First of all, if you use OnUpdateGameTime, it will only fire once after the player waits or rests. In the interim, resting or waiting automatically refills the player's magicka.

 

0.000023 is a tiny, tiny number. That works out to 0.138 points of magicka per minute for a level 1 character, a little bit over 8 points of magicka per hour.

 

What you'll need to do is add a check to the current game time in your update block to detect if the game time has changed by more than the update interval, then multiply the damage.

I've disabled most regenerations for every race.

 

Scriptname ConstantMagickaDamage extends Perk  


float MagickaDamage
Actor Property PlayerRef auto


Event OnEffectStart(Actor akTarget, Actor akCaster)


PlayerRef = AkTarget
MagickaDamage = PlayerRef.GetBaseActorValue("Magicka") * 0.000023
PlayerRef.DamageActorValue("Magicka", MagickaDamage)
RegisterForSingleUpdate(1.0)


endEvent


Event OnUpdate()


PlayerRef.DamageActorValue("Magicka", MagickaDamage)
RegisterForSingleUpdate(1.0)


EndEvent


Event OnEffectFinish(Actor akTarget, Actor akCaster)


UnregisterForUpdate()


endEvent

I don't know if OnEffectStart is usable with perk acquisition, maybe I can find something better in the meantime.

 

I'm attaching the script to a Magic Effect, then the effect to an Ability, then the Ability to a Perk.

 

Scriptname ConstantMagickaDamage extends activemagiceffect 


float MagickaDamage
Actor Property PlayerRef auto


Event OnEffectStart(Actor akTarget, Actor akCaster)


PlayerRef = AkTarget
MagickaDamage = PlayerRef.GetBaseActorValue("Magicka") * 0.000023
PlayerRef.DamageActorValue("Magicka", MagickaDamage)
RegisterForSingleUpdate(1.0)


endEvent


Event OnUpdate()


PlayerRef.DamageActorValue("Magicka", MagickaDamage)
RegisterForSingleUpdate(1.0)


EndEvent


Event OnEffectFinish(Actor akTarget, Actor akCaster)


UnregisterForUpdate()


endEvent

Problem now is:

When the BaseActorValue for Magicka changes, does the MagickaDamage adjust itself? Cause if not then that's a problem.

Edited by Kerberus14
Link to comment
Share on other sites

Whether you've disabled regeneration or not, the update event will not take wait or sleep time into consideration unless you script it.

 

If you want to make the damage update for a change in base actor value, you'll just have to recalculate it each update.

Link to comment
Share on other sites

Event OnUpdate()


MagickaDamage = PlayerRef.GetBaseActorValue("Magicka") * 0.000023
PlayerRef.DamageActorValue("Magicka", MagickaDamage) 
RegisterForSingleUpdate(1.0)


EndEvent

Like this?

 

Alright so this is the script

 

Scriptname ConstantMagickaDamage extends activemagiceffect 


float MagickaDamage
Actor Property PlayerRef auto




Event OnEffectStart(Actor akTarget, Actor akCaster)




PlayerRef = AkTarget
MagickaDamage = PlayerRef.GetBaseActorValue("Magicka") * 0.000023
PlayerRef.DamageActorValue("Magicka", MagickaDamage)
RegisterForSingleUpdate(1.0)




endEvent


Event OnUpdate()


MagickaDamage = PlayerRef.GetBaseActorValue("Magicka") * 0.000023
PlayerRef.DamageActorValue("Magicka", MagickaDamage) 
RegisterForSingleUpdate(1.0)


EndEvent


Event OnEffectFinish(Actor akTarget, Actor akCaster)


UnregisterForUpdate()


endEvent

This MagicEffect is attached to an Ability, the Ability is attached to a Perk.

 

What is left to do for this is to add wait/sleep functionality?

Link to comment
Share on other sites

You'll need to catch the amount of game time that has passed and compare it to see if more than a second is passed. The minimum amount of time you can wait is 1 hour.

 

So you'll need another variable, LastTime. In the effectstart event, LastTime should equal utility.GetGameDaysPassed() or the global variable GameDaysPassed.value. In each update block, reset LastTime to utility.GetGameDaysPassed() - LastTime. Now check if LastTime is greater than 0.0416. If it is, then the PC has rested and you'll want multiply your damage by LastTime * 24 * 60 * 60. Then set LastTime to current game time again.

Link to comment
Share on other sites

What can cause a quest to fail to start if all the aliases are optional?

I'm trying to make a quest run more than once, but it will only run once.

I've made all the aliases optional, but It will still only run once.

I made a test quest, with everything the same except it has only one alias, the test quest will restart.

If it matters, the quest is started with SendStoryEvent.

Link to comment
Share on other sites

What can cause a quest to fail to start if all the aliases are optional?

I'm trying to make a quest run more than once, but it will only run once.

I've made all the aliases optional, but It will still only run once.

I made a test quest, with everything the same except it has only one alias, the test quest will restart.

If it matters, the quest is started with SendStoryEvent.

Check to make sure you don't have the "run once" box ticked.

 

May not be the solution but worth a check at any rate.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...