I hope someone can clear things up a bit for me...
I'm trying to write a script that obtains a skill value, a perk, and do some calculations based on that.
After searching here on the forums and checking the CK wiki, the functions to do that seem pretty obvious. Here is my code, with "(...)" meaning that in the middle is something that should not be relevant at all:
Scriptname KRPHealing extends ObjectReference(...)Int Property Porcentaje Auto(...)Event OnActivate(ObjectReference akActivator) Float SkillSpeech = Game.GetPlayer().GetAV("Speech") As Float if(Game.GetPlayer().HasPerk(Haggling01)) Porcentaje = 10 endif if(Game.GetPlayer().HasPerk(Haggling02)) Porcentaje = 15 endif if(Game.GetPlayer().HasPerk(Haggling03)) Porcentaje = 20 endif if(Game.GetPlayer().HasPerk(Haggling04)) Porcentaje = 25 endif if(Game.GetPlayer().HasPerk(Haggling05)) Porcentaje = 30 endif Float Factor = (3.3 - (1.3 * SkillSpeech/100)) As Float Float Modificador = (1 / (1 + Porcentaje)) As Floatdebug.notification("F: " + Factor)debug.notification("M: "+ Modificador)debug.notification("P: " + Porcentaje) if(!Game.GetPlayer().IsSneaking())(...)The thing is that the output is the following:
F: 3.3
M: 0.000000
P: 20
The only correct output would be "P", as I've got Haggling at 3/5. Obviously Speech is NOT 0.0, so both "F" and "M" should have a different value.
While doing some modifications I got "M" to output "0.04" somehow, but after some editing it just went back to 0.0, and I'm completely unable to get it working. I don't know if this is some kind of CK bug, or if I'm missing something here.
I tried defining the variables as Float at startup also, with same result.
Thanks in advance.


)