Jump to content

Need help with event


ivanshum

Recommended Posts

Thank you. This I understand. But how to create a global script? In Morrowind was a special menu where you can add scripts running all the time. How to do it in this version? Or is there any script is global? Can the script does not work because of other mods using this event?

 

Can anyone show an example of a working script with the output "Hello World" when charcter increase his level?

 

---------------------------------------

 

Hmm when I change the script WISkillIncrease02 it's work fine but only on event OnStoryIncreaseSkill. I simple save into variable level and check if current level change before increase skill then we get a levelup event)

 

But now there is another problem - the values ​​are green, but I would like them to be white as in the original.

Edited by ivanshum
Link to comment
Share on other sites

Outlandstalker, thanks to the worked script with leveling... (my trouble was with what write after "extends") but ModAV make green color of numbers in game. I think need to use SetAV function. But also need calculate all equiped items that change Health,Magicka,Stamina add this values with ModAV. Or unequip that items before changing and equip after it. How you think?

 

P.S. Sorry if my English not good.

Link to comment
Share on other sites

You need to make only a little math.

 

"SetAV" sets the "BaseAV" of an actor, but "GetAV" gets the total value of "BaseAV + ModAV" back.

"ModAV" is the part you got from equipment, etc. So we need the "BaseAV".

 

Scriptname MyLevelUpScript extends Actor  

Event OnStoryIncreaseLevel(int aiNewLevel)
       Self.SetAV("Health", Self.GetBaseAV("Health") + 20)
       Self.SetAV("Magicka", Self.GetBaseAV("Magicka") + 20)
       Self.SetAV("Stamina", Self.GetBaseAV("Stamina") + 20)
EndEvent

 

We set the "BaseAV" to "BaseAV + 20". The "ModAV" is untouced by the "SetAV". So this comes out: BaseAV + 20 + ModAV

 

Don't use "GetAV + 20", because this contains the ModAV and then you have: BaseAV + ModAV + 20 + ModAV

Edited by Outlandstalker
Link to comment
Share on other sites

  • Recently Browsing   0 members

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