Properties not changing

Post » Mon Oct 28, 2013 6:21 am

So I've got a mod that automatically calculates your health/magicka/stamina based on your current skills. It has a customisable SkyProc patcher which lets users change how much each skill affects each attribute. The mod uses globals which are set as properties and when the script runs it changes the users health/magicka/stamina. The patcher just changes those globals. But the first values of the globals seem to stick, so changing the values doesn't have any affect? Any idea on what to do?

User avatar
Solène We
 
Posts: 3470
Joined: Tue Mar 27, 2007 7:04 am

Post » Mon Oct 28, 2013 2:46 am

Also I think it would be more useful to create an MCM menu instead of the SkyProc patcher. Would this change how things need to be done? I'm out of the loop a bit.

For reference this is the script:

Spoiler

 Scriptname AutoHealthMagickaStamina extends QuestEvent OnInit()if(AHMSCalculateStats.GetValue() == 1);;Debug.notification("This should only happen once")tempHealth = 0tempMagicka = 0tempStamina = 0tempHealth += (player.getBaseActorValue("OneHanded")) * AHMSOneHandedHealth.getValue()tempMagicka += (player.getBaseActorValue("OneHanded")) * AHMSOneHandedMagicka.getValue()tempStamina += (player.getBaseActorValue("OneHanded")) * AHMSOneHandedStamina.getValue()tempHealth += (player.getBaseActorValue("TwoHanded")) * AHMSTwoHandedHealth.getValue()tempMagicka += (player.getBaseActorValue("TwoHanded")) * AHMSTwoHandedMagicka.getValue()tempStamina += (player.getBaseActorValue("TwoHanded")) * AHMSTwoHandedStamina.getValue()tempHealth += (player.getBaseActorValue("Marksman")) * AHMSMarksmanHealth.getValue()tempMagicka += (player.getBaseActorValue("Marksman")) * AHMSMarksmanMagicka.getValue()tempStamina += (player.getBaseActorValue("Marksman")) * AHMSMarksmanStamina.getValue()tempHealth += (player.getBaseActorValue("Block")) * AHMSBlockHealth.getValue()tempMagicka += (player.getBaseActorValue("Block")) * AHMSBlockMagicka.getValue()tempStamina += (player.getBaseActorValue("Block")) * AHMSBlockStamina.getValue()tempHealth += (player.getBaseActorValue("Smithing")) * AHMSSmithingHealth.getValue()tempMagicka += (player.getBaseActorValue("Smithing")) * AHMSSmithingMagicka.getValue()tempStamina += (player.getBaseActorValue("Smithing")) * AHMSSmithingStamina.getValue()tempHealth += (player.getBaseActorValue("HeavyArmor")) * AHMSHeavyArmorHealth.getValue()tempMagicka += (player.getBaseActorValue("HeavyArmor")) * AHMSHeavyArmorMagicka.getValue()tempStamina += (player.getBaseActorValue("HeavyArmor")) * AHMSHeavyArmorStamina.getValue()tempHealth += (player.getBaseActorValue("LightArmor")) * AHMSLightArmorHealth.getValue()tempMagicka += (player.getBaseActorValue("LightArmor")) * AHMSLightArmorMagicka.getValue()tempStamina += (player.getBaseActorValue("LightArmor")) * AHMSLightArmorStamina.getValue()tempHealth += (player.getBaseActorValue("Pickpocket")) * AHMSPickpocketHealth.getValue()tempMagicka += (player.getBaseActorValue("Pickpocket")) * AHMSPickpocketMagicka.getValue()tempStamina += (player.getBaseActorValue("Pickpocket")) * AHMSPickpocketStamina.getValue()tempHealth += (player.getBaseActorValue("Lockpicking")) * AHMSLockpickingHealth.getValue()tempMagicka += (player.getBaseActorValue("Lockpicking")) * AHMSLockpickingMagicka.getValue()tempStamina += (player.getBaseActorValue("Lockpicking")) * AHMSLockpickingStamina.getValue()tempHealth += (player.getBaseActorValue("Sneak")) * AHMSSneakHealth.getValue()tempMagicka += (player.getBaseActorValue("Sneak")) * AHMSSneakMagicka.getValue()tempStamina += (player.getBaseActorValue("Sneak")) * AHMSSneakStamina.getValue()tempHealth += (player.getBaseActorValue("Alchemy")) * AHMSAlchemyHealth.getValue()tempMagicka += (player.getBaseActorValue("Alchemy")) * AHMSAlchemyMagicka.getValue()tempStamina += (player.getBaseActorValue("Alchemy")) * AHMSAlchemyStamina.getValue()tempHealth += (player.getBaseActorValue("Speechcraft")) * AHMSSpeechcraftHealth.getValue()tempMagicka += (player.getBaseActorValue("Speechcraft")) * AHMSSpeechcraftMagicka.getValue()tempStamina += (player.getBaseActorValue("Speechcraft")) * AHMSSpeechcraftStamina.getValue()tempHealth += (player.getBaseActorValue("Alteration")) * AHMSAlterationHealth.getValue()tempMagicka += (player.getBaseActorValue("Alteration")) * AHMSAlterationMagicka.getValue()tempStamina += (player.getBaseActorValue("Alteration")) * AHMSAlterationStamina.getValue()tempHealth += (player.getBaseActorValue("Conjuration")) * AHMSConjurationHealth.getValue()tempMagicka += (player.getBaseActorValue("Conjuration")) * AHMSConjurationMagicka.getValue()tempStamina += (player.getBaseActorValue("Conjuration")) * AHMSConjurationStamina.getValue()tempHealth += (player.getBaseActorValue("Destruction")) * AHMSDestructionHealth.getValue()tempMagicka += (player.getBaseActorValue("Destruction")) * AHMSDestructionMagicka.getValue()tempStamina += (player.getBaseActorValue("Destruction")) * AHMSDestructionStamina.getValue()tempHealth += (player.getBaseActorValue("Illusion")) * AHMSIllusionHealth.getValue()tempMagicka += (player.getBaseActorValue("Illusion")) * AHMSIllusionMagicka.getValue()tempStamina += (player.getBaseActorValue("Illusion")) * AHMSIllusionStamina.getValue()tempHealth += (player.getBaseActorValue("Restoration")) * AHMSRestorationHealth.getValue()tempMagicka += (player.getBaseActorValue("Restoration")) * AHMSRestorationMagicka.getValue()tempStamina += (player.getBaseActorValue("Restoration")) * AHMSRestorationStamina.getValue()tempHealth += (player.getBaseActorValue("Enchanting")) * AHMSEnchantingHealth.getValue()tempMagicka += (player.getBaseActorValue("Enchanting")) * AHMSEnchantingMagicka.getValue()tempStamina += (player.getBaseActorValue("Enchanting")) * AHMSEnchantingStamina.getValue()player.SetActorValue("Health", tempHealth)player.SetActorValue("Magicka", tempMagicka)player.SetActorValue("Stamina", tempStamina)SetCarryWeight()AHMSCalculateStats.SetValue(0)endifEndEventFunction SetCarryWeight();Debug.Notification("Setting Carry Weight")tempStamina = player.GetBaseActorValue("Stamina")if(tempStamina > 100);Debug.Notification("Whhoho")player.SetActorValue("CarryWeight", 300 + ((tempStamina - 100) * AHMSCarryWeightPerStamina.GetValue()))endifEndFunctionEvent OnStoryIncreaseSkill(string asSkill)Health = player.GetBaseActorValue("Health")Magicka = player.GetBaseActorValue("Magicka")Stamina = player.GetBaseActorValue("Stamina");;Debug.notification("I just increased a skill!");;Combatif(asSkill == "OneHanded");;Debug.notification("It was my One Handed")player.SetActorValue("Health", (Health + AHMSOneHandedHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSOneHandedMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSOneHandedStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifelseif(asSkill =="TwoHanded")player.SetActorValue("Health", (Health + AHMSTwoHandedHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSTwoHandedMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSTwoHandedStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifelseif(asSkill =="Marksman")player.SetActorValue("Health", (Health + AHMSMarksmanHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSMarksmanMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSMarksmanStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifelseif(asSkill =="Block")player.SetActorValue("Health", (Health + AHMSBlockHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSBlockMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSBlockStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifelseif(asSkill =="Smithing")player.SetActorValue("Health", (Health + AHMSSmithingHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSSmithingMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSSmithingStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifelseif(asSkill =="HeavyArmor")player.SetActorValue("Health", (Health + AHMSHeavyArmorHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSHeavyArmorMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSHeavyArmorStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endif;;Stealthelseif(asSkill =="LightArmor")player.SetActorValue("Health", (Health + AHMSLightArmorHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSLightArmorMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSLightArmorStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifelseif(asSkill =="Pickpocket")player.SetActorValue("Health", (Health + AHMSPickpocketHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSPickpocketMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSPickpocketStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifelseif(asSkill =="Lockpicking")player.SetActorValue("Health", (Health + AHMSLockpickingHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSLockpickingMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSLockpickingStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifelseif(asSkill =="Sneak")player.SetActorValue("Health", (Health + AHMSSneakHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSSneakMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSSneakStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifelseif(asSkill =="Alchemy")player.SetActorValue("Health", (Health + AHMSAlchemyHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSAlchemyMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSAlchemyStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifelseif(asSkill =="Speechcraft")player.SetActorValue("Health", (Health + AHMSSpeechcraftHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSSpeechcraftMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSSpeechcraftStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endif;;Magicelseif(asSkill =="Alteration")player.SetActorValue("Health", (Health + AHMSAlterationHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSAlterationMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSAlterationStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifelseif(asSkill =="Conjuration")player.SetActorValue("Health", (Health + AHMSConjurationHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSConjurationMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSConjurationStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifelseif(asSkill =="Destruction")player.SetActorValue("Health", (Health + AHMSDestructionHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSDestructionMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSDestructionStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifelseif(asSkill =="Illusion")player.SetActorValue("Health", (Health + AHMSIllusionHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSIllusionMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSIllusionStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifelseif(asSkill =="Restoration")player.SetActorValue("Health", (Health + AHMSRestorationHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSRestorationMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSRestorationStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifelseif(asSkill =="Enchanting")player.SetActorValue("Health", (Health + AHMSEnchantingHealth.getValue()))player.SetActorValue("Magicka", (Magicka + AHMSEnchantingMagicka.getValue()))player.SetActorValue("Stamina", (Stamina + AHMSEnchantingStamina.getValue()));if(AHMSAutoPerk.GetValue() == 1);endifendifSetCarryWeight()EndEventActor property player autofloat CarryWeightfloat Healthfloat Magickafloat Staminafloat tempHealthfloat tempMagickafloat tempStamina;Quest property AutoHealthMagickaStaminaQuest autoGlobalVariable property AHMSAutoPerk autoGlobalVariable property AHMSCalculateStats autoGlobalVariable Property AHMSCarryWeightPerStamina autoGlobalVariable property AHMSOneHandedHealth autoGlobalVariable property AHMSOneHandedMagicka autoGlobalVariable property AHMSOneHandedStamina autoGlobalVariable property AHMSTwoHandedHealth autoGlobalVariable property AHMSTwoHandedMagicka autoGlobalVariable property AHMSTwoHandedStamina autoGlobalVariable property AHMSMarksmanHealth autoGlobalVariable property AHMSMarksmanMagicka autoGlobalVariable property AHMSMarksmanStamina autoGlobalVariable property AHMSBlockHealth autoGlobalVariable property AHMSBlockMagicka autoGlobalVariable property AHMSBlockStamina autoGlobalVariable property AHMSSmithingHealth autoGlobalVariable property AHMSSmithingMagicka autoGlobalVariable property AHMSSmithingStamina autoGlobalVariable property AHMSHeavyArmorHealth autoGlobalVariable property AHMSHeavyArmorMagicka autoGlobalVariable property AHMSHeavyArmorStamina autoGlobalVariable property AHMSLightArmorHealth autoGlobalVariable property AHMSLightArmorMagicka autoGlobalVariable property AHMSLightArmorStamina autoGlobalVariable property AHMSPickpocketHealth autoGlobalVariable property AHMSPickpocketMagicka autoGlobalVariable property AHMSPickpocketStamina autoGlobalVariable property AHMSLockpickingHealth autoGlobalVariable property AHMSLockpickingMagicka autoGlobalVariable property AHMSLockpickingStamina autoGlobalVariable property AHMSSneakHealth autoGlobalVariable property AHMSSneakMagicka autoGlobalVariable property AHMSSneakStamina autoGlobalVariable property AHMSAlchemyHealth autoGlobalVariable property AHMSAlchemyMagicka autoGlobalVariable property AHMSAlchemyStamina autoGlobalVariable property AHMSSpeechcraftHealth autoGlobalVariable property AHMSSpeechcraftMagicka autoGlobalVariable property AHMSSpeechcraftStamina autoGlobalVariable property AHMSAlterationHealth autoGlobalVariable property AHMSAlterationMagicka autoGlobalVariable property AHMSAlterationStamina autoGlobalVariable property AHMSConjurationHealth autoGlobalVariable property AHMSConjurationMagicka autoGlobalVariable property AHMSConjurationStamina autoGlobalVariable property AHMSDestructionHealth autoGlobalVariable property AHMSDestructionMagicka autoGlobalVariable property AHMSDestructionStamina autoGlobalVariable property AHMSIllusionHealth autoGlobalVariable property AHMSIllusionMagicka autoGlobalVariable property AHMSIllusionStamina autoGlobalVariable property AHMSRestorationHealth autoGlobalVariable property AHMSRestorationMagicka autoGlobalVariable property AHMSRestorationStamina autoGlobalVariable property AHMSEnchantingHealth autoGlobalVariable property AHMSEnchantingMagicka autoGlobalVariable property AHMSEnchantingStamina auto
User avatar
Andres Lechuga
 
Posts: 3406
Joined: Sun Aug 12, 2007 8:47 pm


Return to V - Skyrim