Raised This Month: $81 Target: $400
 20% 

SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011


Post New Thread Reply   
 
Thread Tools Display Modes
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 01-29-2011 , 10:53   Re: SMLIB 0.9.2 BETA (274 Function Stocks) | updated 28.01.2011
Reply With Quote #31

PHP Code:
stock bool:Weapon_IsReloading(weapon
is missing an "return".
__________________
Peace-Maker is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 01-30-2011 , 19:54   Re: SMLIB 0.9.2 BETA (269 Function Stocks) | updated 28.01.2011
Reply With Quote #32

So I am guessing these new random value functions are more random than stock ones like: GetRandomInt() or GetRandomFloat()

Also the math_clamp does actually redefine the value to min or max if it is out of bounds right?
__________________
zeroibis is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 01-30-2011 , 20:09   Re: SMLIB 0.9.2 BETA (269 Function Stocks) | updated 28.01.2011
Reply With Quote #33

Quote:
Originally Posted by zeroibis View Post
So I am guessing these new random value functions are more random than stock ones like: GetRandomInt() or GetRandomFloat()
That's right, it's 100% random and uniform.
I tried psychonic's function first, but that wasn't completely random,
so I rewrote it and made some tests to make sure each value has the same chance of being returned.

Quote:
Originally Posted by zeroibis View Post
Also the math_clamp does actually redefine the value to min or max if it is out of bounds right?
yes, it makes sure the value doesn't go below min or higher than max and corrects it if neccessary.

smlib 0.9.4 will be released today.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0

Last edited by berni; 01-30-2011 at 20:12.
berni is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 01-31-2011 , 02:00   Re: SMLIB 0.9.2 BETA (269 Function Stocks) | updated 28.01.2011
Reply With Quote #34

Quote:
Originally Posted by berni View Post
That's right, it's 100% random and uniform.
Heresy! You will have to use nuclear decay sensors or something like that to achieve 100% randomness and it's results still may be debated on a philosophical level.
__________________
FaTony is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 01-31-2011 , 02:07   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #35

FaTony, your trolling slowly becomes annoying.
We all know that 100% randomness doesn't exist in the universe (chaos theory).
it's as random as it can be now in a sourcemod, and from a relative point of view that's 100%, not gonna debate this further.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 01-31-2011 , 02:10   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #36

New smlib update available: smlib 0.9.4 beta

Compatibility breaks: Removed argument of Effect_FadeIn()

Changes:

Quote:
  • Added Entity_GetParent()
  • Added Entity_RemoveParent()
  • Added Entity_SetParent()
  • Added Math_MoveVector()
  • Removed unnecessary parameter kill in Function Effect_FadeIn()
  • Fixed missing any: type at "..." parameters
  • Added missing return in Function Weapon_IsReloading(), thanks to Peace-Maker!
  • Redesigned the smlib includes to allow including of single smlib includes and save some milli seconds.
Download here.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 01-31-2011 , 02:24   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #37

Quote:
Originally Posted by berni View Post
FaTony, your trolling slowly becomes annoying.
We all know that 100% randomness doesn't exist in the universe (chaos theory).
it's as random as it can be now in a sourcemod, and from a relative point of view that's 100%, not gonna debate this further.
You are scientifically incorrect. I guess SourcePawn is Turing complete, therefore it is possible to write the algorithm of infinite complexity in SourcePawn, so it'll be infinitely more random than yours. Your function is neither 100% random nor as random as possible in SourcePawn.
__________________
FaTony is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 01-31-2011 , 03:30   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #38

If it is random enough to give equal chance to all values in a few thousand runs that is a lot better than what we had before.

Also he said "random as it can be now" in that it is as random as it can be given the time. In order to achieve true randomness you will need to wait for an infinite duration for the now to apply for infinite randomness. So after infinite time is spent creating an infinity random random generator you can then evaluate if it is truly random. (I will try to be placed in suspended animation prior to death to await your results)

On another note I was wondering about effectiveness of the float version when used with decimal percentage values. For example: Math_GetRandomFloat(0.0,1.0)<=0.23

Is this fine, totally wrong or should I be saying 0.00,1.00 or something to improve accuracy?
__________________

Last edited by zeroibis; 01-31-2011 at 03:34.
zeroibis is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 01-31-2011 , 04:16   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #39

Infinite pseudo randomness =/= true randomness to me.
__________________
FaTony is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 01-31-2011 , 12:51   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #40

Quote:
Originally Posted by zeroibis View Post
On another note I was wondering about effectiveness of the float version when used with decimal percentage values. For example: Math_GetRandomFloat(0.0,1.0)<=0.23

Is this fine, totally wrong or should I be saying 0.00,1.00 or something to improve accuracy?
you can add as many 0's as you want, it will stay the same number
I don't know what exactly you mean, it will always have the same effectiveness.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode