senterpat Posted October 15, 2014 Share Posted October 15, 2014 (edited) So having some trouble with the following script. The math checks out, so I think I may be scripting it wrong... The stat boosts function, but they come out way higher then they should. I've tested a lot and cannot get it to function properly. Am I messing up something in the script? begin ScriptEffectStart if SUPERCritterLeveling == 1 && doonce == 0set iRare to getrandompercent / 10if iRare >= getrandompercentset iRand to getrandompercentset Var1 to player.getlevel / 50 ; comes out to "1" at level 50set Var2 to iRand / 200 ; comes out to "0.2" if random is 100set nScale to 1 + GetRandomPercent / 1999 ; This part comes out fineelseset iRand to getrandompercentset Var1 to player.getlevel / 100set Var2 to iRand / 500set nScale to .95000 + GetRandomPercent / 1999 endifif GetLevel < Player.GetLevel;get stat boostsset LevelBoost to (GetLevel) * (Var1 + Var2)set LevelBoost to (GetLevel + LevelBoost)set HealthBoost to (GetAV Health) * (Var1 + Var2)set StrBoost to (GetAV Strength) * (Var1 + Var2)set AgiBoost to (GetAV Agility) * (Var1 + Var2)set PerBoost to (GetAV Perception) * (Var1 + Var2)set EndBoost to (GetAV Endurance) * (Var1 + Var2)set ChrBoost to (GetAV Charisma) * (Var1 + Var2)set IntBoost to (GetAV Intelligence) * (Var1 + Var2)set LckBoost to (GetAV Luck) * (Var1 + Var2)set MeleeBoost to (GetAV MeleeWeapons) * (Var1 + Var2)set UnarmedBoost to (GetAV Unarmed) * (Var1 + Var2)set EnergyBoost to (GetAV EnergyWeapons) * (Var1 + Var2)set GunsBoost to (GetAV Guns) * (Var1 + Var2)set ExplosiveBoost to (GetAV Explosives) * (Var1 + Var2)set MDmgBoost to (GetAV MeleeDamage) * (Var1 + Var2)set UDmgBoost to (GetAV UnarmedDamage) * (Var1 + Var2)set CritBoost to (GetAV CritChance) * (Var1 + Var2)set DRBoost to (GetAV DamageResist) * (Var1 + Var2);apply new statsSetLevel LevelBoostModAv Health HealthBoostModAv Strength StrBoost ModAv Agility AgiBoost ModAv Perception PerBoost ModAv Endurance EndBoost ModAv Charisma ChrBoost ModAv Intelligence IntBoost ModAv Luck LckBoost ModAv Meleeweapons MeleeBoost ModAv Unarmed UnarmedBoost ModAv EnergyWeapons EnergyBoost ModAv Guns GunsBoost ModAv Explosives ExplosiveBoost ModAv MeleeDamage MDmgBoost ModAv UnarmedDamage UDmgBoost ModAv CritChance CritBoost ModAv DamageResist DRBoostsetScale nScaleset doonce to 1endifendif end So the level for example, should come out to the level * 1.2 at the most, but it's coming out as level * 3 or higher Edited October 15, 2014 by senterpat Link to comment Share on other sites More sharing options...
Fallout2AM Posted October 15, 2014 Share Posted October 15, 2014 in which case, when the creature is rare or when it's not rare? -when creature is level 10, is considered rare and player is lv 50:set LevelBoost to (10) * (1 + 0)set LevelBoost to (10 + 10) = 20 -When creature is level 10, is not considered rare and player is lv 50:set LevelBoost to (10) * (0.5 + 0)set LevelBoost to (10+5) = 15 I ignored var2. I would try to PrintC the levelboost and the two vars Link to comment Share on other sites More sharing options...
senterpat Posted October 15, 2014 Author Share Posted October 15, 2014 Thanks alot, but I got it working, didn't change anything from last night, just added the printc and went to check it out and it was working fine :/ maybe I didnt save or something before going in to test last. Either way, I appreciate the help! While your here do you know of a way to check the players maximum level? I know mods can change it, so I want the script to scale with the players max level Link to comment Share on other sites More sharing options...
Fallout2AM Posted October 16, 2014 Share Posted October 16, 2014 I remember a global setting imaxcharacterlevel, but I don't know if it's commonly used by mods. you could check DLCs, the message says they increase level by 5, when you load them the first time Link to comment Share on other sites More sharing options...
senterpat Posted October 16, 2014 Author Share Posted October 16, 2014 Went rooting around PNs scripts and found they use iMaxCharacterLevel, probably what I'll be using, thanks for your help! Link to comment Share on other sites More sharing options...
Recommended Posts