getrandompercentage How does this work?

Post » Fri Nov 16, 2012 11:11 am

Any location that has some documentation on functions like that?

I cant make getrandompercentage work, it would seem that it should simply generate a random number between 1 and 100 and allow u to set a restriction off that number.

Apparently thats not the case, because this doesnt seem to work for me...

...so anyone??


-Exo
User avatar
Susan
 
Posts: 3536
Joined: Sun Jun 25, 2006 2:46 am

Post » Fri Nov 16, 2012 8:23 pm

I can't even find that function. Use utility.RandomInt(0, 100). I use 0 unless you always want there to be some minuscule chance (1%).
User avatar
Emily Martell
 
Posts: 3469
Joined: Sun Dec 03, 2006 7:41 am

Post » Fri Nov 16, 2012 9:59 pm

GetRandomPercent works just fine; it grabs a number between 0 and 99 (inclusive) and then sees if the number matches the comparator you put in. I just used it yesterday.

I can't even find that function. Use utility.RandomInt(0, 100)

GetRandomPercent is a condition function, RandomInt and RandomFloat are papyrus functions.
User avatar
Breautiful
 
Posts: 3539
Joined: Tue Jan 16, 2007 6:51 am

Post » Sat Nov 17, 2012 12:45 am

GetRandomPercent is a condition function, RandomInt and RandomFloat are papyrus functions.

Ahh, okay, I didn't get what that meant, so I Googled it...

Condition Functions are a set of special functions the Creation Kit can access directly from the game with no scripting. They are usually presented as a drop-down list when adding conditions to an object, as in the example pictured below.
http://www.creationkit.com/Category:Condition_Functions

So basically, GetRandomPercent is used INSIDE the CK, in the "Conditions" drop-down list, where as http://www.creationkit.com/RandomFloat_-_Utility, which is what I use in my scripts for a percentage, is a Papyrus function.

I know this is what you said AstralFire, but I didn't get it at first...
User avatar
Bonnie Clyde
 
Posts: 3409
Joined: Thu Jun 22, 2006 10:02 pm


Return to V - Skyrim