Raised This Month: $12 Target: $400
 3% 

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-28-2011 , 03:49   Re: SMLIB 0.9 BETA (266 Function Stocks)
Reply With Quote #21

When using
PHP Code:
stock bool:Effect_DissolvePlayerRagDoll(client
on player_death i get an error pointing out, that the netprop "dissolvetype" doesn't extist on that entity. You may change it to "m_nDissolveType" or use AcceptEntityInput.
I'm testing in CS:S.

I also often use psychonic's improved GetURandomIntRange(min, max) stock you may want to include?
__________________

Last edited by Peace-Maker; 01-28-2011 at 04:03.
Peace-Maker is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 01-28-2011 , 11:34   Re: SMLIB 0.9 BETA (266 Function Stocks)
Reply With Quote #22

New smlib update available: smlib 0.9.2 beta

Compatibility breaks: none

Changes:

Quote:
Made the argument classname of the Function Entity_FindByName() optional.
Added Function Entity_FindByHammerId()
Added Function Entity_FindByClassName() for completion.
Added Function Math_IsInBounds()
Fixed Function File_LoadTranslations()
Fixed Effect_DissolveEntity() (it used a wrong netprop).
Added parameter dissolveType to Effect_DissolveEntity() and Effect_DissolvePlayerRagDoll()
Fixed some comments.
Added a few missing comments.
Download here.

Quote:
Originally Posted by zeroibis View Post
I noticed that when using:
Client_SetActiveWeapon(client, weapon);
if you set it to knife you do not see it until you fire.
I couldn't reproduce this behavior, it's working fine for me.
Can you post some example code ? thanks.
__________________
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-28-2011 at 12:39.
berni is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 01-28-2011 , 13:28   Re: SMLIB 0.9 BETA (266 Function Stocks)
Reply With Quote #23

Quote:
Originally Posted by berni View Post
hehe, not that easy to understand
the function is actually right, the comment is just wrong.
A size parameter isn't needed, since we we would never make the string bigger, it can only get shorter, that's why we take the max value of an unsigned integer.
Oh, I understand it, but it still makes me cringe. It is a bit of a bad practice. However I do see the point of not having another parameter that isn't really needed.

Last edited by naris; 01-28-2011 at 13:41.
naris is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 01-28-2011 , 13:39   Re: SMLIB 0.9.2 BETA (269 Function Stocks) | updated 28.01.2011
Reply With Quote #24

It would be a lot better if "#include <smlib>" was omitted from the includes, especially since most of them don't require anything from the others. It would also be better if those that do require other includes included only the one they specifically need.

That was you could include only those headers that you want to actually use without having to include all 266+ stocks. Even if they don't get used they will still increase compile times.
naris is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 01-28-2011 , 15:55   Re: SMLIB 0.9.2 BETA (269 Function Stocks) | updated 28.01.2011
Reply With Quote #25

Quote:
Originally Posted by naris View Post
It would be a lot better if "#include <smlib>" was omitted from the includes, especially since most of them don't require anything from the others. It would also be better if those that do require other includes included only the one they specifically need.

That was you could include only those headers that you want to actually use without having to include all 266+ stocks. Even if they don't get used they will still increase compile times.
They are there because otherwise the IDE / Pawnstudio wouldn't be aware of the other functions and not syntax-highlight them. This does not increase compile time since we are using #define checks to make sure every include file gets only compiled one time.

Quote:
Originally Posted by Peace-Maker View Post
I also often use psychonic's improved GetURandomIntRange(min, max) stock you may want to include?
Thanks, will include this, but a rewritten version, since this one doesn't work 100%.
__________________
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-28-2011 , 16:39   Re: SMLIB 0.9.2 BETA (269 Function Stocks) | updated 28.01.2011
Reply With Quote #26

New smlib update available: smlib 0.9.3 beta

Compatibility breaks: none

Changes:

Quote:
  • Added Function String_StripChatColors() (Original code by Psychonic, thanks)
  • Added Functions Math_GetRandomInt() and Math_GetRandomFloat()
  • Added Functions Math_GetPercentage() and Math_GetPercentageFloat()
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

Last edited by berni; 01-28-2011 at 18:28.
berni is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 01-28-2011 , 22:31   Re: SMLIB 0.9.2 BETA (269 Function Stocks) | updated 28.01.2011
Reply With Quote #27

Quote:
Originally Posted by berni View Post
They are there because otherwise the IDE / Pawnstudio wouldn't be aware of the other functions and not syntax-highlight them. This does not increase compile time since we are using #define checks to make sure every include file gets only compiled one time.
Actually it DOES increase compile time as it take longer to open, read and compile 274+ stocks in 18 files than it would to compile say, 10 of them in 1 single file, especially if you are compiling a large system. The #define checking just ensure that it does compile and prevents it from parsing and compiling, but not reading, the file multiple times and causing duplicate definition errors.

Why are you concerned about syntax-highlighting function that are not referenced in the file?

Including all of the includes in all of the files is an extremely bad practice. I would never allow anything that does that into our production systems at VW and neither would any of my co-workers.

Last edited by naris; 01-28-2011 at 22:36.
naris is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 01-29-2011 , 00:11   Re: SMLIB 0.9.2 BETA (274 Function Stocks) | updated 28.01.2011
Reply With Quote #28

Reminds me of windows.h.
__________________
FaTony is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 01-29-2011 , 00:41   Re: SMLIB 0.9.2 BETA (269 Function Stocks) | updated 28.01.2011
Reply With Quote #29

Quote:
Originally Posted by naris View Post
Actually it DOES increase compile time as it take longer to open, read and compile 274+ stocks in 18 files than it would to compile say, 10 of them in 1 single file, especially if you are compiling a large system. The #define checking just ensure that it does compile and prevents it from parsing and compiling, but not reading, the file multiple times and causing duplicate definition errors.
Did you actually test it or do you just think so ?

I just tried it out for you:

Compile time with includes: 1.00 seconds
Compile time without: 1.00 seconds

It doesn't really read all files in every include, it just reads smlib.inc and cancels at the second line:

PHP Code:
#if defined _smlib_included
    #endinput
#endif 
Quote:
Why are you concerned about syntax-highlighting function that are not referenced in the file?
Also wrong, Functions of <sourcemod> and <sdktools> (fake included in smlib.inc) are used in almost every include file.
Again, they aren't really included for the compiler as it will cancel before in smlib.inc.

Quote:
Including all of the includes in all of the files is an extremely bad practice. I would never allow anything that does that into our production systems at VW and neither would any of my co-workers.
Oh, does VW also use SourcePawn & Pawnstudio ? lol

Believe me, I wouldn't do it if there would be a more beautiful way,
but SourcePawn just isn't C++, so we have to take what we get.
And Syntax Highlighting and Autocompletion makes the Development of smlib just way easier.
__________________
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-29-2011 at 01:01.
berni is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 01-29-2011 , 01:06   Re: SMLIB 0.9.2 BETA (274 Function Stocks) | updated 28.01.2011
Reply With Quote #30

Woops, I think I'm already too long awake lol.
I'll rethink this tomorrow when I'm well-rested again.

Actually it could work when we only include the headers when we are working on the include file.
__________________
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 19:19.


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